├── .gitignore ├── .licensing.json ├── CMakeLists.txt ├── INSTALL ├── Jenkinsfile ├── LICENSE ├── Makefile.in ├── README ├── aclocal.m4 ├── config.guess ├── config.sub ├── configure ├── configure.in ├── doc ├── CALYPSO.pdf ├── CALYPSO.tex ├── Images │ ├── Paraview_Br.pdf │ ├── Spherical_shell.pdf │ ├── fieldline.pdf │ ├── flow_0.pdf │ ├── flow_1.pdf │ ├── flow_2.pdf │ ├── flow_3.pdf │ ├── flow_4.pdf │ ├── flow_ini.pdf │ ├── parallelize.pdf │ ├── paraview_calc.pdf │ └── paraview_open.pdf └── tex_src │ ├── controls_CALYPSO.tex │ ├── cover_CALYPSO.tex │ ├── gpl2.tex │ ├── install_CALYPSO.tex │ ├── intro_CALYPSO.tex │ ├── mathdef.tex │ ├── model_CALYPSO.tex │ ├── outlines_CALYPSO.tex │ └── programs_CALYPSO.tex ├── docker └── calypso-buildenv-bionic │ ├── Dockerfile │ └── README.md ├── doxygen ├── Doxyfile_CALYPSO └── fieldline_mini.png ├── examples ├── README ├── assemble_resolution │ ├── README │ ├── control_assemble_sph │ ├── sph_lm31r48c_4 │ │ ├── README │ │ └── control_sph_shell │ └── sph_lm41r60c_6 │ │ ├── README │ │ └── control_sph_shell ├── assemble_sph │ ├── 2domains │ │ └── README │ ├── 4domains │ │ └── README │ ├── README │ ├── control_assemble_sph │ ├── sph_lm31r48c_2 │ │ ├── README │ │ └── control_sph_shell │ └── sph_lm31r48c_4 │ │ ├── README │ │ └── control_sph_shell ├── dynamo_benchmark │ ├── Compositional_case_1 │ │ ├── README │ │ ├── control_MHD │ │ ├── control_snapshot │ │ ├── control_sph_shell │ │ ├── field │ │ │ └── README │ │ ├── rst_4 │ │ │ └── README │ │ └── sph_lm31r48c_4 │ │ │ └── README │ ├── dynamobench_case_0 │ │ ├── README │ │ ├── control_MHD │ │ ├── control_snapshot │ │ ├── control_sph_shell │ │ ├── field │ │ │ └── README │ │ ├── rst_4 │ │ │ └── README │ │ ├── sections │ │ │ └── README │ │ └── sph_lm31r48c_4 │ │ │ └── README │ ├── dynamobench_case_1 │ │ ├── Isosurfaces │ │ │ └── README │ │ ├── README │ │ ├── control_MHD │ │ ├── control_iso_temp │ │ ├── control_psf_CMB │ │ ├── control_psf_eq │ │ ├── control_psf_s0.55 │ │ ├── control_psf_z0.3 │ │ ├── control_snapshot │ │ ├── control_sph_shell │ │ ├── field │ │ │ └── README │ │ ├── rst_4 │ │ │ └── README │ │ ├── sections │ │ │ └── README │ │ └── sph_lm31r48c_4 │ │ │ └── README │ ├── dynamobench_case_2 │ │ ├── README │ │ ├── control_MHD │ │ ├── control_psf_CMB │ │ ├── control_psf_ICB │ │ ├── control_psf_eq │ │ ├── control_psf_s0.55 │ │ ├── control_psf_z0.3 │ │ ├── control_snapshot │ │ ├── control_sph_shell │ │ ├── field │ │ │ └── README │ │ ├── rst_4 │ │ │ └── README │ │ ├── sections │ │ │ └── README │ │ └── sph_lm31r48c_ic_4 │ │ │ └── README │ └── pseudo_vacuum │ │ ├── README │ │ ├── control_MHD │ │ ├── control_snapshot │ │ ├── control_sph_shell │ │ ├── field │ │ └── README │ │ ├── rst_4 │ │ └── README │ │ ├── sections │ │ └── README │ │ └── sph_lm31r48c_4 │ │ └── README ├── heat_composition_source │ ├── README │ ├── const_sph_initial_spectr.f90 │ ├── control_MHD │ ├── control_sph_shell │ ├── rst_1 │ │ └── README │ └── sph_lm3r64c_1 │ │ └── README ├── heterogineous_temp │ ├── README │ ├── bc_spectr.btx │ ├── control_MHD │ ├── control_sph_shell │ ├── rst_2 │ │ └── README │ └── sph_lm4r64c_2 │ │ └── README └── spherical_shell │ ├── Chebyshev_points │ ├── README │ ├── control_sph_shell │ └── sph_lm31r48c_4 │ │ └── README │ ├── equidistance │ ├── README │ ├── control_sph_shell │ └── sph_lm24r24e_1 │ │ └── README │ ├── explicitly_defined │ ├── README │ ├── control_sph_shell │ └── sph_lm31r48c_2 │ │ └── README │ └── with_inner_core │ ├── README │ ├── control_sph_shell │ └── sph_lm31r48c_6_ic │ └── README ├── insert_code_header.py ├── install-sh ├── src ├── CALYPSO_src.dox ├── CMakeLists.txt ├── External_libs │ ├── CMakeLists.txt │ ├── FFTPACK5.1D │ │ ├── FFTPACK5.1D - Fast Fourier Transforms, Double Precision.webloc │ │ ├── Makefile │ │ ├── PROBLEM │ │ ├── fftpack5.1_prb.f90 │ │ ├── fftpack5.1d.f90 │ │ ├── fftpack5.pdf │ │ └── test_fftpack5.f90 │ └── Makefile ├── Fortran_libraries │ ├── CMakeLists.txt │ ├── Fortran_libraries.dox │ ├── MHD_src │ │ ├── IO │ │ │ ├── Makefile │ │ │ ├── add_nodal_fields_4_MHD.f90 │ │ │ ├── add_sph_MHD_fields_2_ctl.f90 │ │ │ ├── check_read_bc_file.f90 │ │ │ ├── init_sph_MHD_elapsed_label.f90 │ │ │ ├── m_bc_data_list.f90 │ │ │ ├── m_boundary_condition_IDs.f90 │ │ │ ├── m_ctl_data_composite_norm.f90 │ │ │ ├── m_ctl_data_induct_norm.f90 │ │ │ ├── m_ctl_data_mhd_evo_scheme.f90 │ │ │ ├── m_ctl_data_mhd_evolution.f90 │ │ │ ├── m_ctl_data_mhd_forces.f90 │ │ │ ├── m_ctl_data_mhd_normalize.f90 │ │ │ ├── m_ctl_data_momentum_norm.f90 │ │ │ ├── m_ctl_data_node_boundary.f90 │ │ │ ├── m_ctl_data_node_monitor.f90 │ │ │ ├── m_ctl_data_sph_MHD_noviz.f90 │ │ │ ├── m_ctl_data_sph_MHD_psf.f90 │ │ │ ├── m_ctl_data_surf_boundary.f90 │ │ │ ├── m_ctl_data_temp_model.f90 │ │ │ ├── m_ctl_data_termal_norm.f90 │ │ │ ├── m_sph_boundary_input_data.f90 │ │ │ ├── m_surf_data_list.f90 │ │ │ ├── output_viz_file_control.f90 │ │ │ ├── range_data_IO.f90 │ │ │ ├── read_ctl_data_sph_MHD.f90 │ │ │ ├── set_control_4_composition.f90 │ │ │ ├── set_control_4_force.f90 │ │ │ ├── set_control_4_magne.f90 │ │ │ ├── set_control_4_model.f90 │ │ │ ├── set_control_4_normalize.f90 │ │ │ ├── set_control_4_press.f90 │ │ │ ├── set_control_4_temp.f90 │ │ │ ├── set_control_4_time_steps.f90 │ │ │ ├── set_control_4_velo.f90 │ │ │ ├── set_node_group_types.f90 │ │ │ ├── set_surface_group_types.f90 │ │ │ ├── sph_mhd_rms_IO.f90 │ │ │ └── sph_mhd_rst_IO_control.f90 │ │ ├── Makefile │ │ ├── field_data │ │ │ ├── Makefile │ │ │ ├── copy_MHD_4_pole_trans.f90 │ │ │ ├── lead_pole_data_4_sph_mhd.f90 │ │ │ ├── m_cal_max_indices.f90 │ │ │ ├── m_geometry_data_MHD.f90 │ │ │ ├── node_monitor_IO.f90 │ │ │ ├── output_ucd_file_control.f90 │ │ │ └── pole_energy_flux_sph.f90 │ │ └── sph_MHD │ │ │ ├── FEM_analyzer_sph_MHD.f90 │ │ │ ├── MHD_FFT_selector.F90 │ │ │ ├── Makefile │ │ │ ├── cal_diff_adv_src_explicit.f90 │ │ │ ├── cal_div_buoyancies_sph_MHD.f90 │ │ │ ├── cal_div_of_forces.f90 │ │ │ ├── cal_energy_flux_rj.f90 │ │ │ ├── cal_energy_flux_rtp.f90 │ │ │ ├── cal_explicit_terms.f90 │ │ │ ├── cal_fdm_coefs_4_boundaries.f90 │ │ │ ├── cal_inner_core_rotation.f90 │ │ │ ├── cal_momentum_eq_explicit.f90 │ │ │ ├── cal_nonlinear.f90 │ │ │ ├── cal_nonlinear_sph_MHD.f90 │ │ │ ├── cal_r_buoyancies_on_sph.f90 │ │ │ ├── cal_rot_buoyancies_sph_MHD.f90 │ │ │ ├── cal_sol_sph_MHD_crank.f90 │ │ │ ├── cal_sol_sph_fluid_crank.f90 │ │ │ ├── cal_sph_exp_center.f90 │ │ │ ├── cal_sph_exp_diffusion.f90 │ │ │ ├── cal_sph_exp_fixed_flux.f90 │ │ │ ├── cal_sph_exp_fixed_scalar.f90 │ │ │ ├── cal_sph_exp_nod_cmb_ins.f90 │ │ │ ├── cal_sph_exp_nod_cmb_qvac.f90 │ │ │ ├── cal_sph_exp_nod_icb_ins.f90 │ │ │ ├── cal_sph_exp_nod_icb_qvac.f90 │ │ │ ├── cal_sph_exp_nod_none_bc.f90 │ │ │ ├── cal_sph_exp_rotation.f90 │ │ │ ├── cal_sph_field_by_rotation.f90 │ │ │ ├── cal_vorticity_terms_adams.f90 │ │ │ ├── center_sph_matrices.f90 │ │ │ ├── check_dependency_for_MHD.f90 │ │ │ ├── check_field_dependency.f90 │ │ │ ├── check_sph_radial_mat.f90 │ │ │ ├── const_coriolis_sph_rlm.f90 │ │ │ ├── const_data_4_dynamobench.f90 │ │ │ ├── const_r_mat_4_scalar_sph.f90 │ │ │ ├── const_r_mat_4_vector_sph.f90 │ │ │ ├── const_r_mat_w_center_sph.f90 │ │ │ ├── const_radial_forces_on_bc.f90 │ │ │ ├── const_radial_mat_4_sph.f90 │ │ │ ├── const_sph_diffusion.f90 │ │ │ ├── const_sph_divergence.f90 │ │ │ ├── const_sph_radial_grad.f90 │ │ │ ├── const_sph_rotation.f90 │ │ │ ├── const_wz_coriolis_rtp.f90 │ │ │ ├── construct_MHD_coefficient.f90 │ │ │ ├── copy_MHD_4_sph_trans.f90 │ │ │ ├── copy_snap_4_sph_trans.f90 │ │ │ ├── copy_sph_MHD_4_send_recv.f90 │ │ │ ├── global_field_4_dynamobench.f90 │ │ │ ├── init_FFT_4_MHD.F90 │ │ │ ├── initial_magne_dbench_qvc.f90 │ │ │ ├── initial_magne_dynamobench.f90 │ │ │ ├── input_control_sph_MHD.f90 │ │ │ ├── interact_coriolis_rlm.f90 │ │ │ ├── lead_fields_4_sph_mhd.f90 │ │ │ ├── m_MHD_multi_FFTW.f90 │ │ │ ├── m_addresses_trans_sph_MHD.f90 │ │ │ ├── m_addresses_trans_sph_snap.f90 │ │ │ ├── m_addresses_trans_sph_tmp.f90 │ │ │ ├── m_boundary_params_sph_MHD.f90 │ │ │ ├── m_coef_fdm_free_CMB.f90 │ │ │ ├── m_coef_fdm_free_ICB.f90 │ │ │ ├── m_coef_fdm_to_center.f90 │ │ │ ├── m_control_parameter.f90 │ │ │ ├── m_coriolis_terms_rlm.f90 │ │ │ ├── m_field_4_dynamobench.f90 │ │ │ ├── m_field_at_mid_equator.f90 │ │ │ ├── m_field_on_circle.f90 │ │ │ ├── m_gaunt_coriolis_rlm.f90 │ │ │ ├── m_initial_field_control.f90 │ │ │ ├── m_normalize_parameter.f90 │ │ │ ├── m_physical_property.f90 │ │ │ ├── m_radial_mat_sph_w_center.f90 │ │ │ ├── m_radial_matrices_sph.f90 │ │ │ ├── material_property.f90 │ │ │ ├── pole_poynting_flux_smp.f90 │ │ │ ├── poynting_flux_smp.f90 │ │ │ ├── select_exp_magne_bc.f90 │ │ │ ├── select_exp_scalar_bc.f90 │ │ │ ├── select_exp_velocity_bc.f90 │ │ │ ├── set_bc_flag_sph_velo.f90 │ │ │ ├── set_bc_sph_mhd.f90 │ │ │ ├── set_bc_sph_scalars.f90 │ │ │ ├── set_control_sph_data_MHD.f90 │ │ │ ├── set_control_sph_mhd.f90 │ │ │ ├── set_initial_sph_dynamo.f90 │ │ │ ├── set_radial_mat_sph.f90 │ │ │ ├── set_reference_sph_mhd.f90 │ │ │ ├── set_scalar_boundary_sph.f90 │ │ │ ├── set_sph_exp_free_CMB.f90 │ │ │ ├── set_sph_exp_free_ICB.f90 │ │ │ ├── set_sph_exp_nod_center.f90 │ │ │ ├── set_sph_exp_rigid_CMB.f90 │ │ │ ├── set_sph_exp_rigid_ICB.f90 │ │ │ ├── set_sph_magne_mat_bc.f90 │ │ │ ├── set_sph_restart_IO.f90 │ │ │ ├── set_sph_scalar_mat_bc.f90 │ │ │ ├── sph_MHD_circle_transform.f90 │ │ │ ├── sph_poynting_flux_smp.f90 │ │ │ ├── sph_trans_w_coriols.f90 │ │ │ ├── sph_transforms_4_MHD.f90 │ │ │ ├── sum_coriolis_terms_rlm.f90 │ │ │ ├── t_MHD_multi_FFTW.F90 │ │ │ └── t_boundary_params_sph_MHD.f90 │ ├── Makefile │ ├── PARALLEL_src │ │ ├── CMakeLists.txt │ │ ├── COMM_src │ │ │ ├── Makefile │ │ │ ├── calypso_SR.f90 │ │ │ ├── calypso_SR_2.f90 │ │ │ ├── calypso_SR_3.f90 │ │ │ ├── calypso_SR_6.f90 │ │ │ ├── calypso_SR_N.f90 │ │ │ ├── calypso_SR_core.f90 │ │ │ ├── calypso_SR_int.f90 │ │ │ ├── calypso_SR_rev_N.f90 │ │ │ ├── calypso_mpi.f90 │ │ │ ├── calypso_solver_SR.f90 │ │ │ ├── collect_to_rank0.f90 │ │ │ ├── const_element_comm_table.f90 │ │ │ ├── const_element_comm_tables.f90 │ │ │ ├── const_global_element_ids.f90 │ │ │ ├── field_IO_select.F90 │ │ │ ├── field_data_MPI_IO.f90 │ │ │ ├── field_file_MPI_IO.f90 │ │ │ ├── field_to_send_buffer.f90 │ │ │ ├── hdf5_file_IO.F90 │ │ │ ├── m_array_for_send_recv.f90 │ │ │ ├── m_calypso_mpi_IO.f90 │ │ │ ├── m_ele_sf_eg_comm_tables.f90 │ │ │ ├── m_merged_ucd_data.f90 │ │ │ ├── m_sel_spherical_SRs.f90 │ │ │ ├── m_solver_SR.f90 │ │ │ ├── m_sph_communicators.f90 │ │ │ ├── m_work_time.f90 │ │ │ ├── merged_udt_vtk_file_IO.f90 │ │ │ ├── nod_phys_send_recv.f90 │ │ │ ├── output_parallel_ucd_file.f90 │ │ │ ├── parallel_ucd_IO_select.F90 │ │ │ ├── select_calypso_SR.f90 │ │ │ ├── select_copy_from_recv.f90 │ │ │ ├── set_ctl_parallel_platform.f90 │ │ │ ├── set_from_recv_buf_rev.f90 │ │ │ ├── set_from_recv_buf_rev_tri.f90 │ │ │ ├── set_from_recv_buff_tri.f90 │ │ │ ├── set_from_recv_buffer.f90 │ │ │ ├── set_to_send_buf_tri.f90 │ │ │ ├── set_to_send_buffer.f90 │ │ │ ├── solver_SR.f90 │ │ │ ├── solver_SR_3.f90 │ │ │ ├── solver_SR_6.f90 │ │ │ ├── solver_SR_N.f90 │ │ │ ├── solver_SR_int.f90 │ │ │ ├── solver_SR_type.f90 │ │ │ ├── ucd_file_MPI_IO.f90 │ │ │ └── vtk_file_MPI_IO.f90 │ │ ├── CONST_SPH_GRID │ │ │ ├── Makefile │ │ │ ├── cal_sph_ele_addresses.f90 │ │ │ ├── cal_sph_ele_connects.f90 │ │ │ ├── cal_sph_node_addresses.f90 │ │ │ ├── const_1d_ele_connect_4_sph.f90 │ │ │ ├── const_FEM_mesh_sph_mhd.f90 │ │ │ ├── const_comm_tbl_4_sph_mesh.f90 │ │ │ ├── const_global_sph_grids_modes.f90 │ │ │ ├── const_sph_radial_grid.f90 │ │ │ ├── copy_sph_1d_global_index.f90 │ │ │ ├── gen_sph_grids_modes.f90 │ │ │ ├── m_2d_sph_trans_table.f90 │ │ │ ├── m_read_ctl_gen_sph_shell.f90 │ │ │ ├── m_sph_1d_global_index.f90 │ │ │ ├── m_sph_global_parameter.f90 │ │ │ ├── m_sph_mesh_1d_connect.f90 │ │ │ ├── m_spheric_global_ranks.f90 │ │ │ ├── ordering_sph_mesh_to_rtp.f90 │ │ │ ├── para_gen_sph_grids_modes.f90 │ │ │ ├── set_FEM_mesh_4_sph.f90 │ │ │ ├── set_comm_table_rtm_rlm.f90 │ │ │ ├── set_comm_table_rtp_rj.f90 │ │ │ ├── set_comm_tbl_4_pole_mesh.f90 │ │ │ ├── set_comm_tbl_4_sph_mesh.f90 │ │ │ ├── set_control_sph_subdomains.f90 │ │ │ ├── set_controls_4_sph_shell.f90 │ │ │ ├── set_ctl_gen_shell_grids.f90 │ │ │ ├── set_export_sph_center_mesh.f90 │ │ │ ├── set_global_spherical_param.f90 │ │ │ ├── set_import_sph_center_mesh.f90 │ │ │ ├── set_indices_4_sph_tranform.f90 │ │ │ ├── set_item_4_sph_groups.f90 │ │ │ ├── set_local_index_table_sph.f90 │ │ │ ├── set_local_sphere_by_global.f90 │ │ │ ├── set_local_sphere_param.f90 │ │ │ ├── set_sph_1d_domain_id.f90 │ │ │ ├── set_sph_1d_global_index.f90 │ │ │ ├── set_sph_ele_group.f90 │ │ │ ├── set_sph_groups.f90 │ │ │ ├── set_sph_local_element.f90 │ │ │ ├── set_sph_local_node.f90 │ │ │ ├── set_sph_node_group.f90 │ │ │ ├── set_sph_surf_group.f90 │ │ │ ├── set_sph_tranform_ordering.f90 │ │ │ ├── set_stack_4_sph_groups.f90 │ │ │ └── single_gen_sph_grids_modes.f90 │ │ ├── Makefile │ │ └── SPH_SHELL_src │ │ │ ├── Makefile │ │ │ ├── cal_ave_4_rms_vector_sph.f90 │ │ │ ├── cal_rms_by_sph_spectr.f90 │ │ │ ├── cal_rms_fields_by_sph.f90 │ │ │ ├── cal_sp_rlm_by_matmul.f90 │ │ │ ├── cal_sp_rlm_by_vecprod.f90 │ │ │ ├── cal_sph_exp_1st_diff.f90 │ │ │ ├── cal_vr_rtm_by_matmul.f90 │ │ │ ├── cal_vr_rtm_by_vecprod.f90 │ │ │ ├── circle_transform_single.f90 │ │ │ ├── copy_1st_nodal_4_sph_trans.f90 │ │ │ ├── copy_field_4_sph_trans.f90 │ │ │ ├── copy_pole_field_sph_trans.f90 │ │ │ ├── copy_spectr_4_sph_trans.f90 │ │ │ ├── copy_xyz_field_4_sph_trans.f90 │ │ │ ├── init_FFT_4_sph.F90 │ │ │ ├── init_sph_trans.f90 │ │ │ ├── init_spherical_SRs.f90 │ │ │ ├── leg_b_trans_sym_matmul_big.f90 │ │ │ ├── leg_f_trans_sym_matmul_big.f90 │ │ │ ├── legendre_bwd_sym_matmul.f90 │ │ │ ├── legendre_bwd_trans_blocked.f90 │ │ │ ├── legendre_bwd_trans_krin.f90 │ │ │ ├── legendre_bwd_trans_lgloop.f90 │ │ │ ├── legendre_bwd_trans_matmul.f90 │ │ │ ├── legendre_bwd_trans_org.f90 │ │ │ ├── legendre_bwd_trans_spin.f90 │ │ │ ├── legendre_bwd_trans_sym_spin.f90 │ │ │ ├── legendre_bwd_trans_symmetry.f90 │ │ │ ├── legendre_bwd_trans_testloop.f90 │ │ │ ├── legendre_fwd_sym_matmul.f90 │ │ │ ├── legendre_fwd_trans_blocked.f90 │ │ │ ├── legendre_fwd_trans_krin.f90 │ │ │ ├── legendre_fwd_trans_lgloop.f90 │ │ │ ├── legendre_fwd_trans_matmul.f90 │ │ │ ├── legendre_fwd_trans_org.f90 │ │ │ ├── legendre_fwd_trans_spin.f90 │ │ │ ├── legendre_fwd_trans_sym_spin.f90 │ │ │ ├── legendre_fwd_trans_symmetry.f90 │ │ │ ├── legendre_fwd_trans_testloop.f90 │ │ │ ├── legendre_trans_matmul_big.f90 │ │ │ ├── legendre_trans_sym_matmul.f90 │ │ │ ├── legendre_transform_krin.f90 │ │ │ ├── legendre_transform_lgloop.f90 │ │ │ ├── legendre_transform_matmul.f90 │ │ │ ├── legendre_transform_org.f90 │ │ │ ├── legendre_transform_select.f90 │ │ │ ├── legendre_transform_spin.f90 │ │ │ ├── legendre_transform_testloop.f90 │ │ │ ├── m_circle_transform.f90 │ │ │ ├── m_leg_trans_sym_matmul_big.f90 │ │ │ ├── m_legendre_work_sym_matmul.f90 │ │ │ ├── m_legendre_work_testlooop.f90 │ │ │ ├── m_sph_FFTPACK5.f90 │ │ │ ├── m_sph_field_FFTW.F90 │ │ │ ├── m_sph_single_FFTW.F90 │ │ │ ├── m_work_4_sph_trans.f90 │ │ │ ├── m_work_4_sph_trans_spin.f90 │ │ │ ├── m_work_pole_sph_trans.f90 │ │ │ ├── matmul_for_legendre_trans.F90 │ │ │ ├── ordering_schmidt_trans_krin.f90 │ │ │ ├── ordering_schmidt_trans_spin.f90 │ │ │ ├── parallel_load_data_4_sph.f90 │ │ │ ├── pickup_gauss_coefficients.f90 │ │ │ ├── pickup_sph_coefs.f90 │ │ │ ├── pickup_sph_spectr.f90 │ │ │ ├── pole_sph_transform.f90 │ │ │ ├── products_at_poles.f90 │ │ │ ├── r_interpolate_sph_data.f90 │ │ │ ├── schmidt_b_trans_at_center.f90 │ │ │ ├── schmidt_b_trans_at_pole.f90 │ │ │ ├── sel_fld_copy_4_sph_trans.f90 │ │ │ ├── set_legendre_matrices.f90 │ │ │ ├── set_params_sph_trans.f90 │ │ │ ├── set_radius_func.f90 │ │ │ ├── set_sp_rlm_for_leg_matmul.f90 │ │ │ ├── set_sp_rlm_for_leg_vecprod.f90 │ │ │ ├── set_vr_rtm_for_leg_matmul.f90 │ │ │ ├── set_vr_rtm_for_leg_vecprod.f90 │ │ │ ├── sph_FFT_selector.F90 │ │ │ ├── sph_rtp_zonal_rms_data.f90 │ │ │ ├── sph_transforms.f90 │ │ │ ├── spherical_SRs.f90 │ │ │ ├── spherical_SRs_2.f90 │ │ │ ├── spherical_SRs_3.f90 │ │ │ ├── spherical_SRs_6.f90 │ │ │ ├── spherical_SRs_N.f90 │ │ │ ├── spherical_SRs_int.f90 │ │ │ ├── sum_sph_rms_data.f90 │ │ │ ├── swap_phi_4_sph_trans.f90 │ │ │ ├── t_sph_FFTPACK5.f90 │ │ │ ├── t_sph_field_FFTW.F90 │ │ │ ├── t_sph_multi_FFTW.F90 │ │ │ ├── t_sph_single_FFTW.F90 │ │ │ └── volume_average_4_sph.f90 │ ├── SERIAL_src │ │ ├── BASE │ │ │ ├── Makefile │ │ │ ├── cal_add_smp.f90 │ │ │ ├── cal_inverse_small_matrix.f90 │ │ │ ├── cal_matrix_vector_smp.f90 │ │ │ ├── cal_minmax_and_stacks.f90 │ │ │ ├── cal_num_digits.f90 │ │ │ ├── cal_products_smp.f90 │ │ │ ├── cal_products_w_const_smp.f90 │ │ │ ├── cal_subtract_smp.f90 │ │ │ ├── compare_indices.f90 │ │ │ ├── coordinate_converter.f90 │ │ │ ├── copy_between_two_fields.f90 │ │ │ ├── copy_field_smp.f90 │ │ │ ├── cvt_cyl_asym_t_2_xyz_smp.f90 │ │ │ ├── cvt_cyl_tensor_2_xyz_smp.f90 │ │ │ ├── cvt_cyl_vector_2_xyz_smp.f90 │ │ │ ├── cvt_nodal_and_sph_field.f90 │ │ │ ├── cvt_sph_asym_t_2_xyz_smp.f90 │ │ │ ├── cvt_sph_tensor_2_cyl_smp.f90 │ │ │ ├── cvt_sph_tensor_2_xyz_smp.f90 │ │ │ ├── cvt_sph_vector_2_cyl_smp.f90 │ │ │ ├── cvt_sph_vector_2_xyz_smp.f90 │ │ │ ├── cvt_xyz_tensor_2_cyl_smp.f90 │ │ │ ├── cvt_xyz_tensor_2_sph_smp.f90 │ │ │ ├── cvt_xyz_vector_2_cyl_smp.f90 │ │ │ ├── cvt_xyz_vector_2_sph_smp.f90 │ │ │ ├── delete_field_smp.f90 │ │ │ ├── m_constants.f90 │ │ │ ├── m_error_IDs.f90 │ │ │ ├── m_machine_parameter.f90 │ │ │ ├── m_phys_constants.f90 │ │ │ ├── m_phys_labels.f90 │ │ │ ├── m_precision.f90 │ │ │ ├── m_t_int_parameter.f90 │ │ │ ├── m_t_step_parameter.f90 │ │ │ ├── mag_of_field_smp.f90 │ │ │ ├── overwrite_prod_const_smp.f90 │ │ │ ├── overwrite_products_smp.f90 │ │ │ ├── primefac.f90 │ │ │ ├── quicksort.f90 │ │ │ ├── set_field_address.f90 │ │ │ ├── solver_33_array.f90 │ │ │ ├── subtract_const_smp.f90 │ │ │ ├── t_group_data.f90 │ │ │ ├── t_phys_address.f90 │ │ │ └── t_phys_data.f90 │ │ ├── CMakeLists.txt │ │ ├── FFT_wrapper │ │ │ ├── FFTPACK5_wrapper.f90 │ │ │ ├── FFTW3_multi_wrapper.F90 │ │ │ ├── FFTW3_wrapper.F90 │ │ │ ├── Makefile │ │ │ ├── m_FFT_selector.f90 │ │ │ ├── t_FFTPACK5_wrapper.f90 │ │ │ ├── t_FFTW_wrapper.f90 │ │ │ ├── t_FFT_selector.F90 │ │ │ └── t_multi_FFTW_wrapper.f90 │ │ ├── IO │ │ │ ├── Makefile │ │ │ ├── add_direction_labels.f90 │ │ │ ├── add_nodal_fields_ctl.f90 │ │ │ ├── boundary_data_IO.f90 │ │ │ ├── comm_stack_item_IO.f90 │ │ │ ├── comm_table_IO.f90 │ │ │ ├── copy_time_steps_4_restart.f90 │ │ │ ├── delete_data_files.F90 │ │ │ ├── domain_data_IO.f90 │ │ │ ├── element_connect_IO.f90 │ │ │ ├── field_data_IO.f90 │ │ │ ├── field_file_IO.f90 │ │ │ ├── group_data_IO.f90 │ │ │ ├── m_comm_data_IO.f90 │ │ │ ├── m_control_params_2nd_files.f90 │ │ │ ├── m_control_params_sph_data.f90 │ │ │ ├── m_ctl_data_4_2nd_data.f90 │ │ │ ├── m_ctl_data_4_divide_sphere.f90 │ │ │ ├── m_ctl_data_4_fields.f90 │ │ │ ├── m_ctl_data_4_org_data.f90 │ │ │ ├── m_ctl_data_4_pickup_sph.f90 │ │ │ ├── m_ctl_data_4_platforms.f90 │ │ │ ├── m_ctl_data_4_sphere_model.f90 │ │ │ ├── m_ctl_data_4_time_steps.f90 │ │ │ ├── m_ctl_data_new_time_steps.f90 │ │ │ ├── m_fem_mesh_labels.f90 │ │ │ ├── m_field_file_format.f90 │ │ │ ├── m_file_format_switch.f90 │ │ │ ├── m_gauss_coefs_monitor_data.f90 │ │ │ ├── m_group_data_sph_specr_IO.f90 │ │ │ ├── m_no_heat_Nusselt_num.f90 │ │ │ ├── m_node_id_spherical_IO.f90 │ │ │ ├── m_pickup_sph_spectr_data.f90 │ │ │ ├── m_read_boundary_data.f90 │ │ │ ├── m_read_control_elements.f90 │ │ │ ├── m_read_mesh_data.f90 │ │ │ ├── m_sph_modes_grid_labels.f90 │ │ │ ├── m_subdomain_table_IO.f90 │ │ │ ├── m_time_data_IO.f90 │ │ │ ├── mesh_IO_select.f90 │ │ │ ├── mesh_data_IO.f90 │ │ │ ├── mesh_file_IO.f90 │ │ │ ├── node_geometry_IO.f90 │ │ │ ├── ordering_field_by_viz.f90 │ │ │ ├── set_and_cal_udt_data.f90 │ │ │ ├── set_components_flags.f90 │ │ │ ├── set_control_4_pickup_sph.f90 │ │ │ ├── set_control_platform_data.F90 │ │ │ ├── set_exit_flag_4_visualizer.f90 │ │ │ ├── set_field_file_names.f90 │ │ │ ├── set_fixed_time_step_params.f90 │ │ │ ├── set_nodal_field_name.f90 │ │ │ ├── set_parallel_file_name.f90 │ │ │ ├── set_ucd_data.f90 │ │ │ ├── set_ucd_file_names.f90 │ │ │ ├── skip_comment_f.f90 │ │ │ ├── sph_file_IO_select.f90 │ │ │ ├── sph_global_1d_idx_IO.f90 │ │ │ ├── sph_modes_grids_data_IO.f90 │ │ │ ├── sph_modes_grids_file_IO.f90 │ │ │ ├── sph_rj_groups_IO.f90 │ │ │ ├── sph_rtp_groups_IO.f90 │ │ │ ├── spherical_model_IO.f90 │ │ │ ├── stack_array_IO.f90 │ │ │ ├── t_control_elements.f90 │ │ │ ├── t_field_data_IO.f90 │ │ │ ├── t_read_control_arrays.f90 │ │ │ ├── t_ucd_data.f90 │ │ │ ├── ucd_IO_select.f90 │ │ │ ├── ucd_data_to_buffer.f90 │ │ │ ├── ucd_field_file_IO.f90 │ │ │ ├── udt_data_IO.f90 │ │ │ ├── udt_file_IO.f90 │ │ │ ├── vtk_data_IO.f90 │ │ │ ├── vtk_data_to_buffer.f90 │ │ │ ├── vtk_file_IO.f90 │ │ │ ├── write_field_labels.f90 │ │ │ └── write_ucd_to_vtk_file.f90 │ │ ├── Makefile │ │ ├── SPH_SPECTR_src │ │ │ ├── Makefile │ │ │ ├── cal_zonal_mean_sph_spectr.f90 │ │ │ ├── copy_geom_4_sph_trans_IO.f90 │ │ │ ├── copy_rj_phys_data_4_IO.f90 │ │ │ ├── copy_rj_phys_type_4_IO.f90 │ │ │ ├── copy_rj_spec_name_to_node.f90 │ │ │ ├── copy_sph_comm_table_4_IO.f90 │ │ │ ├── copy_sph_comm_table_4_type.f90 │ │ │ ├── copy_sph_comm_tbl_type_4_IO.f90 │ │ │ ├── copy_sph_groups_from_IO.f90 │ │ │ ├── copy_sph_groups_to_IO.f90 │ │ │ ├── copy_sph_grps_type_from_IO.f90 │ │ │ ├── copy_sph_grps_type_to_IO.f90 │ │ │ ├── copy_sph_node_4_IO.f90 │ │ │ ├── copy_sph_node_4_type.f90 │ │ │ ├── copy_sph_node_type_IO.f90 │ │ │ ├── count_num_sph_smp.f90 │ │ │ ├── extend_potential_field.f90 │ │ │ ├── extend_potential_field_t.f90 │ │ │ ├── load_data_for_sph_IO.f90 │ │ │ ├── m_fdm_coefs.f90 │ │ │ ├── m_global_gauss_coefs.f90 │ │ │ ├── m_group_data_sph_specr.f90 │ │ │ ├── m_poloidal_rotation.f90 │ │ │ ├── m_rms_4_sph_spectr.f90 │ │ │ ├── m_schmidt_poly_on_gauss.f90 │ │ │ ├── m_schmidt_poly_on_rtm.f90 │ │ │ ├── m_sph_phys_address.f90 │ │ │ ├── m_sph_spectr_data.f90 │ │ │ ├── m_sph_trans_comm_table.f90 │ │ │ ├── m_sph_trans_parameter.f90 │ │ │ ├── m_spheric_constants.f90 │ │ │ ├── m_spheric_param_smp.f90 │ │ │ ├── m_spheric_parameter.f90 │ │ │ ├── output_sph_m_square_file.f90 │ │ │ ├── radial_int_for_sph_spec.f90 │ │ │ ├── schmidt_poly_on_rtm_grid.f90 │ │ │ ├── set_control_sph_data.f90 │ │ │ ├── set_radial_grid_sph_shell.f90 │ │ │ ├── set_radius_4_sph_dynamo.f90 │ │ │ ├── set_radius_func_noequi.f90 │ │ │ ├── set_reference_temp_sph.f90 │ │ │ ├── set_special_sph_lm_flags.f90 │ │ │ ├── t_sph_spectr_data.f90 │ │ │ ├── t_sph_trans_comm_tbl.f90 │ │ │ ├── t_spheric_mesh.f90 │ │ │ └── t_spheric_parameter.f90 │ │ ├── gauss_integration │ │ │ ├── Makefile │ │ │ ├── m_gauss_integration.f90 │ │ │ └── m_gauss_points.f90 │ │ └── spherical_harmonics │ │ │ ├── Makefile │ │ │ ├── cal_gaunt_itgs.f90 │ │ │ ├── factorials.f90 │ │ │ ├── legendre.f90 │ │ │ ├── m_schmidt_polynomial.f90 │ │ │ ├── m_spherical_harmonics.f90 │ │ │ ├── normei.f90 │ │ │ ├── normgi.f90 │ │ │ ├── normgi_by_fact.f90 │ │ │ ├── normgi_by_primes.f90 │ │ │ ├── schmidt.f90 │ │ │ ├── schmidt_fix_m.f90 │ │ │ └── spherical_harmonics.f90 │ ├── SOLVER_src │ │ ├── Makefile │ │ └── direct_solver │ │ │ ├── Makefile │ │ │ ├── lubksb_357band.f90 │ │ │ ├── lubksb_357band_mul.f90 │ │ │ ├── m_ludcmp_3band.f90 │ │ │ ├── m_ludcmp_band.f90 │ │ │ └── mat_product_3band_mul.f90 │ ├── UTILS_src │ │ ├── MERGE │ │ │ ├── Makefile │ │ │ ├── m_control_data_4_merge.f90 │ │ │ ├── m_control_param_newsph.f90 │ │ │ ├── new_SPH_restart.f90 │ │ │ ├── parallel_assemble_sph.f90 │ │ │ ├── parallel_sph_assemble.f90 │ │ │ ├── r_interpolate_marged_sph.f90 │ │ │ └── t_assembled_field_IO.F90 │ │ ├── MESH │ │ │ ├── Makefile │ │ │ ├── cal_mesh_position.f90 │ │ │ ├── check_geometries.f90 │ │ │ ├── compare_mesh_structures.f90 │ │ │ ├── const_edge_data.f90 │ │ │ ├── const_mesh_info.f90 │ │ │ ├── const_surface_data.f90 │ │ │ ├── coordinate_convert_4_sph.f90 │ │ │ ├── copy_communication_table.f90 │ │ │ ├── copy_mesh_from_type.f90 │ │ │ ├── copy_mesh_structures.f90 │ │ │ ├── count_overlap.f90 │ │ │ ├── find_element_id_4_node.f90 │ │ │ ├── find_grp_ele_id_4_node.f90 │ │ │ ├── find_node_4_group.f90 │ │ │ ├── load_mesh_data.f90 │ │ │ ├── m_belonged_element_4_node.f90 │ │ │ ├── m_element_hash.f90 │ │ │ ├── m_element_id_4_node.f90 │ │ │ ├── m_geometry_constants.f90 │ │ │ ├── m_geometry_data.f90 │ │ │ ├── m_group_data.f90 │ │ │ ├── m_nod_comm_table.f90 │ │ │ ├── m_node_phys_address.f90 │ │ │ ├── m_node_phys_data.f90 │ │ │ ├── m_quad_2_triangle.f90 │ │ │ ├── m_ucd_data.f90 │ │ │ ├── mark_surf_hash.f90 │ │ │ ├── sel_comp_labels_by_coord.f90 │ │ │ ├── set_comm_table_4_IO.f90 │ │ │ ├── set_connects_4_ele_group.f90 │ │ │ ├── set_connects_4_surf_group.f90 │ │ │ ├── set_edge_data_by_ele.f90 │ │ │ ├── set_edge_hash_by_ele.f90 │ │ │ ├── set_edge_position.f90 │ │ │ ├── set_ele_id_4_node_type.f90 │ │ │ ├── set_element_data_4_IO.f90 │ │ │ ├── set_element_hash.f90 │ │ │ ├── set_element_list_4_surface.f90 │ │ │ ├── set_element_position.f90 │ │ │ ├── set_group_types_4_IO.f90 │ │ │ ├── set_local_id_table_4_1ele.f90 │ │ │ ├── set_mesh_types.f90 │ │ │ ├── set_nnod_4_ele_by_type.f90 │ │ │ ├── set_nnod_for_ele_by_type.f90 │ │ │ ├── set_nnod_for_element.f90 │ │ │ ├── set_node_4_group.f90 │ │ │ ├── set_node_data_4_IO.f90 │ │ │ ├── set_norm_nod_4_surf_grp.f90 │ │ │ ├── set_size_4_smp_types.f90 │ │ │ ├── set_smp_4_group_types.f90 │ │ │ ├── set_surface_data.f90 │ │ │ ├── set_surface_hash.f90 │ │ │ ├── set_surface_id_4_surf_grp.f90 │ │ │ ├── set_surface_node.f90 │ │ │ ├── set_surface_position.f90 │ │ │ ├── set_ucd_data_to_type.f90 │ │ │ ├── t_belonged_element_4_node.f90 │ │ │ ├── t_comm_table.f90 │ │ │ ├── t_edge_data.f90 │ │ │ ├── t_geometry_data.f90 │ │ │ ├── t_group_connects.f90 │ │ │ ├── t_mesh_data.f90 │ │ │ ├── t_near_mesh_id_4_node.f90 │ │ │ ├── t_next_node_ele_4_node.f90 │ │ │ ├── t_sum_hash.f90 │ │ │ ├── t_surface_boundary.f90 │ │ │ ├── t_surface_data.f90 │ │ │ ├── t_surface_group_connect.f90 │ │ │ └── t_surface_group_geometry.f90 │ │ └── Makefile │ └── VIZ_src │ │ ├── Makefile │ │ └── surfacing │ │ ├── Makefile │ │ ├── convert_components_4_viz.f90 │ │ ├── copy_psf_data_to_SR.f90 │ │ ├── find_node_and_patch_psf.f90 │ │ ├── m_control_data_4_iso.f90 │ │ ├── m_control_data_4_psf.f90 │ │ ├── m_control_data_sections.f90 │ │ ├── m_control_params_4_iso.f90 │ │ ├── m_control_params_4_psf.f90 │ │ ├── m_cross_section.f90 │ │ ├── m_intersection_data_0.f90 │ │ ├── m_intersection_data_1.f90 │ │ ├── m_intersection_data_10.f90 │ │ ├── m_intersection_data_11.f90 │ │ ├── m_intersection_data_12.f90 │ │ ├── m_intersection_data_13.f90 │ │ ├── m_intersection_data_14.f90 │ │ ├── m_intersection_data_2.f90 │ │ ├── m_intersection_data_3.f90 │ │ ├── m_intersection_data_4.f90 │ │ ├── m_intersection_data_5.f90 │ │ ├── m_intersection_data_6.f90 │ │ ├── m_intersection_data_7.f90 │ │ ├── m_intersection_data_8.f90 │ │ ├── m_intersection_data_9.f90 │ │ ├── m_isosurface.f90 │ │ ├── m_mpi_flags_4_section.f90 │ │ ├── m_psf_case_table.f90 │ │ ├── merge_output_4_psf.f90 │ │ ├── output_4_psf.f90 │ │ ├── patch_4_psf.f90 │ │ ├── psf_global_nod_id.f90 │ │ ├── search_ele_list_for_psf.f90 │ │ ├── sections_for_1st.f90 │ │ ├── set_area_4_viz.f90 │ │ ├── set_const_4_sections.f90 │ │ ├── set_cross_section_coefs.f90 │ │ ├── set_edge_list_for_psf.f90 │ │ ├── set_element_list_for_psf.f90 │ │ ├── set_field_comp_for_viz.f90 │ │ ├── set_fields_for_psf.f90 │ │ ├── set_nodal_field_for_psf.f90 │ │ ├── set_node_for_sections.f90 │ │ ├── set_node_list_for_psf.f90 │ │ ├── set_node_on_edge_quad_psf.f90 │ │ ├── set_nodes_for_psf.f90 │ │ ├── set_patches_for_psf.f90 │ │ ├── set_psf_case_table.f90 │ │ ├── set_psf_iso_control.f90 │ │ ├── set_psf_nodes_4_by_surf_grp.f90 │ │ ├── set_psf_patch_4_by_surf_grp.f90 │ │ ├── set_surface_list_for_psf.f90 │ │ ├── t_psf_geometry_list.f90 │ │ └── t_psf_patch_data.f90 ├── Makefile ├── cmake │ └── Modules │ │ ├── FindFFTW.cmake │ │ ├── FindOpenMP_Fortran.cmake │ │ └── LICENSE.txt ├── confdb │ ├── aclocal_fc.m4 │ ├── ax_blas.m4 │ ├── ax_blas_f77_func.m4 │ ├── ax_check_zlib.m4 │ ├── ax_lib_hdf5.m4 │ ├── ax_mpi.m4 │ ├── ax_openmp.m4 │ ├── ax_pthread.m4 │ ├── check_gnu_make.m4 │ └── pkg.m4 ├── module_dependency │ └── make_module_dependency.f90 ├── option_settings └── programs │ ├── CMakeLists.txt │ ├── Makefile │ ├── SPH_MHD │ ├── CMakeLists.txt │ ├── Makefile │ ├── SPH_analyzer_MHD.f90 │ ├── analyzer_sph_MHD_w_psf.f90 │ ├── control_MHD │ └── main_sph_MHD_w_psf.f90 │ ├── data_utilities │ ├── CMakeLists.txt │ ├── INITIAL_FIELD │ │ ├── Makefile │ │ ├── SPH_analyzer_add_initial.f90 │ │ ├── SPH_analyzer_const_initial.f90 │ │ ├── const_sph_initial_spectr.f90 │ │ ├── main_sph_add_initial_fld.f90 │ │ └── main_sph_initial_fld.f90 │ ├── MERGE │ │ ├── Makefile │ │ ├── analyzer_assemble_sph.f90 │ │ ├── control_assemble_sph │ │ └── main_assemble_sph.f90 │ ├── Makefile │ ├── SNAPSHOT_MHD │ │ ├── Makefile │ │ ├── SPH_analyzer_d_bench.f90 │ │ ├── SPH_analyzer_snap.f90 │ │ ├── SPH_analyzer_zm_snap.f90 │ │ ├── analyzer_sph_dynamobench.f90 │ │ ├── analyzer_sph_snap_w_psf.f90 │ │ ├── analyzer_sph_zm_snap.f90 │ │ ├── main_sph_dynamobench.f90 │ │ ├── main_sph_snapshot_w_psf.f90 │ │ └── main_sph_zm_snap.f90 │ └── TIME_HISTORIES │ │ ├── Makefile │ │ ├── cal_tave_sph_ene_spectr.f90 │ │ ├── compare_sph_mean_square.f90 │ │ ├── m_tave_sph_ene_spectr.f90 │ │ ├── simple_sph_spectr_data_IO.f90 │ │ ├── simple_sph_spectr_head_IO.f90 │ │ ├── sph_mean_square_IO_select.f90 │ │ ├── t_average_sph_ene_spec.f90 │ │ ├── t_read_sph_spectra.f90 │ │ └── tave_picked_sph_spec_data.f90 │ └── mesh_utilities │ ├── CMakeLists.txt │ ├── Makefile │ ├── analyzer_gen_sph_grids.f90 │ ├── analyzer_test_sph.f90 │ ├── cmp_trans_sph_indices.f90 │ ├── cmp_trans_sph_tests.f90 │ ├── main_generate_sph_grids.f90 │ └── main_test_sph.f90 └── tests ├── CMakeLists.txt ├── Dynamobench_case1 ├── CMakeLists.txt ├── Makefile ├── control_MHD ├── control_sph_shell ├── field │ └── README ├── reference │ └── sph_pwr_volume_s.dat ├── rst_4 │ └── README └── sph_lm31r48c_4 │ └── README ├── Dynamobench_case2 ├── CMakeLists.txt ├── Makefile ├── control_MHD ├── control_sph_shell ├── field │ └── README ├── reference │ └── sph_pwr_volume_s.dat ├── rst_4 │ └── README └── sph_lm31r48c_ic_4 │ └── README ├── Makefile └── heterogineous_temp ├── CMakeLists.txt ├── Makefile ├── bc_spectr.btx ├── control_MHD ├── control_sph_shell ├── field └── README ├── reference └── sph_pwr_volume_s.dat ├── rst_2 └── README └── sph_lm4r64c_2 └── README /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | 4 | config.log 5 | 6 | config.status 7 | 8 | .DS_Store 9 | 10 | CALYPSO.bbl 11 | 12 | CALYPSO.blg 13 | 14 | CALYPSO.synctex.gz 15 | 16 | CALYPSO.toc 17 | 18 | CALYPSO.out 19 | 20 | CALYPSO.log 21 | 22 | CALYPSO.aux 23 | 24 | -------------------------------------------------------------------------------- /.licensing.json: -------------------------------------------------------------------------------- 1 | { 2 | "License": "gpl-2", 3 | "IgnoredFiles": [ 4 | ".licensing.json", 5 | ".git/**", 6 | ".gitignore", 7 | "doc/**", 8 | "tests/**", 9 | "examples/**", 10 | "doxygen/**", 11 | "**/*m4", 12 | "**/CMakeLists.txt", 13 | "config.guess", 14 | "config.sub", 15 | "configure", 16 | "configure.in", 17 | "insert_code_header.py", 18 | "INSTALL", 19 | "install-sh", 20 | "LICENSE", 21 | "**/Makefile*", 22 | "README", 23 | "src/External_libs/**", 24 | "src/cmake/**", 25 | "**/*dox", 26 | "src/option_settings", 27 | "**/.DS_Store" 28 | ], 29 | "LicenseParameters": { 30 | "ProjectName": "Calypso", 31 | "year": "2016", 32 | "fullname": "Hiroaki Matsui" 33 | }, 34 | "CommentedFiles": { 35 | "**/*.f90": { 36 | "LineCommentStart": "! ", 37 | "InsertAtLine": 0 38 | }, 39 | "**/*.F90": { 40 | "LineCommentStart": "! ", 41 | "InsertAtLine": 0 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The name of our project is "CALYPSO". CMakeLists files in this project can 2 | # refer to the root source directory of the project as ${CALYPSO_SOURCE_DIR} and 3 | # to the root binary directory of the project as ${CALYPSO_BINARY_DIR}. 4 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 5 | PROJECT(CALYPSO Fortran) 6 | SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/src/cmake/Modules/") 7 | ENABLE_LANGUAGE(Fortran) 8 | 9 | SET(CMAKE_Fortran_MODULE_DIRECTORY "${CALYPSO_BINARY_DIR}/include") 10 | SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CALYPSO_BINARY_DIR}/bin") 11 | SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CALYPSO_BINARY_DIR}/lib") 12 | # Use the preprocessor to handle #ifdefs 13 | ADD_DEFINITIONS(-cpp) 14 | 15 | IF(EXISTS ${CMAKE_SOURCE_DIR}/tests/CMakeLists.txt) 16 | ENABLE_TESTING() 17 | ADD_SUBDIRECTORY(tests) 18 | ENDIF() 19 | 20 | # Look for MPI and add the required flags if found 21 | FIND_PACKAGE(MPI) 22 | ADD_DEFINITIONS(${MPI_Fortran_COMPILE_FLAGS}) 23 | INCLUDE_DIRECTORIES(${MPI_Fortran_INCLUDE_PATH}) 24 | 25 | # Look for OpenMP and use it if available 26 | FIND_PACKAGE(OpenMP_Fortran) 27 | SET (CMAKE_Fortran_FLAGS ${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}) 28 | 29 | # Look for FFTW3 and use it if available 30 | FIND_PACKAGE(FFTW) 31 | IF (FFTW_FOUND) 32 | ADD_DEFINITIONS(-DFFTW3) 33 | INCLUDE_DIRECTORIES(${FFTW_INCLUDES}) 34 | ENDIF(FFTW_FOUND) 35 | 36 | # Find HDF5 - if it's not parallel then don't use it at all 37 | FIND_PACKAGE(HDF5 COMPONENTS Fortran) 38 | IF (HDF5_FOUND AND HDF5_IS_PARALLEL) 39 | ADD_DEFINITIONS(-DHDF5_IO) 40 | ADD_DEFINITIONS(${HDF5_DEFINITIONS}) 41 | INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS}) 42 | ENDIF(HDF5_FOUND AND HDF5_IS_PARALLEL) 43 | 44 | # Recurse into the "src" subdirectory 45 | ADD_SUBDIRECTORY (src) 46 | 47 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------ 2 | ! Brief installation procedure 3 | !------------------------------------------------------------------------ 4 | ! 5 | 6 | For detailed instllation procedure, please read documentation page 16--19. 7 | 8 | The easiest way to install Calypso is the following: 9 | 10 | 1. Configuration 11 | ./configure [--prefix=/path] 12 | 2. Compile 13 | make 14 | 3. Install 15 | make install 16 | 4. Clean up objects 17 | make clean 18 | 19 | For details of the configuration, type 20 | ./configure --help 21 | 22 | Calypso also supports CMake configuration and compilation. The procedure for this is: 23 | 24 | 1. Create build directory and configure 25 | mkdir build ; cd build ; cmake .. 26 | 2. Compile 27 | make 28 | 29 | For a guided configuration, use ccmake instead of cmake: 30 | 31 | 1. Create build directory and configure 32 | mkdir build ; cd build ; ccmake .. 33 | 2. Edit configuration options 34 | 3. Compile 35 | make 36 | 37 | 38 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!groovy 2 | 3 | pipeline { 4 | agent { 5 | docker { 6 | image 'geodynamics/calypso-buildenv-bionic:latest' 7 | alwaysPull true 8 | } 9 | } 10 | 11 | options { 12 | timeout(time: 2, unit: 'HOURS') 13 | } 14 | 15 | stages { 16 | stage('Build & Test') { 17 | steps { 18 | sh ''' 19 | ./configure \ 20 | --enable-fftw3 \ 21 | --with-hdf5 \ 22 | --with-blas 23 | ''' 24 | sh ''' 25 | # Fix OpenMPI issue in Docker : https://github.com/open-mpi/ompi/issues/4948 26 | export OMPI_MCA_btl_vader_single_copy_mechanism=none 27 | 28 | make 29 | ''' 30 | } 31 | } 32 | } 33 | 34 | post { always { cleanWs() } } 35 | } 36 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Calypso is a set of programs for MHD dynamo simulation in a rotating spherical 2 | shell using spherical harmonics expansion methods. 3 | 4 | The Calypso distribution consists of the following files and directories. 5 | 6 | % ls 7 | CMakeLists.txt LICENSE README configure.in examples/ 8 | INSTALL Makefile.in configure doxygen/ src/ 9 | 10 | INSTALL: Brief installation procedure 11 | LICENSE: License 12 | README: This file 13 | 14 | configure.in: Input file for autoconf 15 | Makefile.in: Template for Makefile used by configure 16 | configure: Configuration script 17 | CMakeLists.txt: Configuration file for CMake 18 | 19 | bin: Directory for programs (created by make) 20 | doxygen: Directory for source documentation 21 | examples: Directory for examples 22 | src: Directory for source files 23 | work: Work directory (created by make) 24 | 25 | For installation instructions, please read INSTALL or the documentation page 16--19. 26 | 27 | -------------------------------------------------------------------------------- /doc/CALYPSO.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/CALYPSO.pdf -------------------------------------------------------------------------------- /doc/CALYPSO.tex: -------------------------------------------------------------------------------- 1 | % Template article for preprint document class `elsart' 2 | % SP 2001/01/05 3 | 4 | \documentclass[12pt]{article} 5 | \usepackage{graphicx,color,amssymb} 6 | \usepackage{times,textpos} 7 | \usepackage{geometry} 8 | \usepackage{epstopdf,hyperref,float} 9 | %\usepackage{epstopdf,hyperref,float,slashbox} 10 | \usepackage[titletoc,toc,title]{appendix} 11 | 12 | % Use the option doublespacing or reviewcopy to obtain double line spacing 13 | % \documentclass[doublespacing]{elsart} 14 | 15 | % The amssymb package provides various useful mathematical symbols 16 | %\usepackage{amssymb} 17 | \begin{document} 18 | \input{tex_src/cover_CALYPSO.tex} 19 | \input{tex_src/mathdef.tex} 20 | %\maketitle 21 | %\input{captions.txt} 22 | % 23 | % 24 | 25 | \section*{Preface} 26 | Calypso is a program package of magnetohydrodynamics (MHD) simulations in a rotating spherical shell for geodynamo problems. This package consists of the simulation program, preprocessing program, post processing program to generate field data for visualization programs, and several small utilities. The simulation program runs on parallel computing systems using MPI and OpenMP parallelization. 27 | 28 | \newpage 29 | \tableofcontents 30 | 31 | % 32 | \newpage 33 | \input{tex_src/intro_CALYPSO.tex} 34 | 35 | \newpage 36 | \input{tex_src/model_CALYPSO.tex} 37 | 38 | \input{tex_src/install_CALYPSO.tex} 39 | 40 | \input{tex_src/outlines_CALYPSO.tex} 41 | % 42 | 43 | \newpage 44 | \input{tex_src/programs_CALYPSO.tex} 45 | 46 | \newpage 47 | \begin{thebibliography}{10} 48 | 49 | \bibitem{Bullard:54} Bullard, E. C. and Gellman, H., Homogeneous dynamos and terrestrial magnetism, {\it Proc. of the Roy. Soc. of London}, {\bf A247}, 213--278, 1954. 50 | \bibitem{Uli:2001} Christensen, U.R., Aubert, J., Cardin, P., Dormy, E., Gibbons, S., Glatzmaier, G. A., Grote, E., Honkura, H., Jones, C., Kono, M., Matsushima, M., Sakuraba, A., Takahashi, F., Tilgner, A., Wicht, J. and Zhang, K., A numerical dynamo benchmark, {\it Physics of the Earth and Planetary Interiors}, {\bf 128}, 25--34, 2001. 51 | 52 | \end{thebibliography} 53 | 54 | 55 | \newpage 56 | \begin{appendices} 57 | \input{tex_src/controls_CALYPSO.tex} 58 | \newpage 59 | \input{tex_src/gpl2.tex} 60 | \end{appendices} 61 | 62 | \end{document} 63 | -------------------------------------------------------------------------------- /doc/Images/Paraview_Br.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/Paraview_Br.pdf -------------------------------------------------------------------------------- /doc/Images/Spherical_shell.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/Spherical_shell.pdf -------------------------------------------------------------------------------- /doc/Images/fieldline.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/fieldline.pdf -------------------------------------------------------------------------------- /doc/Images/flow_0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/flow_0.pdf -------------------------------------------------------------------------------- /doc/Images/flow_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/flow_1.pdf -------------------------------------------------------------------------------- /doc/Images/flow_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/flow_2.pdf -------------------------------------------------------------------------------- /doc/Images/flow_3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/flow_3.pdf -------------------------------------------------------------------------------- /doc/Images/flow_4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/flow_4.pdf -------------------------------------------------------------------------------- /doc/Images/flow_ini.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/flow_ini.pdf -------------------------------------------------------------------------------- /doc/Images/parallelize.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/parallelize.pdf -------------------------------------------------------------------------------- /doc/Images/paraview_calc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/paraview_calc.pdf -------------------------------------------------------------------------------- /doc/Images/paraview_open.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doc/Images/paraview_open.pdf -------------------------------------------------------------------------------- /doc/tex_src/mathdef.tex: -------------------------------------------------------------------------------- 1 | %******************************macros********************************* 2 | %-----$B;z2<$2(B 3 | \newcommand{\para}{\hspace*{\parindent}} 4 | %-----fraction \by{}{} 5 | \newcommand{\by}[2]{\frac{\displaystyle #1}{\displaystyle #2}} 6 | %-----vector (arrow) \hvec{} 7 | \newcommand{\hvec}[1]{\vec{\mathstrut #1}} 8 | %-----time derivative \tdot{} 9 | \newcommand{\tdot}[1]{\stackrel{\cdot}{#1}} 10 | \newcommand{\tdots}[1]{\stackrel{\cdot \cdot}{#1}} 11 | %-----Bold vector 12 | \newcommand{\bvec}[1]{ \mbox{\boldmath$#1$} } 13 | %-----vector operation ( by text) 14 | \newcommand{\tgrad}{ \mbox{grad} \; } 15 | \newcommand{\tdiv}{ \mbox{div} \; } 16 | \newcommand{\trot}{ \mbox{rot} \; } 17 | % 18 | %-----vector operation ( by nabla) 19 | \newcommand{\bgrad}{ \nabla } 20 | \newcommand{\bdiv}{ \nabla \cdot } 21 | \newcommand{\brot}{ \nabla \times } 22 | %-----partial \rd 23 | \newcommand{\rd}{\partial} 24 | %-----l(l+1) 25 | \newcommand{\llone}[1]{ #1 \left( #1 +1 \right) } 26 | %-----s 27 | %\newcommand{\koube}{ \left[ \left\{ \left( \frac{1}{q_{\perp}^{2}} - 28 | % \frac{1}{q_{\parallel}^{2}} \right) \frac{k_{\parallel}p_{\parallel}} 29 | % {\gamma} + \frac{1}{q_{\parallel}^{2} \frac{{k_{\parallel}p_{\parallel 0}} 30 | % {\gamma} - \by{1}{q_{\perp}^{2}} \omega \right} f_{l}(p_{\perp},p_{\parallel}%) 31 | %+ \by{1}{q_{\perp}^{2}} \left( \omega - k_{\parallel} \frac{p_{\parallel}} 32 | % {\gamma} \right) f_{l-1}(p_{\perp},p_{\parallel}) \right]} 33 | 34 | 35 | -------------------------------------------------------------------------------- /docker/calypso-buildenv-bionic/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:bionic 2 | 3 | RUN apt update && \ 4 | DEBIAN_FRONTEND='noninteractive' \ 5 | DEBCONF_NONINTERACTIVE_SEEN='true' \ 6 | apt install --yes \ 7 | build-essential \ 8 | doxygen \ 9 | gfortran \ 10 | git \ 11 | libblas-dev \ 12 | libfftw3-dev \ 13 | libhdf5-openmpi-dev \ 14 | libopenmpi-dev \ 15 | openmpi-bin \ 16 | openmpi-common \ 17 | pkg-config 18 | -------------------------------------------------------------------------------- /docker/calypso-buildenv-bionic/README.md: -------------------------------------------------------------------------------- 1 | Build environment for Calypso using the Ubuntu Bionic (18.04) Docker container. 2 | -------------------------------------------------------------------------------- /doxygen/fieldline_mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/doxygen/fieldline_mini.png -------------------------------------------------------------------------------- /examples/README: -------------------------------------------------------------------------------- 1 | Calypso examples consists of the following three parts. 2 | 1. spherical_shell: Examples to generate varius spherical shell model. 3 | Chebyshev_points: Simulation domain with Chebyshev collocation points in outer core 4 | equidistance: Simulation domain with equaidistance grids in outer core 5 | explicitly_defined: Simulation domain with explicitly defined grids 6 | with_inner_core: Simulation domain including inner core and external of the fluid shell 7 | 8 | To test the program run [CALIPSO_DIR]/bin/gen_sph_grid in each directory. 9 | 10 | 2. dynamo_benchmark: Examples of dynamo benchmark by Christensen et. al.(2001) 11 | 12 | 3. assemble_sph: Example to conversion spctr data between data with differenct number of parallelization. 13 | 14 | 4. heat_composition_source: Example to use heat and composition source terms. 15 | 16 | 5. heterogineous_temp: Example to apply heat and compositional heteroginity at boundaries. -------------------------------------------------------------------------------- /examples/assemble_resolution/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using spectr data assemble program 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the files for the spectr data assemble between different resolution and time step. 6 | This example consists of the following files and directories 7 | 8 | control_assemble_sph: control file for data transform 9 | 10 | sph_lm31r48c_4: Directory for spherical harmonics index table 11 | sph_lm41r60c_6: Directory for new spherical harmonics index table 12 | 4domains: Directory for original restart files 13 | 6domains: Directory for new restart files 14 | 15 | The simulation procedure is the following 16 | 17 | 1: Run index generation program in both directory for index tables 18 | [assemble_sph]% cd sph_lm31r48c_4 19 | [sph_lm31r48c_4]% [CALYPSO_DIR]/bin/gen_sph_grids 20 | [sph_lm31r48c_4]% cd ../sph_lm31r48c_2 21 | [sph_lm41r60c_6]% [CALYPSO_DIR]/bin/gen_sph_grids 22 | [sph_lm41r60c_6]% cd ../ 23 | 24 | 2. Copy spectr data from benchmark example 25 | [assemble_sph]% cp ../dynamo_benchmark/dynamobench_case_1/rst_4/rst.1.* 4domains/ 26 | 27 | 3. Run data transform program 28 | [assemble_sph]% [CALYPSO_DIR]/bin/assemble_sph 29 | 30 | 4. Converted data is saved in '6doamins' directory. -------------------------------------------------------------------------------- /examples/assemble_resolution/control_assemble_sph: -------------------------------------------------------------------------------- 1 | begin assemble_control 2 | ! 3 | begin data_files_def 4 | num_subdomain_ctl 4 5 | 6 | sph_file_prefix 'sph_lm31r48c_4/in' 7 | restart_file_prefix '4domains/rst' 8 | end data_files_def 9 | ! 10 | begin new_data_files_def 11 | num_new_domain_ctl 6 12 | ! 13 | new_sph_mode_prefix 'sph_lm41r60c_6/in' 14 | new_restart_prefix '6domains/rst' 15 | ! 16 | delete_original_data_flag 'NO' 17 | end new_data_files_def 18 | ! 19 | begin control 20 | !!!!! information for time integration 21 | begin time_step_ctl 22 | i_step_init_ctl 1 23 | i_step_finish_ctl 1 24 | i_step_rst_ctl 1 25 | end time_step_ctl 26 | ! 27 | begin new_time_step_ctl 28 | i_step_init_ctl 1000 29 | i_step_rst_ctl 50 30 | time_init_ctl 5.0e0 31 | end new_time_step_ctl 32 | end control 33 | ! 34 | begin newrst_magne_ctl 35 | magnetic_field_ratio_ctl 1.0d0 36 | end newrst_magne_ctl 37 | end assemble_control 38 | -------------------------------------------------------------------------------- /examples/assemble_resolution/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example of data assembling test 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics table data for the example are stored in this directory. 6 | 7 | To generate spherical harmonics table data, run the following command: 8 | 9 | [sph_lm31r48c_4]$ [CALYPSO_DIR]/bin/gen_sph_grids 10 | -------------------------------------------------------------------------------- /examples/assemble_resolution/sph_lm31r48c_4/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 2 9 | num_horizontal_domain_ctl 2 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 31 14 | ! 15 | ngrid_meridonal_ctl 48 16 | ngrid_zonal_ctl 96 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 48 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/assemble_resolution/sph_lm41r60c_6/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example of data assembling test 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics table data for the example are stored in this directory. 6 | 7 | To generate spherical harmonics table data, run the following command: 8 | 9 | [sph_lm31r48c_2]$ [CALYPSO_DIR]/bin/gen_sph_grids 10 | -------------------------------------------------------------------------------- /examples/assemble_resolution/sph_lm41r60c_6/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 6 4 | sph_file_prefix 'in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 3 9 | num_horizontal_domain_ctl 2 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 41 14 | ! 15 | ngrid_meridonal_ctl 64 16 | ngrid_zonal_ctl 128 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 59 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/assemble_sph/2domains/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example of data assembling test 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the directory for spectr data files for restarting. 6 | Files named "rst.[restart step #].[process #].fst" are saved 7 | in this directory. 8 | -------------------------------------------------------------------------------- /examples/assemble_sph/4domains/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/assemble_sph/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using spectr data assemble program 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the files for the spectr data assemble program. 6 | This example consists of the following files and directories 7 | 8 | control_assemble_sph: control file for data transform 9 | 10 | sph_lm31r48c_4: Directory for spherical harmonics index table 11 | sph_lm31r48c_2: Directory for new spherical harmonics index table 12 | 4domains: Directory for original restart files 13 | 2domains: Directory for new restart files 14 | 15 | The simulation procedure is the following 16 | 17 | 1. Copy spectr data from benchmark example 18 | [assemble_sph]$ cp ../dynamo_benchmark/dynamobench_case_1/sph_lm31r48c_4/* sph_lm31r48c_4/ 19 | [assemble_sph]$ cp ../dynamo_benchmark/dynamobench_case_1/rst_4/rst.* 4domains/ 20 | 21 | 2: Run index generation program for new domein decomposition 22 | [sph_lm31r48c_4]$ sph_lm31r48c_2 23 | [sph_lm31r48c_2]$ [CALYPSO_DIR]/bin/gen_sph_grids 24 | [sph_lm31r48c_2]$ cd ../ 25 | 26 | 3. Run data transform program 27 | [sph_lm31r48c_2]$ [CALYPSO_DIR]/bin/assemble_sph 28 | 29 | 4. Converted data is saved in '2doamins' directory. -------------------------------------------------------------------------------- /examples/assemble_sph/control_assemble_sph: -------------------------------------------------------------------------------- 1 | begin assemble_control 2 | ! 3 | begin data_files_def 4 | num_subdomain_ctl 4 5 | 6 | sph_file_prefix 'sph_lm31r48c_4/in' 7 | restart_file_prefix '4domains/rst' 8 | end data_files_def 9 | ! 10 | begin new_data_files_def 11 | num_new_domain_ctl 2 12 | ! 13 | new_sph_mode_prefix 'sph_lm31r48c_2/in' 14 | new_restart_prefix '2domains/rst' 15 | ! 16 | delete_original_data_flag 'NO' 17 | end new_data_files_def 18 | ! 19 | begin control 20 | !!!!! information for time integration 21 | begin time_step_ctl 22 | i_step_init_ctl 1 23 | i_step_finish_ctl 4 24 | i_step_rst_ctl 1 25 | end time_step_ctl 26 | end control 27 | ! 28 | begin newrst_magne_ctl 29 | magnetic_field_ratio_ctl 1.0d0 30 | end newrst_magne_ctl 31 | end assemble_control 32 | -------------------------------------------------------------------------------- /examples/assemble_sph/sph_lm31r48c_2/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example of data assembling test 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics table data for the example are stored in this directory. 6 | 7 | To generate spherical harmonics table data, run the following command: 8 | 9 | [sph_lm31r48c_2]$ [CALYPSO_DIR]/bin/gen_sph_grids 10 | -------------------------------------------------------------------------------- /examples/assemble_sph/sph_lm31r48c_2/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 2 4 | sph_file_prefix 'in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 2 9 | num_horizontal_domain_ctl 2 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 31 14 | ! 15 | ngrid_meridonal_ctl 48 16 | ngrid_zonal_ctl 96 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 48 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/assemble_sph/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example of data assembling test 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics table data for the example are stored in this directory. 6 | 7 | To generate spherical harmonics table data, run the following command: 8 | 9 | [sph_lm31r48c_4]$ [CALYPSO_DIR]/bin/gen_sph_grids 10 | -------------------------------------------------------------------------------- /examples/assemble_sph/sph_lm31r48c_4/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 2 9 | num_horizontal_domain_ctl 2 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 31 14 | ! 15 | ngrid_meridonal_ctl 48 16 | ngrid_zonal_ctl 96 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 48 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/Compositional_case_1/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! using compositional variation instead of temperature 4 | ! Please see Christensen et.al. (2001) for the model description 5 | !----------------------------------------------------------------------- 6 | ! 7 | Here is the input files for the dynamo benchmark case 1. 8 | This example consists of the following files and directories. 9 | 10 | control_sph_shell: control file for gen_sph_grids 11 | control_MHD: control file for simulation 12 | control_snapshot: control file for data analysis 13 | 14 | sph_lm31r48c_4: Directory for spherical harmonics index table 15 | rst_4: Directory for restart files 16 | field: Directory for field data files 17 | 18 | This example only run with 4 MPI processes. The simulation procedure is the following 19 | 20 | 1: Run index generation program as 21 | [dynamobench_case_1]$ [CALYPSO_DIR]/bin/gen_sph_grids 22 | 23 | 2. Run simulation program 24 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_mhd 25 | 26 | 3. To continue the simulation change rst_ctl in control_MHD from 27 | rst_ctl dynamo_benchmark_1 28 | to 29 | rst_ctl start_from_rst_file 30 | And, start simulation again by 2. 31 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/Compositional_case_1/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_4/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | array num_domain_sph_grid 2 9 | num_domain_sph_grid radial 2 end 10 | num_domain_sph_grid meridional 2 end 11 | end array num_domain_sph_grid 12 | ! 13 | array num_domain_legendre 2 14 | num_domain_legendre radial 2 end 15 | num_domain_legendre zonal 2 end 16 | end array num_domain_legendre 17 | ! 18 | array num_domain_spectr 1 19 | num_domain_spectr modes 4 end 20 | end array num_domain_spectr 21 | end num_domain_ctl 22 | ! 23 | begin num_grid_sph 24 | truncation_level_ctl 31 25 | ! 26 | ngrid_meridonal_ctl 48 27 | ngrid_zonal_ctl 96 28 | ! 29 | radial_grid_type_ctl Chebyshev 30 | num_fluid_grid_ctl 48 31 | fluid_core_size_ctl 1.0 32 | ICB_to_CMB_ratio_ctl 0.35 33 | end num_grid_sph 34 | end spherical_shell_ctl 35 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/Compositional_case_1/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! using compositional variation instead of temperature 4 | ! Please see Christensen et.al. (2001) for the model description 5 | !----------------------------------------------------------------------- 6 | ! 7 | 8 | Field data for visualization are stored in this directory. -------------------------------------------------------------------------------- /examples/dynamo_benchmark/Compositional_case_1/rst_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! using compositional variation instead of temperature 4 | ! Please see Christensen et.al. (2001) for the model description 5 | !----------------------------------------------------------------------- 6 | ! 7 | 8 | Restart data files are stored in this directory. -------------------------------------------------------------------------------- /examples/dynamo_benchmark/Compositional_case_1/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! using compositional variation instead of temperature 4 | ! Please see Christensen et.al. (2001) for the model description 5 | !----------------------------------------------------------------------- 6 | ! 7 | 8 | Spherical harmonics index data are stored in this directory. -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_0/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 0 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Here is the input files for the dynamo benchmark case 0. 7 | This example consists of the following files and directories 8 | 9 | control_sph_shell: control file for gen_sph_grids 10 | control_MHD: control file for simulation 11 | control_snapshot: control file for data analysis 12 | 13 | sph_lm31r48c_4: Directory for spherical harmonics index table 14 | rst_4: Directory for restart files 15 | field: Directory for field data files 16 | 17 | This example only run with 4 MPI processes. The simulation procedure is the following 18 | 19 | 1: Run index generation program as 20 | [dynamobench_case_1]$ [CALYPSO_DIR]/bin/gen_sph_grids 21 | 22 | 2. Run simulation program 23 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_mhd 24 | 25 | 3. To continue the simulation change rst_ctl in control_MHD from 26 | rst_ctl dynamo_benchmark_0 27 | to 28 | rst_ctl start_from_rst_file 29 | And, start simulation again by 2. 30 | 31 | 4. To check the required results for dynamo benchmark, run 32 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_dynamobench 33 | 34 | 35 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_0/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_4/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 2 9 | num_horizontal_domain_ctl 2 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 31 14 | ! 15 | ngrid_meridonal_ctl 48 16 | ngrid_zonal_ctl 96 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 48 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_0/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 0 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Field data for visualization are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_0/rst_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 0 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_0/sections/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 0 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Sectioning data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_0/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 0 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Spherical harmonics table data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/Isosurfaces/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Isosurface data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Here is the input files for the dynamo benchmark case 1 using 4 MPI processes. 7 | This example consists of the following files and directories 8 | 9 | control_sph_shell: control file for gen_sph_grids 10 | control_MHD: control file for simulation 11 | control_snapshot: control file for data analysis 12 | 13 | sph_lm31r48c_4: Directory for spherical harmonics index table 14 | rst_4: Directory for restart files 15 | field: Directory for field data files 16 | 17 | The simulation procedure is the following 18 | 19 | 1: Run index generation program as 20 | [dynamobench_case_1]$ [CALYPSO_DIR]/bin/gen_sph_grids 21 | 22 | 2. Generate initial field 23 | [dynamobench_case_1]$ [CALYPSO_DIR]/bin/sph_initial_field 24 | 25 | 3. Run simulation program 26 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_mhd 27 | 28 | 4. To check the required results for dynamo benchmark, run 29 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_dynamobench 30 | 31 | Enjoy!! 32 | 33 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/control_iso_temp: -------------------------------------------------------------------------------- 1 | ! 2 | begin isosurface_ctl 3 | isosurface_file_prefix 'Isosurfaces/temp0_7' 4 | ! 5 | begin isosurf_define 6 | isosurf_field temperature 7 | isosurf_component scalar 8 | isosurf_value 0.7 9 | ! 10 | array isosurf_area_ctl 1 11 | isosurf_area_ctl all 12 | end array isosurf_area_ctl 13 | end isosurf_define 14 | ! 15 | begin field_on_isosurf 16 | result_type 'field' 17 | ! 18 | array output_field 3 19 | output_field velocity vector end 20 | output_field velocity radial end 21 | output_field magnetic_field vector end 22 | end array output_field 23 | end field_on_isosurf 24 | ! 25 | end isosurface_ctl 26 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/control_psf_CMB: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | ! example of control for Kemo's surface rendering 4 | ! 5 | begin cross_section_ctl 6 | section_file_prefix 'sections/CMB' 7 | ! 8 | begin surface_define 9 | section_method equation 10 | ! 11 | array coefs_ctl 10 12 | coefs_ctl x2 1.0 13 | coefs_ctl y2 1.0 14 | coefs_ctl z2 1.0 15 | coefs_ctl xy 0.0 16 | coefs_ctl yz 0.0 17 | coefs_ctl zx 0.0 18 | coefs_ctl x 0.0 19 | coefs_ctl y 0.0 20 | coefs_ctl z 0.0 21 | coefs_ctl const -2.3667 22 | end array coefs_ctl 23 | ! 24 | array section_area_ctl 1 25 | section_area_ctl all end 26 | end array section_area_ctl 27 | end surface_define 28 | ! 29 | begin output_field_define 30 | array output_field 2 31 | output_field magnetic_field vector 32 | output_field magnetic_field radial 33 | end array output_field 34 | end output_field_define 35 | end cross_section_ctl 36 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/control_psf_eq: -------------------------------------------------------------------------------- 1 | ! 2 | ! example of sectioning at equatoreial plane 3 | ! 4 | begin cross_section_ctl 5 | section_file_prefix 'sections/equator' 6 | ! 7 | begin surface_define 8 | section_method equation 9 | ! 10 | array coefs_ctl 10 11 | coefs_ctl x2 0.0 12 | coefs_ctl y2 0.0 13 | coefs_ctl z2 0.0 14 | coefs_ctl xy 0.0 15 | coefs_ctl yz 0.0 16 | coefs_ctl zx 0.0 17 | coefs_ctl x 0.0 18 | coefs_ctl y 0.0 19 | coefs_ctl z 1.0 20 | coefs_ctl const 0.0 21 | end array coefs_ctl 22 | ! 23 | array section_area_ctl 1 24 | section_area_ctl all end 25 | end array section_area_ctl 26 | end surface_define 27 | ! 28 | begin output_field_define 29 | array output_field 8 30 | output_field temperature scalar 31 | output_field velocity vector 32 | output_field velocity radial 33 | output_field velocity phi 34 | output_field vorticity z 35 | output_field magnetic_field vector 36 | output_field magnetic_field theta 37 | ! 38 | output_field Lorentz_work scalar 39 | end array output_field 40 | end output_field_define 41 | end cross_section_ctl 42 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/control_psf_s0.55: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | ! example of control for Kemo's surface rendering 4 | ! 5 | begin cross_section_ctl 6 | section_file_prefix 'sections/cylinder_s055' 7 | ! 8 | begin surface_define 9 | section_method equation 10 | ! 11 | array coefs_ctl 10 12 | coefs_ctl x2 1.0 13 | coefs_ctl y2 1.0 14 | coefs_ctl z2 0.0 15 | coefs_ctl xy 0.0 16 | coefs_ctl yz 0.0 17 | coefs_ctl zx 0.0 18 | coefs_ctl x 0.0 19 | coefs_ctl y 0.0 20 | coefs_ctl z 0.0 21 | coefs_ctl const -0.3025 22 | end array coefs_ctl 23 | ! 24 | array section_area_ctl 1 25 | section_area_ctl all end 26 | end array section_area_ctl 27 | end surface_define 28 | ! 29 | begin output_field_define 30 | array output_field 9 31 | output_field temperature scalar 32 | output_field velocity vector 33 | output_field velocity cylinder_r 34 | output_field velocity phi 35 | output_field vorticity vector 36 | output_field magnetic_field vector 37 | output_field magnetic_field cylinder_r 38 | output_field magnetic_field phi 39 | ! 40 | output_field Lorentz_work scalar 41 | end array output_field 42 | end output_field_define 43 | end cross_section_ctl 44 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/control_psf_z0.3: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | ! example of control for Kemo's surface rendering 4 | ! 5 | begin cross_section_ctl 6 | section_file_prefix 'sections/section_z03' 7 | ! 8 | begin surface_define 9 | section_method equation 10 | ! 11 | array coefs_ctl 10 12 | coefs_ctl x2 0.0 13 | coefs_ctl y2 0.0 14 | coefs_ctl z2 0.0 15 | coefs_ctl xy 0.0 16 | coefs_ctl yz 0.0 17 | coefs_ctl zx 0.0 18 | coefs_ctl x 0.0 19 | coefs_ctl y 0.0 20 | coefs_ctl z 1.0 21 | coefs_ctl const -0.3 22 | end array coefs_ctl 23 | ! 24 | array section_area_ctl 1 25 | section_area_ctl all end 26 | end array section_area_ctl 27 | end surface_define 28 | ! 29 | begin output_field_define 30 | array output_field 9 31 | output_field temperature scalar 32 | output_field velocity vector 33 | output_field velocity cylinder_r 34 | output_field velocity phi 35 | output_field vorticity vector 36 | output_field magnetic_field vector 37 | output_field magnetic_field cylinder_r 38 | output_field magnetic_field phi 39 | ! 40 | output_field Lorentz_work scalar 41 | end array output_field 42 | end output_field_define 43 | end cross_section_ctl 44 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_4/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | array num_domain_sph_grid 2 9 | num_domain_sph_grid radial 2 end 10 | num_domain_sph_grid meridional 2 end 11 | end array num_domain_sph_grid 12 | ! 13 | array num_domain_legendre 2 14 | num_domain_legendre radial 2 end 15 | num_domain_legendre zonal 2 end 16 | end array num_domain_legendre 17 | ! 18 | array num_domain_spectr 1 19 | num_domain_spectr modes 4 end 20 | end array num_domain_spectr 21 | end num_domain_ctl 22 | ! 23 | begin num_grid_sph 24 | truncation_level_ctl 31 25 | ! 26 | ngrid_meridonal_ctl 48 27 | ngrid_zonal_ctl 96 28 | ! 29 | raidal_grid_type_ctl Chebyshev 30 | num_fluid_grid_ctl 48 31 | fluid_core_size_ctl 1.0 32 | ICB_to_CMB_ratio_ctl 0.35 33 | end num_grid_sph 34 | end spherical_shell_ctl 35 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Field data for visualization are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/rst_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/sections/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Sectioning data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_1/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Spherical harmonics table data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Here is the input files for the dynamo benchmark case 1. 7 | This example consists of the following files and directories 8 | 9 | control_sph_shell: control file for gen_sph_grids 10 | control_MHD: control file for simulation 11 | control_snapshot: control file for data analysis 12 | 13 | sph_lm31r48c_4_ic: Directory for spherical harmonics index table 14 | rst_4: Directory for restart files 15 | field: Directory for field data files 16 | 17 | The simulation procedure is the following 18 | 19 | 1: Run index generation program as 20 | [dynamobench_case_1]$ [CALYPSO_DIR]/bin/gen_sph_grids 21 | 22 | 2. Run simulation program 23 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_mhd 24 | 25 | 3. To continue the simulation change rst_ctl in control_MHD from 26 | rst_ctl dynamo_benchmark_2 27 | to 28 | rst_ctl start_from_rst_file 29 | And, start simulation again by 2. 30 | 31 | 4. To check the required results for dynamo benchmark, run 32 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_dynamobench 33 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/control_psf_CMB: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | ! example of control for Kemo's surface rendering 4 | ! 5 | begin cross_section_ctl 6 | section_file_prefix 'sections/CMB' 7 | ! 8 | begin surface_define 9 | section_method sphere 10 | ! 11 | array center_position 3 12 | center_position x 0.0 13 | center_position y 0.0 14 | center_position z 0.0 15 | end array center_position 16 | ! 17 | radius 1.5384 18 | ! 19 | array section_area_ctl 1 20 | section_area_ctl all 21 | end array section_area_ctl 22 | end surface_define 23 | ! 24 | begin output_field_define 25 | array output_field 2 26 | output_field magnetic_field vector 27 | output_field magnetic_field radial 28 | end array output_field 29 | end output_field_define 30 | end cross_section_ctl 31 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/control_psf_ICB: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | ! example of control for Kemo's surface rendering 4 | ! 5 | begin cross_section_ctl 6 | section_file_prefix 'sections/ICB' 7 | ! 8 | begin surface_define 9 | section_method sphere 10 | ! 11 | array center_position 3 12 | center_position x 0.0 13 | center_position y 0.0 14 | center_position z 0.0 15 | end array center_position 16 | ! 17 | radius 0.5384 18 | ! 19 | array section_area_ctl 1 20 | section_area_ctl outer_core 21 | end array section_area_ctl 22 | end surface_define 23 | ! 24 | begin output_field_define 25 | array output_field 2 26 | output_field magnetic_field vector 27 | output_field magnetic_field radial 28 | end array output_field 29 | end output_field_define 30 | end cross_section_ctl 31 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/control_psf_eq: -------------------------------------------------------------------------------- 1 | ! 2 | ! example of sectioning at equatoreial plane 3 | ! 4 | begin cross_section_ctl 5 | section_file_prefix 'sections/equator' 6 | ! 7 | begin surface_define 8 | section_method plane 9 | ! 10 | array normal_vector 3 11 | normal_vector x 0.0 12 | normal_vector y 0.0 13 | normal_vector z 1.0 14 | end array normal_vector 15 | ! 16 | array center_position 3 17 | center_position x 0.0 18 | center_position y 0.0 19 | center_position z 0.0 20 | end array center_position 21 | ! 22 | array section_area_ctl 2 23 | section_area_ctl inner_core end 24 | section_area_ctl outer_core end 25 | end array section_area_ctl 26 | end surface_define 27 | ! 28 | begin output_field_define 29 | array output_field 8 30 | output_field temperature scalar 31 | output_field velocity vector 32 | output_field velocity radial 33 | output_field velocity phi 34 | output_field vorticity z 35 | output_field magnetic_field vector 36 | output_field magnetic_field theta 37 | ! 38 | output_field Lorentz_work scalar 39 | end array output_field 40 | end output_field_define 41 | end cross_section_ctl 42 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/control_psf_s0.55: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | ! example of control for Kemo's surface rendering 4 | ! 5 | begin cross_section_ctl 6 | section_file_prefix 'sections/cylinder_s055' 7 | ! 8 | begin surface_define 9 | section_method ellipsoid 10 | ! 11 | array center_position 3 12 | center_position x 0.0 13 | center_position y 0.0 14 | center_position z 0.0 15 | end array center_position 16 | ! 17 | array axial_length 3 18 | axial_length x 0.55 19 | axial_length y 0.55 20 | axial_length z -1.0 21 | end array axial_length 22 | ! 23 | array section_area_ctl 1 24 | section_area_ctl all end 25 | end array section_area_ctl 26 | end surface_define 27 | ! 28 | begin output_field_define 29 | array output_field 9 30 | output_field temperature scalar 31 | output_field velocity vector 32 | output_field velocity cylinder_r 33 | output_field velocity phi 34 | output_field vorticity vector 35 | output_field magnetic_field vector 36 | output_field magnetic_field cylinder_r 37 | output_field magnetic_field phi 38 | ! 39 | output_field Lorentz_work scalar 40 | end array output_field 41 | end output_field_define 42 | end cross_section_ctl 43 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/control_psf_z0.3: -------------------------------------------------------------------------------- 1 | ! 2 | ! 3 | ! example of control for Kemo's surface rendering 4 | ! 5 | begin cross_section_ctl 6 | section_file_prefix 'sections/section_z03' 7 | ! 8 | begin surface_define 9 | section_method plane 10 | ! 11 | array normal_vector 3 12 | normal_vector x 0.0 13 | normal_vector y 0.0 14 | normal_vector z 1.0 15 | end array normal_vector 16 | ! 17 | array center_position 3 18 | center_position x 0.0 19 | center_position y 0.0 20 | center_position z 0.3 21 | end array center_position 22 | ! 23 | array section_area_ctl 1 24 | section_area_ctl outer_core 25 | end array section_area_ctl 26 | end surface_define 27 | ! 28 | begin output_field_define 29 | array output_field 9 30 | output_field temperature scalar 31 | output_field velocity vector 32 | output_field velocity cylinder_r 33 | output_field velocity phi 34 | output_field vorticity vector 35 | output_field magnetic_field vector 36 | output_field magnetic_field cylinder_r 37 | output_field magnetic_field phi 38 | ! 39 | output_field Lorentz_work scalar 40 | end array output_field 41 | end output_field_define 42 | end cross_section_ctl 43 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_ic_4/in' 5 | ! 6 | memory_conservation_ctl 'YES' 7 | end data_files_def 8 | ! 9 | begin num_domain_ctl 10 | num_radial_domain_ctl 2 11 | num_horizontal_domain_ctl 2 12 | end num_domain_ctl 13 | ! 14 | begin num_grid_sph 15 | truncation_level_ctl 31 16 | ! 17 | ngrid_meridonal_ctl 48 18 | ngrid_zonal_ctl 96 19 | ! 20 | radial_grid_type_ctl Chebyshev 21 | num_fluid_grid_ctl 48 22 | fluid_core_size_ctl 1.0 23 | ICB_to_CMB_ratio_ctl 0.35 24 | Min_radius_ctl 0.0 25 | Max_radius_ctl 2.0 26 | end num_grid_sph 27 | end spherical_shell_ctl 28 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Field data for visualization are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/rst_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/sections/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Sectioning data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/dynamobench_case_2/sph_lm31r48c_ic_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Spherical harmonics table data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/pseudo_vacuum/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark with pseudo vacuum magnetic boundary 3 | ! Please see Jackson et.al. (under the review) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Here is the input files for the dynamo benchmark 7 | with pseudo vacuum magnetic boundary. 8 | This example consists of the following files and directories. 9 | 10 | control_sph_shell: control file for gen_sph_grids 11 | control_MHD: control file for simulation 12 | control_snapshot: control file for data analysis 13 | 14 | sph_lm31r48c_4: Directory for spherical harmonics index table 15 | rst_4: Directory for restart files 16 | field: Directory for field data files 17 | 18 | The simulation procedure is the following 19 | 20 | 1: Run index generation program as 21 | [dynamobench_case_1]$ [CALYPSO_DIR]/bin/gen_sph_grids 22 | 23 | 2. Run simulation program 24 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_mhd 25 | 26 | 3. To continue the simulation change rst_ctl in control_MHD from 27 | rst_ctl pseudo_vacuum_benchmark 28 | to 29 | rst_ctl start_from_rst_file 30 | And, start simulation again by 2. 31 | 32 | 4. To check the benchmark solution type 33 | [dynamobench_case_1]$ mpirun -np 4 [CALYPSO_DIR]/bin/sph_dynamobench 34 | 35 | Enjoy!! 36 | 37 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/pseudo_vacuum/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_4/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 2 9 | num_horizontal_domain_ctl 2 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 31 14 | ! 15 | ngrid_meridonal_ctl 48 16 | ngrid_zonal_ctl 96 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 48 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/pseudo_vacuum/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark with pseudo vacuum magnetic boundary 3 | ! Please see Jackson et.al. (under the review) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Field data for visualization are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/pseudo_vacuum/rst_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark with pseudo vacuum magnetic boundary 3 | ! Please see Jackson et.al. (under the review) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/pseudo_vacuum/sections/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark test Case 0 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/dynamo_benchmark/pseudo_vacuum/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using dynamo benchmark with pseudo vacuum magnetic boundary 3 | ! Please see Jackson et.al. (under the review) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Spherical harmonics table data are stored in this directory. 7 | -------------------------------------------------------------------------------- /examples/heat_composition_source/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using heat and compositional source terms 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the input files to use heat and compositional source terms in Calypso. 6 | To simplify the problem, only the thermal and compositional fields are evolved with no velocity. 7 | 8 | This example consists of the following files and directories 9 | 10 | control_sph_shell: control file for gen_sph_grids 11 | control_MHD: control file for simulation 12 | 13 | sph_lm3r64c_1: Directory for spherical harmonics index table 14 | rst_1: Directory for restart files 15 | field: Directory for field data files 16 | 17 | This example only run with 1 MPI process. The simulation procedure is the following 18 | 19 | 1: Run index generation program as 20 | [heat_composition_source]$ [CALYPSO_DIR]/bin/gen_sph_grids 21 | 22 | 2. Make initial field 23 | 2.1 Copy source code "const_sph_initial_spectr.f90" to 24 | [CALYPSO_DIR]/src/programs/data_utilities/INITIAL_FIELD 25 | [sph_initial_field]$ cp const_sph_initial_spectr.f90 [CALYPSO_DIR]/src/programs/data_utilities/INITIAL_FIELD 26 | 2.2 Build initial field generation program 27 | [sph_initial_field]$ cd [CALYPSO_DIR]/work 28 | [work]$ make 29 | 2.3 Move this directory and construct initial field data 30 | [work]$ cd [CALYPSO]/examples/heat_composition_source 31 | [sph_initial_field]$ [CALYPSO_DIR]/bin/sph_initial_field 32 | 3. Run simulation program 33 | [sph_initial_field]$ mpirun -np 1 [CALYPSO_DIR]/bin/sph_mhd 34 | -------------------------------------------------------------------------------- /examples/heat_composition_source/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 1 4 | sph_file_prefix 'sph_lm3r64c_1/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 1 9 | num_horizontal_domain_ctl 1 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 3 14 | ! 15 | ngrid_meridonal_ctl 6 16 | ngrid_zonal_ctl 12 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 64 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/heat_composition_source/rst_1/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using heat and compositional source terms 3 | !----------------------------------------------------------------------- 4 | ! 5 | Restart data files are stored in this directory. 6 | -------------------------------------------------------------------------------- /examples/heat_composition_source/sph_lm3r64c_1/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using heat and compositional source terms 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics table data are stored in this directory. 6 | -------------------------------------------------------------------------------- /examples/heterogineous_temp/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using heterogeneous heat and compositional boundary conditions 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the input files to use heterogeneous heat and compositional boundary conditions in Calypso. 6 | To simplify the problem, only the thermal and compositional fields are evolved with no velocity. 7 | 8 | This example consists of the following files and directories 9 | 10 | control_sph_shell: control file for gen_sph_grids 11 | control_MHD: control file for simulation 12 | 13 | sph_lm4r64c_2: Directory for spherical harmonics index table 14 | rst_2: Directory for restart files 15 | field: Directory for field data files 16 | 17 | This example only run with 2 MPI processes. The simulation procedure is the following 18 | 19 | 1: Run index generation program as 20 | [heterogineous_temp]$ [CALYPSO_DIR]/bin/gen_sph_grids 21 | 22 | 2. Run simulation program 23 | [heterogineous_temp]$ mpirun -np 2 [CALYPSO_DIR]/bin/sph_mhd 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/heterogineous_temp/bc_spectr.btx: -------------------------------------------------------------------------------- 1 | # 2 | # number of boundary conditions 3 | 4 4 | # 5 | # boundary condition data list 6 | # 7 | # Fixed temperature at ICB 8 | temperature 9 | ICB 10 | 3 11 | 0 0 1.000E+00 12 | 1 1 2.000E-01 13 | 2 2 3.000E-01 14 | # 15 | # Fixed heat flux at CMB 16 | heat_flux 17 | CMB 18 | 2 19 | 0 0 -0.9E+0 20 | 1 -1 5.0E-1 21 | # 22 | # Fixed composition flux at ICB 23 | composite_flux 24 | ICB 25 | 2 26 | 0 0 0.000E+00 27 | 2 0 -2.500E-01 28 | # 29 | # Fixed composition at CMB 30 | composition 31 | CMB 32 | 2 33 | 0 0 1.000E+00 34 | 2 -2 5.000E-01 35 | -------------------------------------------------------------------------------- /examples/heterogineous_temp/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | debug_flag_ctl 'ON' 4 | num_subdomain_ctl 2 5 | sph_file_prefix 'sph_lm4r64c_2/in' 6 | boundary_data_file_name 'bc_spectr.btx' 7 | end data_files_def 8 | ! 9 | begin num_domain_ctl 10 | array num_domain_sph_grid 2 11 | num_domain_sph_grid radial 2 end 12 | num_domain_sph_grid meridional 1 end 13 | end array num_domain_sph_grid 14 | ! 15 | array num_domain_legendre 2 16 | num_domain_legendre radial 2 end 17 | num_domain_legendre zonal 1 end 18 | end array num_domain_legendre 19 | ! 20 | array num_domain_spectr 1 21 | num_domain_spectr modes 2 end 22 | end array num_domain_spectr 23 | end num_domain_ctl 24 | ! 25 | begin num_grid_sph 26 | truncation_level_ctl 4 27 | ! 28 | ngrid_meridonal_ctl 12 29 | ngrid_zonal_ctl 24 30 | ! 31 | radial_grid_type_ctl Chebyshev 32 | num_fluid_grid_ctl 64 33 | fluid_core_size_ctl 1.0 34 | ICB_to_CMB_ratio_ctl 0.35 35 | end num_grid_sph 36 | end spherical_shell_ctl 37 | -------------------------------------------------------------------------------- /examples/heterogineous_temp/rst_2/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using heterogeneous heat and compositional boundary conditions 3 | !----------------------------------------------------------------------- 4 | ! 5 | Restart data files are stored in this directory. 6 | -------------------------------------------------------------------------------- /examples/heterogineous_temp/sph_lm4r64c_2/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example using heterogeneous heat and compositional boundary conditions 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics table data are stored in this directory. 6 | -------------------------------------------------------------------------------- /examples/spherical_shell/Chebyshev_points/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the files to generate spherical harmonics index data file 6 | for simulations with 4 MPI processes. 7 | In this example, Chebyshev points are used for the radial spacing. 8 | This example consists of the following files and directories 9 | 10 | control_sph_shell: control file for data transform 11 | sph_lm31r48c_4: Directory for spherical harmonics index table 12 | 13 | Run index generation program in both directory for index tables 14 | [Chebyshev_points]$ [CALYPSO_DIR]/bin/gen_sph_grids 15 | -------------------------------------------------------------------------------- /examples/spherical_shell/Chebyshev_points/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_4/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | array num_domain_sph_grid 2 9 | num_domain_sph_grid radial 2 end 10 | num_domain_sph_grid meridional 2 end 11 | end array num_domain_sph_grid 12 | ! 13 | array num_domain_legendre 2 14 | num_domain_legendre radial 2 end 15 | num_domain_legendre zonal 2 end 16 | end array num_domain_legendre 17 | ! 18 | array num_domain_spectr 1 19 | num_domain_spectr modes 4 end 20 | end array num_domain_spectr 21 | end num_domain_ctl 22 | ! 23 | begin num_grid_sph 24 | truncation_level_ctl 31 25 | ! 26 | ngrid_meridonal_ctl 48 27 | ngrid_zonal_ctl 96 28 | ! 29 | radial_grid_type_ctl Chebyshev 30 | num_fluid_grid_ctl 48 31 | fluid_core_size_ctl 1.0 32 | ICB_to_CMB_ratio_ctl 0.35 33 | end num_grid_sph 34 | end spherical_shell_ctl 35 | -------------------------------------------------------------------------------- /examples/spherical_shell/Chebyshev_points/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics index data are stored in this directory. 6 | -------------------------------------------------------------------------------- /examples/spherical_shell/equidistance/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the files to generate spherical harmonics index data file 6 | for simulations with 1 MPI process. 7 | In this example, equidistance grids are used for the radial spacing. 8 | This example consists of the following files and directories 9 | 10 | control_sph_shell: control file for data transform 11 | sph_lm24r24e_1: Directory for spherical harmonics index table 12 | 13 | Run index generation program in both directory for index tables 14 | [equidistance]$ [CALYPSO_DIR]/bin/gen_sph_grids 15 | -------------------------------------------------------------------------------- /examples/spherical_shell/equidistance/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 1 4 | sph_file_prefix 'sph_lm24r24e_1/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 1 9 | num_horizontal_domain_ctl 1 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 24 14 | ! 15 | ngrid_meridonal_ctl 48 16 | ngrid_zonal_ctl 96 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 48 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /examples/spherical_shell/equidistance/sph_lm24r24e_1/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics index data are stored in this directory. 6 | -------------------------------------------------------------------------------- /examples/spherical_shell/explicitly_defined/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the files to generate spherical harmonics index data file 6 | for simulations with 2 MPI processes. 7 | In this example, radial grid points are defined explicitly in the control file. 8 | This example consists of the following files and directories 9 | 10 | control_sph_shell: control file for data transform 11 | sph_lm31r48c_2: Directory for spherical harmonics index table 12 | 13 | Run index generation program in both directory for index tables 14 | [sph_lm31r48c_2]$ [CALYPSO_DIR]/bin/gen_sph_grids 15 | -------------------------------------------------------------------------------- /examples/spherical_shell/explicitly_defined/sph_lm31r48c_2/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics index data are stored in this directory. 6 | -------------------------------------------------------------------------------- /examples/spherical_shell/with_inner_core/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Here is the files to generate spherical harmonics index data file 6 | for simulations with 6 MPI processes. 7 | In this example, Chebyshev points are used for the radial spacing 8 | including inner core and external of the core. 9 | This example consists of the following files and directories 10 | 11 | control_sph_shell: control file for data transform 12 | sph_lm31r48c_4_ic: Directory for spherical harmonics index table 13 | 14 | Run index generation program in both directory for index tables 15 | [with_inner_core]$ [CALYPSO_DIR]/bin/gen_sph_grids 16 | -------------------------------------------------------------------------------- /examples/spherical_shell/with_inner_core/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 6 4 | sph_file_prefix 'sph_lm31r48c_6_ic/in' 5 | ! 6 | memory_conservation_ctl 'YES' 7 | end data_files_def 8 | ! 9 | begin num_domain_ctl 10 | num_radial_domain_ctl 2 11 | num_horizontal_domain_ctl 2 12 | end num_domain_ctl 13 | ! 14 | begin num_grid_sph 15 | truncation_level_ctl 31 16 | ! 17 | ngrid_meridonal_ctl 48 18 | ngrid_zonal_ctl 96 19 | ! 20 | radial_grid_type_ctl Chebyshev 21 | num_fluid_grid_ctl 48 22 | fluid_core_size_ctl 1.0 23 | ICB_to_CMB_ratio_ctl 0.35 24 | Min_radius_ctl 0.0 25 | Max_radius_ctl 2.0 26 | end num_grid_sph 27 | end spherical_shell_ctl 28 | -------------------------------------------------------------------------------- /examples/spherical_shell/with_inner_core/sph_lm31r48c_6_ic/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! Example to generate spherical harmonics index data files 3 | !----------------------------------------------------------------------- 4 | ! 5 | Spherical harmonics index data are stored in this directory. 6 | -------------------------------------------------------------------------------- /src/CALYPSO_src.dox: -------------------------------------------------------------------------------- 1 | /** 2 | @image html fieldline.pdf 3 | @image latex fieldline.pdf width=10cm 4 | @mainpage 5 | */ 6 | 7 | /** 8 | @dir src 9 | Top directory for source files 10 | */ 11 | /** 12 | @dir Fortran_libraries 13 | Source directory for libraries 14 | */ 15 | /** 16 | @dir programs 17 | Source directory for programs 18 | */ 19 | 20 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Recurse into the subdirectories 2 | ADD_SUBDIRECTORY (External_libs) 3 | ADD_SUBDIRECTORY (Fortran_libraries) 4 | ADD_SUBDIRECTORY (programs) 5 | 6 | -------------------------------------------------------------------------------- /src/External_libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Make the FFTPACK5.1D library 2 | ADD_LIBRARY(fftpack.5d FFTPACK5.1D/fftpack5.1d.f90) 3 | 4 | -------------------------------------------------------------------------------- /src/External_libs/FFTPACK5.1D/FFTPACK5.1D - Fast Fourier Transforms, Double Precision.webloc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/src/External_libs/FFTPACK5.1D/FFTPACK5.1D - Fast Fourier Transforms, Double Precision.webloc -------------------------------------------------------------------------------- /src/External_libs/FFTPACK5.1D/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | FFTPACK_DIR = $$(EXT_DIR)/FFTPACK5.1D 6 | 7 | LIB_FFTPACK = -lfftpack.5d 8 | LIB_FFTPACK_FILE = libfftpack.5d.a 9 | 10 | FFTPACKFLAG = $(subst '-warn all','',$(F90FLAGS)) 11 | 12 | MOD_FFTPACK = \ 13 | fftpack5.1d.o 14 | 15 | # 16 | # ------------------------------------------------------------------------- 17 | # 18 | 19 | dir_list: 20 | @echo FFTPACKFLAG = '$$(subst ''-warn all'','' '',$$(F90FLAGS))' >> $(MAKENAME) 21 | @echo '#' >> $(MAKENAME) 22 | @echo 'FFTPACK_DIR = $(FFTPACK_DIR)' >> $(MAKENAME) 23 | 24 | lib_name: 25 | @echo 'LIB_FFTPACK = $(LIB_FFTPACK)' >> $(MAKENAME) 26 | @echo 'LIB_FFTPACK_FILE = $(LIB_FFTPACK_FILE)' >> $(MAKENAME) 27 | @echo >> $(MAKENAME) 28 | 29 | lib_tasks: libtarget lib_archve 30 | @echo ' ''$$(RANLIB) $$@' >> $(MAKENAME) 31 | 32 | libtarget: 33 | @echo '' >> $(MAKENAME) 34 | @echo '$$(LIB_FFTPACK_FILE): $$(MOD_FFTPACK)'>> $(MAKENAME) 35 | 36 | lib_archve: 37 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_FFTPACK)' >> $(MAKENAME) 38 | 39 | mod_list: 40 | @echo MOD_FFTPACK= \\ >> $(MAKENAME) 41 | @echo $(MOD_FFTPACK) >> $(MAKENAME) 42 | @echo '#' >> $(MAKENAME) 43 | 44 | 45 | module: 46 | @echo 'fftpack5.1d.o: $$(FFTPACK_DIR)/fftpack5.1d.f90' >> $(MAKENAME) 47 | @echo ' ' '$$(F90) -c $$(FFTPACKFLAG) $$<' >> $(MAKENAME) 48 | 49 | clean: 50 | rm -f *.o *.mod *~ *.par *.diag *.a 51 | -------------------------------------------------------------------------------- /src/External_libs/FFTPACK5.1D/PROBLEM: -------------------------------------------------------------------------------- 1 | Problems 2 | 1. FFTPACK5 fails to compile with Intel fortran using '-warn all' option. 3 | This error due to transfer values between complex and real during subroutine call. Currently, '-warn all' option is excluded by Makefile. 4 | -------------------------------------------------------------------------------- /src/External_libs/FFTPACK5.1D/fftpack5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geodynamics/calypso/2ac11d2af13cc912b8863844e5ba84bbb88b4038/src/External_libs/FFTPACK5.1D/fftpack5.pdf -------------------------------------------------------------------------------- /src/External_libs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | 4 | SUBDIRS = \ 5 | FFTPACK5.1D 6 | 7 | # 8 | # ------------------------------------------------------------------------- 9 | # 10 | 11 | dir_list: 12 | @echo 'EXT_DIR = $$(MHDDIR)/External_libs' >> $(MAKENAME) 13 | @echo '#' >> $(MAKENAME) 14 | @for dir in $(SUBDIRS) ; do \ 15 | ( \ 16 | echo 'generate diectory list for ' $$dir ; \ 17 | cd $${dir}; \ 18 | $(GMAKE) \ 19 | GMAKE='$(GMAKE)' \ 20 | MAKEDIR='$(MAKEDIR)' \ 21 | MAKENAME='$(MAKENAME)' \ 22 | dir_list; \ 23 | ) \ 24 | done 25 | @echo '#' >> $(MAKENAME) 26 | 27 | lib_name: 28 | @for dir in $(SUBDIRS) ; do \ 29 | ( \ 30 | echo 'generate library list for ' $$dir ; \ 31 | cd $${dir}; \ 32 | $(GMAKE) \ 33 | GMAKE='$(GMAKE)' \ 34 | MAKEDIR='$(MAKEDIR)' \ 35 | MAKENAME='$(MAKENAME)' \ 36 | lib_name; \ 37 | ) \ 38 | done 39 | 40 | lib_tasks: 41 | @for dir in $(SUBDIRS) ; do \ 42 | ( cd $${dir}; \ 43 | echo 'generate library commands for ' $$dir ; \ 44 | $(GMAKE) \ 45 | GMAKE='$(GMAKE)' \ 46 | OPENGL_LIBS='$(OPENGL_LIBS)' \ 47 | MAKEDIR='$(MAKEDIR)' \ 48 | MAKENAME='$(MAKENAME)' \ 49 | lib_tasks; \ 50 | ) \ 51 | done 52 | 53 | 54 | mod_list: 55 | @for dir in $(SUBDIRS); do \ 56 | ( cd $${dir}; \ 57 | $(GMAKE) \ 58 | GMAKE='$(GMAKE)' \ 59 | MAKENAME='$(MAKENAME)' \ 60 | mod_list \ 61 | ) \ 62 | done 63 | 64 | 65 | module: 66 | @for dir in $(SUBDIRS) ; do \ 67 | ( \ 68 | echo 'generate compile commands for ' $$dir ; \ 69 | cd $${dir}; \ 70 | $(GMAKE) \ 71 | GMAKE='$(GMAKE)' \ 72 | MAKEDIR='$(MAKEDIR)' \ 73 | MAKENAME='$(MAKENAME)' \ 74 | MAKE_MOD_DEP='$(MAKE_MOD_DEP)' \ 75 | module; \ 76 | ) \ 77 | done 78 | 79 | includes: 80 | @for dir in $(SUBDIRS) ; do \ 81 | ( \ 82 | echo 'copy C include files for ' $$dir ; \ 83 | cd $${dir}; \ 84 | $(GMAKE) \ 85 | GMAKE='$(GMAKE)' \ 86 | MAKENAME='$(MAKENAME)' \ 87 | includes; \ 88 | ) \ 89 | done 90 | 91 | 92 | clean: 93 | @for dir in $(SUBDIRS); do \ 94 | ( cd $${dir}; \ 95 | $(GMAKE) \ 96 | GMAKE='$(GMAKE)' \ 97 | clean \ 98 | ) \ 99 | done 100 | 101 | rm -f *.o *.mod *~ *.par *.diag *.a 102 | -------------------------------------------------------------------------------- /src/Fortran_libraries/Fortran_libraries.dox: -------------------------------------------------------------------------------- 1 | /** 2 | Directory for Fortran90 sources 3 | @dir 4 | */ 5 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/IO/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | MHD_IO_DIR = $$(MHD_SRCDIR)/IO 6 | SRC_MHD_IO = $(shell ls *.f90) 7 | MOD_MHD_IO = $(addsuffix .o,$(basename $(SRC_MHD_IO)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'MHD_IO_DIR = $(MHD_IO_DIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' ''$$(AR)' '$$(ARFLUGS)' rcsv '$$@' '$$(MOD_MHD_IO)' \ 18 | >> $(MAKENAME) 19 | 20 | mod_list: 21 | @echo MOD_MHD_IO= \\ >> $(MAKENAME) 22 | @echo $(MOD_MHD_IO) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(MHD_IO_DIR)' $(SRC_MHD_IO) 28 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | MHD_SRCDIR = $$(F_SRCDIR)/MHD_src 6 | 7 | LIB_MHD= -lcalypso_MHD 8 | LIB_MHD_FILE= libcalypso_MHD.a 9 | 10 | SUBDIRS = \ 11 | IO \ 12 | sph_MHD \ 13 | field_data 14 | 15 | # 16 | # ------------------------------------------------------------------------- 17 | # 18 | 19 | dir_list: 20 | @echo 'MHD_SRCDIR = $(MHD_SRCDIR)' >> $(MAKENAME) 21 | @echo '#' >> $(MAKENAME) 22 | @for dir in $(SUBDIRS); do \ 23 | ( cd $${dir}; \ 24 | $(GMAKE) \ 25 | GMAKE='$(GMAKE)' \ 26 | MAKENAME='$(MAKENAME)' \ 27 | dir_list \ 28 | ) \ 29 | done 30 | @echo '#' >> $(MAKENAME) 31 | 32 | lib_name: 33 | @echo LIB_MHD = $(LIB_MHD) >> $(MAKENAME) 34 | @echo LIB_MHD_FILE = $(LIB_MHD_FILE) >> $(MAKENAME) 35 | @echo '#' >> $(MAKENAME) 36 | 37 | lib_tasks: libtarget lib_archve 38 | @echo ' ''$$(RANLIB)' '$$@' >> $(MAKENAME) 39 | 40 | libtarget: 41 | @echo '' >> $(MAKENAME) 42 | @echo '$$(LIB_MHD_FILE): $$(MOD_MHD)' >> $(MAKENAME) 43 | 44 | lib_archve: 45 | @for dir in $(SUBDIRS); do \ 46 | ( cd $${dir}; \ 47 | $(GMAKE) \ 48 | GMAKE='$(GMAKE)' \ 49 | MAKENAME='$(MAKENAME)' \ 50 | lib_archve \ 51 | ) \ 52 | done 53 | 54 | mod_list: 55 | @echo MOD_MHD= \\ >> $(MAKENAME) 56 | @echo '$$(MOD_MHD_IO)' \\ >> $(MAKENAME) 57 | @echo '$$(MOD_SPH_MHD)' \\ >> $(MAKENAME) 58 | @echo '$$(MOD_SPH_SNAPSHOT)' \\ >> $(MAKENAME) 59 | @echo >> $(MAKENAME) 60 | 61 | @for dir in $(SUBDIRS); do \ 62 | ( cd $${dir}; \ 63 | $(GMAKE) \ 64 | GMAKE='$(GMAKE)' \ 65 | MAKENAME='$(MAKENAME)' \ 66 | mod_list; \ 67 | ) \ 68 | done 69 | 70 | 71 | module: 72 | @for dir in $(SUBDIRS); do \ 73 | ( cd $${dir}; \ 74 | $(GMAKE) \ 75 | GMAKE='$(GMAKE)' \ 76 | MAKE_MOD_DEP='$(MAKE_MOD_DEP)' \ 77 | MAKENAME='$(MAKENAME)' \ 78 | module; \ 79 | ) \ 80 | done 81 | 82 | 83 | clean: 84 | @for dir in $(SUBDIRS); do \ 85 | ( cd $${dir}; \ 86 | $(GMAKE) \ 87 | GMAKE='$(GMAKE)' \ 88 | clean \ 89 | ) \ 90 | done 91 | 92 | rm -f *.o *.mod *~ *.par *.diag *.a 93 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/field_data/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | MHD_SNAPSHOT_DIR = $$(MHD_SRCDIR)/field_data 6 | SRC_SPH_SNAPSHOT = $(shell ls *.f90) 7 | MOD_SPH_SNAPSHOT = $(addsuffix .o,$(basename $(SRC_SPH_SNAPSHOT)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'MHD_SNAPSHOT_DIR = $(MHD_SNAPSHOT_DIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' ''$$(AR)' '$$(ARFLUGS)' rcsv '$$@' '$$(MOD_SPH_SNAPSHOT)' \ 18 | >> $(MAKENAME) 19 | 20 | mod_list: 21 | @echo MOD_SPH_SNAPSHOT= \\ >> $(MAKENAME) 22 | @echo $(MOD_SPH_SNAPSHOT) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(MHD_SNAPSHOT_DIR)' $(SRC_SPH_SNAPSHOT) 28 | 29 | 30 | clean: 31 | rm -f *.o *.mod *~ *.par *.diag *.a 32 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/field_data/lead_pole_data_4_sph_mhd.f90: -------------------------------------------------------------------------------- 1 | !> @file lead_pole_data_4_sph_mhd.f90 2 | !! module lead_pole_data_4_sph_mhd 3 | !! 4 | !! @author H. Matsui 5 | !! @date Programmed in Oct., 2012 6 | ! 7 | !> @brief Spherical transform at poles 8 | !! 9 | !!@verbatim 10 | !! subroutine lead_pole_fields_4_sph_mhd 11 | !!@endverbatim 12 | ! 13 | module lead_pole_data_4_sph_mhd 14 | ! 15 | use m_precision 16 | use m_constants 17 | ! 18 | implicit none 19 | ! 20 | !----------------------------------------------------------------------- 21 | ! 22 | contains 23 | ! 24 | !----------------------------------------------------------------------- 25 | ! 26 | subroutine lead_pole_fields_4_sph_mhd 27 | ! 28 | use m_machine_parameter 29 | use m_spheric_constants 30 | use m_spheric_parameter 31 | use pole_energy_flux_sph 32 | use copy_MHD_4_pole_trans 33 | ! 34 | ! 35 | if(iflag_shell_mode .eq. iflag_MESH_same) return 36 | ! 37 | if (iflag_debug.eq.1) write(*,*) 'copy_snap_vec_from_pole_trans' 38 | call copy_snap_vec_from_pole_trans 39 | ! 40 | if (iflag_debug.eq.1) write(*,*) 'pole_nonlinear_sph_MHD' 41 | call pole_nonlinear_sph_MHD 42 | if (iflag_debug.eq.1) write(*,*) 'pole_energy_flux_rtp' 43 | call pole_energy_flux_rtp 44 | ! 45 | end subroutine lead_pole_fields_4_sph_mhd 46 | ! 47 | !----------------------------------------------------------------------- 48 | ! 49 | end module lead_pole_data_4_sph_mhd 50 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/field_data/output_ucd_file_control.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module output_ucd_file_control 3 | ! 4 | ! Programmed by H.Matsui on July 2000 (ver 1.1) 5 | ! Modified by H. Matsui on Aug, 2007 6 | ! 7 | ! subroutine s_output_ucd_file_control 8 | ! subroutine output_grd_file_4_snapshot 9 | ! 10 | module output_ucd_file_control 11 | ! 12 | use m_precision 13 | use m_constants 14 | ! 15 | implicit none 16 | ! 17 | ! ---------------------------------------------------------------------- 18 | ! 19 | contains 20 | ! 21 | ! ---------------------------------------------------------------------- 22 | ! 23 | subroutine s_output_ucd_file_control 24 | ! 25 | use calypso_mpi 26 | use m_t_step_parameter 27 | use m_ucd_data 28 | use parallel_ucd_IO_select 29 | use copy_time_steps_4_restart 30 | ! use range_data_IO 31 | ! 32 | integer(kind = kint) :: istep_ucd 33 | ! 34 | ! 35 | if(i_step_output_ucd .eq. 0) return 36 | if(mod(istep_max_dt,i_step_output_ucd) .ne. 0) return 37 | ! 38 | istep_ucd = istep_max_dt / i_step_output_ucd 39 | ! 40 | call copy_time_steps_to_restart 41 | call sel_write_parallel_ucd_file(istep_ucd, fem_ucd, merged_ucd) 42 | ! call output_range_data(istep_ucd, time) 43 | ! 44 | end subroutine s_output_ucd_file_control 45 | ! 46 | ! ---------------------------------------------------------------------- 47 | ! 48 | subroutine output_grd_file_4_snapshot 49 | ! 50 | use m_geometry_data 51 | use m_nod_comm_table 52 | use m_t_step_parameter 53 | use output_parallel_ucd_file 54 | ! 55 | ! 56 | if(i_step_output_ucd .eq. 0) return 57 | call output_grd_file(node1, ele1, nod_comm) 58 | ! 59 | end subroutine output_grd_file_4_snapshot 60 | ! 61 | !----------------------------------------------------------------------- 62 | ! 63 | end module output_ucd_file_control 64 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/sph_MHD/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | MHD_SPH_DIR = $$(MHD_SRCDIR)/sph_MHD 6 | SRC_SPH_MHD = $(shell ls *.f90 *.F90) 7 | MOD_SPH_MHD = $(addsuffix .o,$(basename $(SRC_SPH_MHD)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'MHD_SPH_DIR = $(MHD_SPH_DIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_SPH_MHD)' \ 18 | >> $(MAKENAME) 19 | 20 | mod_list: 21 | @echo MOD_SPH_MHD= \\ >> $(MAKENAME) 22 | @echo $(MOD_SPH_MHD) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(MHD_SPH_DIR)' $(SRC_SPH_MHD) 28 | 29 | clean: 30 | rm -f *.o *.mod *~ *.par *.diag *.a 31 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/sph_MHD/cal_energy_flux_rj.f90: -------------------------------------------------------------------------------- 1 | !> @file cal_energy_flux_rj.f90 2 | !! module cal_energy_flux_rj 3 | !! 4 | !! @author H. Matsui 5 | !! @date Programmed in Oct., 2009 6 | !! @n Modified in Apr., 2013 7 | ! 8 | !> @brief Evaluate energy fluxes for MHD dynamo in physical space 9 | !! 10 | !!@verbatim 11 | !! subroutine s_cal_energy_flux_rj 12 | !!@endverbatim 13 | ! 14 | module cal_energy_flux_rj 15 | ! 16 | use m_precision 17 | use m_constants 18 | ! 19 | implicit none 20 | ! 21 | ! ----------------------------------------------------------------------- 22 | ! 23 | contains 24 | ! 25 | ! ----------------------------------------------------------------------- 26 | ! 27 | subroutine s_cal_energy_flux_rj 28 | ! 29 | use m_sph_phys_address 30 | use const_sph_radial_grad 31 | ! 32 | ! 33 | if(ipol%i_rot_Coriolis .gt. 0) then 34 | call const_grad_poloidal_moment(ipol%i_rot_Coriolis) 35 | end if 36 | ! 37 | end subroutine s_cal_energy_flux_rj 38 | ! 39 | !----------------------------------------------------------------------- 40 | ! 41 | end module cal_energy_flux_rj 42 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/sph_MHD/check_field_dependency.f90: -------------------------------------------------------------------------------- 1 | !>@file check_field_dependency.f90 2 | !!@brief module check_field_dependency 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in Sep., 2007 6 | ! 7 | !>@brief Subroutine to check dependecy of field 8 | !! 9 | !!@verbatim 10 | !! subroutine check_dependence_phys(num_nod_phys, num_check, & 11 | !! & target_name, phys_nod_name, phys_check_name) 12 | !!@endverbatim 13 | !! 14 | !!@n @param num_nod_phys Number of fields 15 | !!@n @param num_check Number of fields to be required 16 | !!@n @param target_name Field name to be checked dependency 17 | !!@n @param phys_nod_name(num_nod_phys) 18 | !! Name of fields 19 | !!@n @param phys_check_name(num_check) List of field name to be required 20 | ! 21 | module check_field_dependency 22 | ! 23 | use m_precision 24 | use m_error_IDs 25 | ! 26 | implicit none 27 | ! 28 | ! ----------------------------------------------------------------------- 29 | ! 30 | contains 31 | ! 32 | ! ----------------------------------------------------------------------- 33 | ! 34 | subroutine check_dependence_phys(num_nod_phys, num_check, & 35 | & target_name, phys_nod_name, phys_check_name) 36 | ! 37 | use calypso_mpi 38 | ! 39 | integer(kind=kint) :: num_nod_phys, num_check 40 | character(len=kchara) :: target_name 41 | character(len=kchara) :: phys_nod_name(num_nod_phys) 42 | character(len=kchara) :: phys_check_name(num_check) 43 | ! 44 | integer(kind=kint) :: iflag, j, jj 45 | ! 46 | ! 47 | iflag = 0 48 | ! 49 | do j = 1, num_nod_phys 50 | do jj = 1, num_check 51 | if ( phys_nod_name(j) .eq. phys_check_name(jj) ) then 52 | iflag = iflag + 1 53 | end if 54 | end do 55 | end do 56 | ! 57 | if (iflag .lt. num_check) then 58 | if (my_rank.eq.0) then 59 | write(*,*) 'Following parameters are required for ', & 60 | & trim(target_name) 61 | do j = 1, num_check 62 | write(*,*) trim(phys_check_name(j)) 63 | end do 64 | end if 65 | call calypso_MPI_abort(ierr_fld,'Stop program.') 66 | end if 67 | ! 68 | end subroutine check_dependence_phys 69 | ! 70 | ! ----------------------------------------------------------------------- 71 | ! 72 | end module check_field_dependency 73 | -------------------------------------------------------------------------------- /src/Fortran_libraries/MHD_src/sph_MHD/const_data_4_dynamobench.f90: -------------------------------------------------------------------------------- 1 | !>@file const_data_4_dynamobench.f90 2 | !!@brief module const_data_4_dynamobench 3 | !! 4 | !!@author H. Matsui 5 | !!@date programmed by H.Matsui in June, 2012 6 | ! 7 | !>@brief Evaluate dynamo benchmark results 8 | !! 9 | !!@verbatim 10 | !! subroutine s_const_data_4_dynamobench 11 | !! subroutine s_const_data_on_circle 12 | !!@endverbatim 13 | ! 14 | module const_data_4_dynamobench 15 | ! 16 | use m_precision 17 | use m_constants 18 | use m_machine_parameter 19 | ! 20 | implicit none 21 | ! 22 | ! ---------------------------------------------------------------------- 23 | ! 24 | contains 25 | ! 26 | ! ---------------------------------------------------------------------- 27 | ! 28 | subroutine s_const_data_4_dynamobench 29 | ! 30 | use m_boundary_params_sph_MHD 31 | use calypso_mpi 32 | use cal_rms_fields_by_sph 33 | use global_field_4_dynamobench 34 | use m_field_at_mid_equator 35 | ! 36 | ! 37 | ! 38 | if(iflag_debug.gt.0) write(*,*) 'mid_eq_transfer_dynamobench' 39 | call mid_eq_transfer_dynamobench 40 | ! 41 | call cal_rms_sph_outer_core 42 | if(my_rank .eq. 0) call copy_energy_4_dynamobench 43 | ! 44 | if(sph_bc_U%iflag_icb .eq. iflag_rotatable_ic) then 45 | call pick_inner_core_rotation 46 | end if 47 | ! 48 | if(sph_bc_B%iflag_icb .eq. iflag_sph_fill_center) then 49 | call cal_rms_sph_inner_core 50 | if(my_rank .eq. 0) call copy_icore_energy_4_dbench 51 | end if 52 | ! 53 | if(sph_bc_B%iflag_icb .eq. iflag_sph_fill_center & 54 | & .and. sph_bc_U%iflag_icb .eq. iflag_rotatable_ic) then 55 | call pick_mag_torque_inner_core 56 | end if 57 | ! 58 | end subroutine s_const_data_4_dynamobench 59 | ! 60 | ! ---------------------------------------------------------------------- 61 | ! 62 | end module const_data_4_dynamobench 63 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Get sources from each subdirectory 2 | FILE(GLOB COMM_SRC_FILES COMM_src/*.[fF]90) 3 | FILE(GLOB SPH_SHELL_SRC_FILES SPH_SHELL_src/*.[fF]90) 4 | 5 | SET(CALYPSO_PARALLEL_SRC_FILES ${COMM_SRC_FILES} ${SPH_SHELL_SRC_FILES}) 6 | 7 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/COMM_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | COMMDIR = $$(PARA_SRCDIR)/COMM_src 6 | SRC_COMM = $(shell ls *.f90 *.F90) 7 | MOD_COMM = $(addsuffix .o,$(basename $(SRC_COMM)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'COMMDIR = $(COMMDIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_COMM)' >> $(MAKENAME) 18 | 19 | 20 | mod_list: 21 | @echo MOD_COMM= \\ >> $(MAKENAME) 22 | @echo $(MOD_COMM) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(COMMDIR)' $(SRC_COMM) 28 | 29 | clean: 30 | rm -f *.o *.mod *~ *.par *.diag *.a 31 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/COMM_src/set_ctl_parallel_platform.f90: -------------------------------------------------------------------------------- 1 | !set_ctl_parallel_platform.f90 2 | ! module set_ctl_parallel_platform 3 | ! 4 | ! programmed by H.Matsui 5 | ! modified by H.Matsui on Oct., 2008 6 | ! modified by H.Matsui on Nov., 2009 7 | ! 8 | ! subroutine check_control_num_domains 9 | ! 10 | module set_ctl_parallel_platform 11 | ! 12 | use m_precision 13 | use m_error_IDs 14 | ! 15 | implicit none 16 | ! 17 | ! ----------------------------------------------------------------------- 18 | ! 19 | contains 20 | ! 21 | ! ----------------------------------------------------------------------- 22 | ! 23 | subroutine check_control_num_domains 24 | ! 25 | use m_constants 26 | use m_machine_parameter 27 | use m_ctl_data_4_platforms 28 | ! 29 | use calypso_mpi 30 | ! 31 | ! 32 | if (ndomain_ctl%iflag .gt. 0) then 33 | if( nprocs .ne. ndomain_ctl%intvalue) then 34 | write(e_message,'(a)') & 35 | & 'Number of processes should be num. of mesh' 36 | call calypso_MPI_abort(ierr_P_MPI, e_message) 37 | end if 38 | end if 39 | ! 40 | if(my_rank .eq. 0) iflag_debug = i_debug 41 | ! 42 | end subroutine check_control_num_domains 43 | ! 44 | ! ---------------------------------------------------------------------- 45 | ! 46 | end module set_ctl_parallel_platform 47 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/CONST_SPH_GRID/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SPH_GRID_SRCDIR = $$(PARA_SRCDIR)/CONST_SPH_GRID 6 | SRC_SPH_GRID = $(shell ls *.f90) 7 | MOD_SPH_GRID = $(addsuffix .o,$(basename $(SRC_SPH_GRID)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | .f90.o:; $(F90) -c $(F90FLAGS) $< 14 | 15 | dir_list: 16 | @echo 'SPH_GRID_SRCDIR = $(SPH_GRID_SRCDIR)' >> $(MAKENAME) 17 | 18 | lib_name: 19 | 20 | lib_tasks: libtarget lib_archve 21 | 22 | libtarget: 23 | 24 | lib_archve: 25 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_SPH_GRID)' \ 26 | >> $(MAKENAME) 27 | 28 | 29 | mod_list: 30 | @echo MOD_SPH_GRID= \\ >> $(MAKENAME) 31 | @echo $(MOD_SPH_GRID) >> $(MAKENAME) 32 | @echo '#' >> $(MAKENAME) 33 | 34 | 35 | module: 36 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(SPH_GRID_SRCDIR)' $(SRC_SPH_GRID) 37 | 38 | clean: 39 | rm -f *.o *.mod $(EXE) $(LIB) *~ 40 | 41 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/CONST_SPH_GRID/m_read_ctl_gen_sph_shell.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_read_ctl_gen_sph_shell 3 | ! 4 | ! Written by H. Matsui on July, 2007 5 | ! 6 | ! subroutine read_control_4_gen_shell_grids 7 | ! 8 | module m_read_ctl_gen_sph_shell 9 | ! 10 | use m_precision 11 | ! 12 | use m_machine_parameter 13 | ! 14 | implicit none 15 | ! 16 | integer (kind = kint) :: control_file_code = 13 17 | character (len = kchara), parameter & 18 | & :: control_file_name = 'control_sph_shell' 19 | ! 20 | character (len = kchara) :: tmp_character 21 | 22 | ! 23 | ! Top level 24 | ! 25 | character(len=kchara), parameter & 26 | & :: hd_sph_shell = 'spherical_shell_ctl' 27 | integer (kind=kint) :: i_sph_shell = 0 28 | ! 29 | private :: control_file_code, control_file_name 30 | private :: hd_sph_shell, i_sph_shell 31 | private :: read_control_data_4_shell 32 | ! 33 | ! -------------------------------------------------------------------- 34 | ! 35 | contains 36 | ! 37 | ! -------------------------------------------------------------------- 38 | ! 39 | subroutine read_control_4_gen_shell_grids 40 | ! 41 | use m_read_control_elements 42 | use skip_comment_f 43 | ! 44 | ! 45 | ctl_file_code = control_file_code 46 | ! 47 | open (ctl_file_code, file = control_file_name) 48 | ! 49 | call load_ctl_label_and_line 50 | call read_control_data_4_shell 51 | ! 52 | close(ctl_file_code) 53 | ! 54 | end subroutine read_control_4_gen_shell_grids 55 | ! 56 | ! ----------------------------------------------------------------------- 57 | ! 58 | subroutine read_control_data_4_shell 59 | ! 60 | use m_read_control_elements 61 | use m_ctl_data_4_platforms 62 | use m_ctl_data_4_sphere_model 63 | use m_ctl_data_4_divide_sphere 64 | use skip_comment_f 65 | ! 66 | ! 67 | if(right_begin_flag(hd_sph_shell) .eq. 0) return 68 | if(i_sph_shell .gt. 0) return 69 | do 70 | call load_ctl_label_and_line 71 | ! 72 | call find_control_end_flag(hd_sph_shell, i_sph_shell) 73 | if(i_sph_shell .gt. 0) exit 74 | ! 75 | ! 76 | call read_ctl_data_4_platform 77 | call read_ctl_4_shell_define 78 | ! 79 | call read_ctl_ndomain_4_shell 80 | end do 81 | ! 82 | end subroutine read_control_data_4_shell 83 | ! 84 | ! -------------------------------------------------------------------- 85 | ! 86 | end module m_read_ctl_gen_sph_shell 87 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/CONST_SPH_GRID/set_controls_4_sph_shell.f90: -------------------------------------------------------------------------------- 1 | !>@file set_controls_4_sph_shell.f90 2 | !!@brief module set_controls_4_sph_shell 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in July, 2007 6 | ! 7 | !>@brief Constants for spectr data 8 | !! 9 | !!@verbatim 10 | !! subroutine set_FEM_mesh_mode_4_SPH(iflag_shell_mode) 11 | !!@endverbatim 12 | ! 13 | module set_controls_4_sph_shell 14 | ! 15 | use m_precision 16 | use m_machine_parameter 17 | ! 18 | ! ----------------------------------------------------------------------- 19 | ! 20 | contains 21 | ! 22 | ! ----------------------------------------------------------------------- 23 | ! 24 | subroutine set_FEM_mesh_mode_4_SPH(iflag_shell_mode) 25 | ! 26 | use m_spheric_constants 27 | use m_ctl_data_4_sphere_model 28 | use skip_comment_f 29 | ! 30 | integer(kind = kint), intent(inout) :: iflag_shell_mode 31 | ! 32 | ! 33 | if(sph_grid_type_ctl%iflag .gt. 0) then 34 | if(cmp_no_case(sph_grid_type_ctl%charavalue, label_MESH_same)) & 35 | & iflag_shell_mode = iflag_MESH_same 36 | if(cmp_no_case(sph_grid_type_ctl%charavalue, label_MESH_pole)) & 37 | & iflag_shell_mode = iflag_MESH_w_pole 38 | if(cmp_no_case(sph_grid_type_ctl%charavalue, label_MESH_ctr)) & 39 | & iflag_shell_mode = iflag_MESH_w_center 40 | if(cmp_no_case(sph_grid_type_ctl%charavalue, label_no_FEMMESH)) & 41 | & iflag_shell_mode = iflag_no_FEMMESH 42 | else 43 | iflag_shell_mode = iflag_no_FEMMESH 44 | end if 45 | if(iflag_debug .gt. 0) then 46 | write(*,*) 'iflag_shell_mode', iflag_shell_mode 47 | end if 48 | ! 49 | end subroutine set_FEM_mesh_mode_4_SPH 50 | ! 51 | ! ----------------------------------------------------------------------- 52 | ! 53 | end module set_controls_4_sph_shell 54 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | PARA_SRCDIR = $$(F_SRCDIR)/PARALLEL_src 6 | 7 | LIB_PARA = -lcalypso_parallel 8 | LIB_PARA_FILE = libcalypso_parallel.a 9 | 10 | SUBDIRS = \ 11 | COMM_src \ 12 | SPH_SHELL_src \ 13 | CONST_SPH_GRID 14 | 15 | # 16 | # ------------------------------------------------------------------------- 17 | # 18 | 19 | dir_list: 20 | @echo 'PARA_SRCDIR = $(PARA_SRCDIR)' >> $(MAKENAME) 21 | @echo '#' >> $(MAKENAME) 22 | @for dir in $(SUBDIRS); do \ 23 | ( cd $${dir}; \ 24 | $(GMAKE) \ 25 | GMAKE='$(GMAKE)' \ 26 | MAKENAME='$(MAKENAME)' \ 27 | dir_list; \ 28 | ) \ 29 | done 30 | @echo '#' >> $(MAKENAME) 31 | 32 | lib_name: 33 | @echo 'LIB_PARA = $(LIB_PARA)' >> $(MAKENAME) 34 | @echo 'LIB_PARA_FILE = $(LIB_PARA_FILE)' >> $(MAKENAME) 35 | @echo '#' >> $(MAKENAME) 36 | 37 | lib_tasks: libtarget lib_archve 38 | @echo ' ''$$(RANLIB) $$@' >> $(MAKENAME) 39 | 40 | libtarget: 41 | @echo '' >> $(MAKENAME) 42 | @echo '$$(LIB_PARA_FILE): $$(MOD_PARALLEL) ' >> $(MAKENAME) 43 | 44 | lib_archve: 45 | @for dir in $(SUBDIRS); do \ 46 | ( cd $${dir}; \ 47 | $(GMAKE) \ 48 | GMAKE='$(GMAKE)' \ 49 | MAKENAME='$(MAKENAME)' \ 50 | lib_archve \ 51 | ) \ 52 | done 53 | 54 | mod_list: 55 | @echo MOD_PARALLEL= \\ >> $(MAKENAME) 56 | @echo \ 57 | '$$(MOD_COMM) $$(MOD_FEM_INT) ' \ 58 | '$$(MOD_MULTIGRID) $$(MOD_FILTERING)' \ 59 | '$$(MOD_COMM_SPH) $$(MOD_SOLVER_SET_ORDER)' \ 60 | '$$(MOD_ITP_PARA) $$(MOD_SPH_GRID)' >> $(MAKENAME) 61 | @for dir in $(SUBDIRS); do \ 62 | ( cd $${dir}; \ 63 | $(GMAKE) \ 64 | GMAKE='$(GMAKE)' \ 65 | MAKENAME='$(MAKENAME)' \ 66 | mod_list; \ 67 | ) \ 68 | done 69 | 70 | 71 | module: 72 | @for dir in $(SUBDIRS); do \ 73 | ( cd $${dir}; \ 74 | $(GMAKE) \ 75 | GMAKE='$(GMAKE)' \ 76 | MAKE_MOD_DEP='$(MAKE_MOD_DEP)' \ 77 | MAKENAME='$(MAKENAME)' \ 78 | module; \ 79 | ) \ 80 | done 81 | 82 | 83 | clean: 84 | @for dir in $(SUBDIRS); do \ 85 | ( cd $${dir}; \ 86 | $(GMAKE) \ 87 | GMAKE='$(GMAKE)' \ 88 | clean \ 89 | ) \ 90 | done 91 | 92 | rm -f *.o *.mod *~ *.par *.diag *.a 93 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SPH_COMMDIR = $$(PARA_SRCDIR)/SPH_SHELL_src 6 | SRC_COMM_SPH = $(shell ls *.f90 *.F90) 7 | MOD_COMM_SPH = $(addsuffix .o,$(basename $(SRC_COMM_SPH)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'SPH_COMMDIR = $(SPH_COMMDIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_COMM_SPH)' >> $(MAKENAME) 18 | 19 | 20 | mod_list: 21 | @echo MOD_COMM_SPH= \\ >> $(MAKENAME) 22 | @echo $(MOD_COMM_SPH) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(SPH_COMMDIR)' $(SRC_COMM_SPH) 28 | 29 | clean: 30 | rm -f *.o *.mod *~ *.par *.diag *.a 31 | -------------------------------------------------------------------------------- /src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/m_work_pole_sph_trans.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_work_pole_sph_trans 3 | ! 4 | ! Written by H. Matsui on July, 2007 5 | ! 6 | !! subroutine init_num_pole_sph_trans 7 | !! subroutine deallocate_num_pole_sph_trans 8 | !! 9 | ! 10 | module m_work_pole_sph_trans 11 | ! 12 | use m_precision 13 | use m_constants 14 | use m_machine_parameter 15 | ! 16 | implicit none 17 | ! 18 | ! 19 | integer(kind = kint) :: nnod_pole 20 | ! 21 | integer(kind = kint), allocatable :: istack_npole_smp(:) 22 | ! 23 | integer(kind = kint) :: max_npole_smp 24 | ! 25 | private :: allocate_num_pole_sph_trans 26 | ! 27 | ! ---------------------------------------------------------------------- 28 | ! 29 | contains 30 | ! 31 | ! ---------------------------------------------------------------------- 32 | ! 33 | subroutine allocate_num_pole_sph_trans 34 | ! 35 | ! 36 | allocate(istack_npole_smp(0:np_smp) ) 37 | istack_npole_smp = 0 38 | ! 39 | end subroutine allocate_num_pole_sph_trans 40 | ! 41 | ! ---------------------------------------------------------------------- 42 | ! 43 | subroutine deallocate_num_pole_sph_trans 44 | ! 45 | ! 46 | deallocate(istack_npole_smp) 47 | ! 48 | end subroutine deallocate_num_pole_sph_trans 49 | ! 50 | ! ---------------------------------------------------------------------- 51 | ! ---------------------------------------------------------------------- 52 | ! 53 | subroutine init_num_pole_sph_trans 54 | ! 55 | use m_spheric_parameter 56 | use cal_minmax_and_stacks 57 | ! 58 | ! 59 | nnod_pole = 2*nidx_global_rtp(1) + 1 60 | call allocate_num_pole_sph_trans 61 | ! 62 | call count_number_4_smp(np_smp, ione, nnod_pole, & 63 | & istack_npole_smp, max_npole_smp) 64 | ! 65 | end subroutine init_num_pole_sph_trans 66 | ! 67 | ! ---------------------------------------------------------------------- 68 | ! 69 | end module m_work_pole_sph_trans 70 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/BASE/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | BASEDIR = $$(CORE_SRCDIR)/BASE 6 | SRC_BASE = $(shell ls *.f90) 7 | MOD_BASE = $(addsuffix .o,$(basename $(SRC_BASE)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'BASEDIR = $(BASEDIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_BASE)' >> $(MAKENAME) 18 | 19 | 20 | mod_list: 21 | @echo MOD_BASE= \\ >> $(MAKENAME) 22 | @echo $(MOD_BASE) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(BASEDIR)' $(SRC_BASE) 28 | 29 | clean: 30 | rm -f *.o *.mod *~ *.par *.diag *.a 31 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/BASE/cal_num_digits.f90: -------------------------------------------------------------------------------- 1 | !>@file cal_num_digits.f90 2 | !!@brief module cal_num_digits 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in Nov., 2009 6 | ! 7 | !>@brief subtract constant from field data 8 | !!@n need $omp parallel to use these routines 9 | !! 10 | !!@verbatim 11 | !! subroutine cal_num_digit_int(x_input, i_digit, i_exp) 12 | !! subroutine cal_num_digit_real(x_input, r_digit, i_exp) 13 | !!@endverbatim 14 | !! 15 | !!@n @param x_input Input number 16 | !!@n @param r_digit first integer digit for input number 17 | !!@n @param i_digit real digit for input number 18 | !!@n @param i_exp exponent of 10 19 | ! 20 | module cal_num_digits 21 | ! 22 | use m_precision 23 | use m_constants 24 | ! 25 | implicit none 26 | ! 27 | ! --------------------------------------------------------------------- 28 | ! 29 | contains 30 | ! 31 | ! --------------------------------------------------------------------- 32 | ! 33 | subroutine cal_num_digit_int(x_input, i_digit, i_exp) 34 | ! 35 | real(kind = kreal), intent(in) :: x_input 36 | integer(kind = kint), intent(inout) :: i_exp, i_digit 37 | ! 38 | ! 39 | i_exp = int( aint( log10(x_input) )) 40 | ! 41 | if(x_input .ge. one) then 42 | i_digit = nint(x_input * ten**(-i_exp)) 43 | else 44 | i_digit = nint(x_input * ten**(-i_exp+1)) 45 | if(i_digit .eq. iten) then 46 | i_digit = 1 47 | else 48 | i_exp = i_exp-1 49 | end if 50 | end if 51 | ! 52 | end subroutine cal_num_digit_int 53 | ! 54 | ! --------------------------------------------------------------------- 55 | ! 56 | subroutine cal_num_digit_real(x_input, r_digit, i_exp) 57 | ! 58 | real(kind = kreal), intent(in) :: x_input 59 | real(kind = kreal), intent(inout) :: r_digit 60 | integer(kind = kint), intent(inout) :: i_exp 61 | ! 62 | ! 63 | i_exp = int( aint( log10(x_input) )) 64 | ! 65 | if(x_input .ge. one) then 66 | r_digit = x_input * ten**(-i_exp) 67 | else 68 | r_digit = x_input * ten**(-i_exp+1) 69 | if(r_digit .ge. ten) then 70 | r_digit = one 71 | else 72 | i_exp = i_exp-1 73 | end if 74 | end if 75 | ! 76 | end subroutine cal_num_digit_real 77 | ! 78 | ! --------------------------------------------------------------------- 79 | ! 80 | end module cal_num_digits 81 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/BASE/m_constants.f90: -------------------------------------------------------------------------------- 1 | !> @file m_constants.f90 2 | !! module m_constants 3 | !! 4 | !! @author H. Matsui 5 | !! @date Written on Oct., 2009 6 | !! 7 | !> @brief Constants for Fortran sources 8 | ! 9 | module m_constants 10 | ! 11 | use m_precision 12 | ! 13 | implicit none 14 | ! 15 | ! 16 | real(kind = kreal), parameter :: zero = 0.0d0 17 | real(kind = kreal), parameter :: one = 1.0d0 18 | real(kind = kreal), parameter :: two = 2.0d0 19 | real(kind = kreal), parameter :: three = 3.0d0 20 | real(kind = kreal), parameter :: four = 4.0d0 21 | real(kind = kreal), parameter :: five = 5.0d0 22 | real(kind = kreal), parameter :: six = 6.0d0 23 | real(kind = kreal), parameter :: seven = 7.0d0 24 | real(kind = kreal), parameter :: eight = 8.0d0 25 | real(kind = kreal), parameter :: dnine = 9.0d0 26 | real(kind = kreal), parameter :: ten = 10.0d0 27 | real(kind = kreal), parameter :: eleven = 11.0d0 28 | real(kind = kreal), parameter :: twenty = 20.0d0 29 | real(kind = kreal), parameter :: thirty = 30.0d0 30 | ! 31 | real(kind = kreal), parameter :: half = one / two 32 | real(kind = kreal), parameter :: third = one / three 33 | real(kind = kreal), parameter :: quad = one / four 34 | real(kind = kreal), parameter :: r125 = one / eight 35 | real(kind = kreal), parameter :: deci = one / ten 36 | ! 37 | real(kind = kreal), parameter :: dminus = -one 38 | ! 39 | integer(kind = kint), parameter :: izero = 0 40 | integer(kind = kint), parameter :: ione = 1 41 | integer(kind = kint), parameter :: itwo = 2 42 | integer(kind = kint), parameter :: ithree = 3 43 | integer(kind = kint), parameter :: ifour = 4 44 | integer(kind = kint), parameter :: ifive = 5 45 | integer(kind = kint), parameter :: isix = 6 46 | integer(kind = kint), parameter :: iseven = 7 47 | integer(kind = kint), parameter :: ieight = 8 48 | integer(kind = kint), parameter :: inine = 9 49 | integer(kind = kint), parameter :: iten = 10 50 | integer(kind = kint), parameter :: icent = 100 51 | integer(kind = kint), parameter :: ikilo = 1000 52 | ! 53 | integer(kind = kint), parameter :: iminus = -1 54 | ! 55 | real, parameter :: rzero = 0.0e0 56 | real, parameter :: rone = 1.0e0 57 | real, parameter :: rtwo = 2.0e0 58 | real, parameter :: rhalf = 0.5e0 59 | ! 60 | end module m_constants 61 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/BASE/m_machine_parameter.f90: -------------------------------------------------------------------------------- 1 | !> @file m_machine_parameter.f90 2 | !! module m_machine_parameter 3 | !! 4 | !! 5 | !! @author H. Matsui 6 | !! @date Written on May, 2003 7 | !! 8 | !!> @brief Parameters for computer 9 | ! 10 | module m_machine_parameter 11 | ! 12 | use m_precision 13 | ! 14 | implicit none 15 | ! 16 | ! 17 | !> number of SMP threads 18 | integer(kind=kint) :: np_smp = 1 19 | ! 20 | !> integer flag for minimum message 21 | integer(kind = kint), parameter :: iflag_minimum_msg = 0 22 | !> integer flag for routine name output 23 | integer(kind = kint), parameter :: iflag_routine_msg = 1 24 | !> integer flag for full debug output 25 | integer(kind = kint), parameter :: iflag_full_msg = 2 26 | ! 27 | !> debug flag for all processes 28 | integer(kind = kint) :: i_debug = iflag_minimum_msg 29 | !> debug flag for master process 30 | integer(kind = kint) :: iflag_debug = iflag_minimum_msg 31 | ! 32 | !> character array for error message 33 | character(len=256) :: e_message 34 | ! 35 | end module m_machine_parameter 36 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/BASE/m_phys_constants.f90: -------------------------------------------------------------------------------- 1 | !>@file m_phys_constants.f90 2 | !!@brief module m_phys_constants 3 | !! 4 | !!@author H. Matsui and H. Okuda 5 | !!@date Programmed by H. Matsui on MAy., 2009 6 | ! 7 | !> @brief Constants for physical data 8 | !! 9 | module m_phys_constants 10 | ! 11 | use m_precision 12 | ! 13 | implicit none 14 | ! 15 | ! 16 | !> Number of components for scalar 17 | integer (kind = kint), parameter :: n_scalar = 1 18 | !> Number of components for vector 19 | integer (kind = kint), parameter :: n_vector = 3 20 | !> Number of components for symmetric tensor 21 | integer (kind = kint), parameter :: n_sym_tensor = 6 22 | !> Number of components for asymmetric tensor 23 | integer (kind = kint), parameter :: n_asym_tensor = 3 24 | !> Number of components for solenoidal field 25 | integer (kind = kint), parameter :: n_solenoid = 2 26 | ! 27 | !> Component table for symmetric tensor 28 | integer (kind = kint), parameter :: l_sim_t(3,3) & 29 | & = reshape( (/0, 1, 2, & 30 | & 1, 3, 4, & 31 | & 2, 4, 5/), shape=(/3,3/)) 32 | ! 33 | !> Component table for asymmetric tensor 34 | integer (kind = kint), parameter :: l_asim_t(3,3,2) & 35 | & = reshape( (/0, 0, 2, 0, 0, 1, 2, 1, 0, & 36 | & 0, 1,-1, -1, 0, 1, 1,-1, 0 /), & 37 | & shape=(/3,3,2/) ) 38 | ! 39 | !> Address for diagonal component for symmetric tensor 40 | integer (kind = kint), parameter :: lst_sim_t(3) = (/0, 3, 5/) 41 | ! 42 | end module m_phys_constants 43 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/BASE/m_precision.f90: -------------------------------------------------------------------------------- 1 | !>@file m_precision.f90 2 | !!@brief module m_precision 3 | !! 4 | !!@author H. Matsui and H.Okuda 5 | !!@date Programmed in July 2000 6 | !!@n Modified in Sep., 2005 7 | ! 8 | !> @brief Define byte length for number and characters 9 | ! 10 | module m_precision 11 | ! 12 | implicit none 13 | ! 14 | !> kind parameter for integer type variable ( 4 byte ) 15 | integer, parameter :: kint = 4 16 | !> kind parameter for real type variable ( 8 byte ) 17 | integer, parameter :: kreal = 8 18 | !> character length for name ( 255 byte ) 19 | integer, parameter :: kchara = 255 20 | !> character length for file name ( 2047 byte ) 21 | integer, parameter :: len_fname = 2047 22 | ! 23 | !> kind parameter for long integer for global index ( 8 byte ) 24 | integer, parameter :: kint_gl = 8 25 | ! 26 | end module m_precision 27 | 28 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/BASE/m_t_int_parameter.f90: -------------------------------------------------------------------------------- 1 | !> @file m_t_int_parameter.f90 2 | !! module m_t_int_parameter 3 | !! 4 | !! @author H. Matsui and H. Okuda 5 | !! @date Written on Oct., 2000 6 | !! 7 | !> @brief Parameters for time integration 8 | ! 9 | module m_t_int_parameter 10 | ! 11 | use m_precision 12 | use m_constants 13 | ! 14 | implicit none 15 | ! 16 | !> length of each time step @f$ \Delta t @f$ 17 | real(kind=kreal) :: dt 18 | ! 19 | !> @f$ 1 / \Delta t @f$ 20 | real(kind=kreal) :: ddt 21 | ! 22 | !> significand of @f$ \Delta t @f$ 23 | real(kind=kreal) :: dt_fact 24 | !> exponent of @f$ \Delta t @f$ 25 | integer(kind = kint) :: idt_digit 26 | ! 27 | !> Fixed time step flag 28 | integer(kind=kint), parameter :: iflag_fixed_step = 0 29 | !> Flexible time step flag 30 | integer(kind=kint), parameter :: iflag_flex_step = 1 31 | !> flag for time stepping 32 | integer(kind=kint) :: iflag_flexible_step = iflag_fixed_step 33 | ! 34 | !> Maximum @f$ \Delta t @f$ 35 | real(kind=kreal) :: dt_max 36 | !> Mimimum @f$ \Delta t @f$ 37 | real(kind=kreal) :: dt_min 38 | ! 39 | !> Maximum error to shrink time step 40 | real(kind=kreal) :: max_eps_to_shrink_dt 41 | !> Minimum error to expand time step 42 | real(kind=kreal) :: min_eps_to_expand_dt 43 | ! 44 | !> Coefficient of implicit viscous diffusion term 45 | real(kind=kreal) :: coef_imp_v 46 | !> Coefficient of implicit thermal diffusion term 47 | real(kind=kreal) :: coef_imp_t 48 | !> Coefficient of implicit magnetic diffusion term 49 | real(kind=kreal) :: coef_imp_b 50 | !> Coefficient of implicit compositional diffusion term 51 | real(kind=kreal) :: coef_imp_c 52 | ! 53 | !> Coefficient of explicit viscous diffusion term 54 | real(kind=kreal) :: coef_exp_v 55 | !> Coefficient of explicit thermal diffusion term 56 | real(kind=kreal) :: coef_exp_t 57 | !> Coefficient of explicit magnetic diffusion term 58 | real(kind=kreal) :: coef_exp_b 59 | !> Coefficient of explicit compositional diffusion term 60 | real(kind=kreal) :: coef_exp_c 61 | ! 62 | !> Coefficient of terms at current step for Adams-Bashforth 63 | real(kind=kreal), parameter :: adam_0 = three / two 64 | !> Coefficient of terms at previous step for Adams-Bashforth 65 | real(kind=kreal), parameter :: adam_1 = -one / two 66 | !> 1 / adam_0 67 | real(kind=kreal), parameter :: adam_r = two / three 68 | ! 69 | end module m_t_int_parameter 70 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Get sources from each subdirectory 2 | FILE(GLOB BASE_SRC_FILES BASE/*.[fF]90) 3 | FILE(GLOB IO_SRC_FILES IO/*.[fF]90) 4 | FILE(GLOB SPH_SPECTR_SRC_FILES SPH_SPECTR_src/*.[fF]90) 5 | FILE(GLOB GAUSS_INTEGRATION_SRC_FILES gauss_integration/*.[fF]90) 6 | FILE(GLOB SPHERICAL_HARMONICS_SRC_FILES spherical_harmonics/*.[fF]90) 7 | 8 | SET(CALYPSO_CORE_SRC_FILES ${BASE_SRC_FILES} ${IO_SRC_FILES} ${SPH_SPECTR_SRC_FILES} ${GAUSS_INTEGRATION_SRC_FILES} ${SPHERICAL_HARMONICS_SRC_FILES}) 9 | 10 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/FFT_wrapper/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | FFT_WRAP_DIR = $$(CORE_SRCDIR)/FFT_wrapper 6 | SRC_FFT_WRAP = $(shell ls *.f90 *.F90) 7 | MOD_FFT_WRAP = $(addsuffix .o,$(basename $(SRC_FFT_WRAP)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'FFT_WRAP_DIR = $(FFT_WRAP_DIR)' >> $(MAKENAME) 15 | 16 | lib_name: 17 | 18 | libtarget: 19 | 20 | lib_archve: 21 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_FFT_WRAP)' >> $(MAKENAME) 22 | 23 | mod_list: 24 | @echo MOD_FFT_WRAP= \\ >> $(MAKENAME) 25 | @echo $(MOD_FFT_WRAP) >> $(MAKENAME) 26 | @echo '#' >> $(MAKENAME) 27 | 28 | 29 | module: 30 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(FFT_WRAP_DIR)' $(SRC_FFT_WRAP) 31 | 32 | clean: 33 | rm -f *.o *.mod *~ *.par *.diag *.a 34 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/IO/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | IO_DIR = $$(CORE_SRCDIR)/IO 6 | SRC_IO = $(shell ls *.f90 *.F90) 7 | MOD_IO = $(addsuffix .o,$(basename $(SRC_IO)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'IO_DIR = $(IO_DIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_IO)' >> $(MAKENAME) 18 | 19 | mod_list: 20 | @echo MOD_IO= \\ >> $(MAKENAME) 21 | @echo $(MOD_IO) >> $(MAKENAME) 22 | 23 | 24 | module: 25 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(IO_DIR)' $(SRC_IO) 26 | 27 | clean: 28 | rm -f *.o *.mod *~ *.par *.diag *.a 29 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/IO/copy_time_steps_4_restart.f90: -------------------------------------------------------------------------------- 1 | !>@file copy_time_steps_4_restart.f90 2 | !!@brief module copy_time_steps_4_restart 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in Sep., 2006 6 | ! 7 | !>@brief Routines to copy time step information from IO data 8 | !! 9 | !!@verbatim 10 | !! subroutine copy_init_time_from_restart 11 | !! subroutine copy_time_steps_from_restart 12 | !! subroutine copy_time_steps_to_restart 13 | !!@endverbatim 14 | ! 15 | module copy_time_steps_4_restart 16 | ! 17 | use m_precision 18 | ! 19 | use m_constants 20 | use m_t_step_parameter 21 | use m_t_int_parameter 22 | use m_time_data_IO 23 | ! 24 | implicit none 25 | ! 26 | ! --------------------------------------------------------------------- 27 | ! 28 | contains 29 | ! 30 | ! --------------------------------------------------------------------- 31 | ! 32 | subroutine copy_init_time_from_restart 33 | ! 34 | ! 35 | time_init = time_IO 36 | i_step_init = i_time_step_IO 37 | ! 38 | end subroutine copy_init_time_from_restart 39 | ! 40 | ! --------------------------------------------------------------------- 41 | ! 42 | subroutine copy_time_steps_from_restart 43 | ! 44 | use cal_num_digits 45 | ! 46 | ! 47 | call copy_init_time_from_restart 48 | ! 49 | if(delta_t_IO .gt. zero) then 50 | dt = delta_t_IO 51 | ddt= one / dt 52 | call cal_num_digit_real(dt, dt_fact, idt_digit) 53 | end if 54 | ! 55 | end subroutine copy_time_steps_from_restart 56 | ! 57 | ! --------------------------------------------------------------------- 58 | ! 59 | subroutine copy_time_steps_to_restart 60 | ! 61 | ! 62 | i_time_step_IO = i_step_MHD 63 | time_IO = time 64 | delta_t_IO = dt 65 | ! 66 | end subroutine copy_time_steps_to_restart 67 | ! 68 | ! --------------------------------------------------------------------- 69 | ! 70 | end module copy_time_steps_4_restart 71 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/IO/m_control_params_sph_data.f90: -------------------------------------------------------------------------------- 1 | !> @file m_control_params_sph_data.f90 2 | !! module m_control_params_sph_data 3 | !! 4 | !! @author H. Matsui 5 | !! @date Programmed in Nov., 2009 6 | ! 7 | !> @brief File prefix for spectrum data 8 | !! 9 | !!@verbatim 10 | !! subroutine set_spectr_prefix_fmt_2_fld_IO(fld_IO) 11 | !! type(field_IO), intent(inout) :: fld_IO 12 | !!@endverbatim 13 | ! 14 | module m_control_params_sph_data 15 | ! 16 | use m_precision 17 | use m_constants 18 | ! 19 | implicit none 20 | ! 21 | !> Output flag for spherical harmonics coefficients data 22 | integer(kind = kint) :: iflag_sph_spec_output 23 | ! 24 | !> file header for spherical harmonics coefficients data 25 | character(len=kchara) :: spectr_file_head 26 | !> file header for spherical harmonics coefficients data 27 | integer(kind = kint) :: iflag_sph_spectr_fmt = 0 28 | ! 29 | ! ---------------------------------------------------------------------- 30 | ! 31 | contains 32 | ! 33 | ! ---------------------------------------------------------------------- 34 | ! 35 | subroutine set_spectr_prefix_fmt_2_fld_IO(fld_IO) 36 | ! 37 | use t_field_data_IO 38 | ! 39 | type(field_IO), intent(inout) :: fld_IO 40 | ! 41 | ! 42 | call set_field_file_fmt_prefix & 43 | & (iflag_sph_spectr_fmt, spectr_file_head, fld_IO) 44 | ! 45 | end subroutine set_spectr_prefix_fmt_2_fld_IO 46 | ! 47 | ! ---------------------------------------------------------------------- 48 | ! 49 | end module m_control_params_sph_data 50 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | CORE_SRCDIR = $$(F_SRCDIR)/SERIAL_src 6 | 7 | LIB_MESH = -lcalypso_core 8 | LIB_MESH_FILE = libcalypso_core.a 9 | 10 | SUBDIRS = \ 11 | BASE \ 12 | IO \ 13 | spherical_harmonics \ 14 | gauss_integration \ 15 | FFT_wrapper \ 16 | SPH_SPECTR_src 17 | 18 | 19 | # 20 | # ------------------------------------------------------------------------- 21 | # 22 | 23 | dir_list: 24 | @echo 'CORE_SRCDIR = $(CORE_SRCDIR)' >> $(MAKENAME) 25 | @echo '#' >> $(MAKENAME) 26 | @for dir in $(SUBDIRS); do \ 27 | ( cd $${dir}; \ 28 | $(GMAKE) \ 29 | GMAKE='$(GMAKE)' \ 30 | MAKENAME='$(MAKENAME)' \ 31 | dir_list; \ 32 | ) \ 33 | done 34 | @echo '#' >> $(MAKENAME) 35 | 36 | lib_name: 37 | @echo 'LIB_MESH = $(LIB_MESH)' >> $(MAKENAME) 38 | @echo 'LIB_MESH_FILE = $(LIB_MESH_FILE)' >> $(MAKENAME) 39 | @echo >> $(MAKENAME) 40 | 41 | lib_tasks: libtarget lib_archve 42 | @echo ' ''$$(RANLIB) $$@' >> $(MAKENAME) 43 | 44 | libtarget: 45 | @echo '' >> $(MAKENAME) 46 | @echo '$$(LIB_MESH_FILE): $$(MOD_CORE)'>> $(MAKENAME) 47 | 48 | lib_archve: 49 | @for dir in $(SUBDIRS); do \ 50 | ( cd $${dir}; \ 51 | $(GMAKE) \ 52 | GMAKE='$(GMAKE)' \ 53 | MAKENAME='$(MAKENAME)' \ 54 | lib_archve; \ 55 | ) \ 56 | done 57 | 58 | mod_list: 59 | @echo MOD_CORE= \\ >> $(MAKENAME) 60 | @echo \ 61 | '$$(MOD_BASE)' \ 62 | '$$(MOD_IO)' \ 63 | '$$(MOD_GAUSS)' \ 64 | '$$(MOD_SPH)' \ 65 | '$$(MOD_FFT_WRAP)' \ 66 | '$$(MOD_SPH_SPECTR)' \ 67 | >> $(MAKENAME) 68 | @echo >> $(MAKENAME) 69 | @for dir in $(SUBDIRS); do \ 70 | ( cd $${dir}; \ 71 | $(GMAKE) \ 72 | GMAKE='$(GMAKE)' \ 73 | MAKENAME='$(MAKENAME)' \ 74 | mod_list; \ 75 | ) \ 76 | done 77 | 78 | 79 | module: 80 | @for dir in $(SUBDIRS); do \ 81 | ( cd $${dir}; \ 82 | $(GMAKE) \ 83 | GMAKE='$(GMAKE)' \ 84 | MAKE_MOD_DEP='$(MAKE_MOD_DEP)' \ 85 | MAKENAME='$(MAKENAME)' \ 86 | module; \ 87 | ) \ 88 | done 89 | 90 | 91 | clean: 92 | @for dir in $(SUBDIRS); do \ 93 | ( cd $${dir}; \ 94 | $(GMAKE) \ 95 | GMAKE='$(GMAKE)' \ 96 | clean \ 97 | ) \ 98 | done 99 | 100 | rm -f *.o *.mod *~ *.par *.diag *.a 101 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SPH_SPECTR_DIR = $$(CORE_SRCDIR)/SPH_SPECTR_src 6 | SRC_SPH_SPECTR = $(shell ls *.f90) 7 | MOD_SPH_SPECTR = $(addsuffix .o,$(basename $(SRC_SPH_SPECTR)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'SPH_SPECTR_DIR = $(SPH_SPECTR_DIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_SPH_SPECTR)' >> $(MAKENAME) 18 | 19 | mod_list: 20 | @echo MOD_SPH_SPECTR= \\ >> $(MAKENAME) 21 | @echo $(MOD_SPH_SPECTR) >> $(MAKENAME) 22 | @echo '#' >> $(MAKENAME) 23 | 24 | 25 | module: 26 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(SPH_SPECTR_DIR)' $(SRC_SPH_SPECTR) 27 | 28 | clean: 29 | rm -f *.o *.mod *~ *.par *.diag *.a 30 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/copy_rj_spec_name_to_node.f90: -------------------------------------------------------------------------------- 1 | !> @file copy_rj_spec_name_to_node.f90 2 | !! module copy_rj_spec_name_to_node 3 | !! 4 | !! @author H. Matsui 5 | !! @date Programmed in Feb., 2008 6 | ! 7 | !> @brief Copy spectr fields name to nodal field name 8 | !! 9 | !!@verbatim 10 | !! subroutine copy_rj_spec_name_to_nod_fld 11 | !!@endverbatim 12 | ! 13 | module copy_rj_spec_name_to_node 14 | ! 15 | use m_precision 16 | ! 17 | implicit none 18 | ! 19 | ! ----------------------------------------------------------------------- 20 | ! 21 | contains 22 | ! 23 | ! ----------------------------------------------------------------------- 24 | ! 25 | subroutine copy_rj_spec_name_to_nod_fld(nod_fld) 26 | ! 27 | use t_phys_data 28 | use m_sph_spectr_data 29 | ! 30 | type(phys_data),intent(inout) :: nod_fld 31 | ! 32 | ! 33 | nod_fld%num_phys = num_phys_rj 34 | nod_fld%ntot_phys = ntot_phys_rj 35 | ! 36 | nod_fld%num_phys_viz = num_phys_rj_vis 37 | nod_fld%ntot_phys_viz = ntot_comp_rj_vis 38 | ! 39 | call alloc_phys_name_type(nod_fld) 40 | ! 41 | nod_fld%num_component(1:nod_fld%num_phys) & 42 | & = num_phys_comp_rj(1:nod_fld%num_phys) 43 | nod_fld%phys_name(1:nod_fld%num_phys) & 44 | & = phys_name_rj(1:nod_fld%num_phys) 45 | nod_fld%iflag_monitor(1:nod_fld%num_phys) & 46 | & = iflag_monitor_rj(1:nod_fld%num_phys) 47 | nod_fld%istack_component(0:nod_fld%num_phys) & 48 | & = istack_phys_comp_rj(0:nod_fld%num_phys) 49 | ! 50 | end subroutine copy_rj_spec_name_to_nod_fld 51 | ! 52 | ! ----------------------------------------------------------------------- 53 | ! 54 | end module copy_rj_spec_name_to_node 55 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/m_sph_trans_parameter.f90: -------------------------------------------------------------------------------- 1 | !>@file m_sph_trans_parameter.f90 2 | !!@brief module m_sph_trans_parameter 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in July, 2007 6 | ! 7 | !>@brief Work parameters for parallelization of spherical harmonics 8 | !! 9 | !!@verbatim 10 | !! subroutine set_local_sph_dimension(my_rank) 11 | !!@endverbatim 12 | ! 13 | module m_sph_trans_parameter 14 | ! 15 | use m_precision 16 | ! 17 | implicit none 18 | ! 19 | ! 20 | ! 21 | integer(kind = kint) :: ltr 22 | integer(kind = kint) :: nr_oc, nr_ic, nr_mt, ntheta, nphi 23 | ! 24 | integer(kind = kint) :: ndomain_r, ndomain_r2, ndomain_r3 25 | integer(kind = kint) :: ndomain_t, ndomain_t2, ndomain_t3 26 | integer(kind = kint) :: ndomain_p, ndomain_p2, ndomain_p3 27 | ! 28 | integer(kind = kint) :: nro_l, nro_l2, nro_l3 29 | integer(kind = kint) :: nri_l, nri_l2, nri_l3 30 | integer(kind = kint) :: nrm_l, nrm_l2, nrm_l3 31 | integer(kind = kint) :: nth_l, nth_l2, nth_l3 32 | integer(kind = kint) :: nph_l, nph_l2, nph_l3 33 | ! 34 | integer(kind = kint) :: idomain_r, idomain_r2, idomain_r3 35 | integer(kind = kint) :: idomain_t, idomain_t2, idomain_t3 36 | integer(kind = kint) :: idomain_p, idomain_p2, idomain_p3 37 | ! 38 | ! 39 | ! ----------------------------------------------------------------------- 40 | ! 41 | contains 42 | ! 43 | ! ----------------------------------------------------------------------- 44 | ! 45 | subroutine set_local_sph_dimension(my_rank) 46 | ! 47 | ! ndomain_p = 1 48 | ! 49 | integer(kind = kint), intent(in) :: my_rank 50 | ! 51 | ! 52 | nro_l = nr_oc / ndomain_r 53 | nri_l = nr_ic / ndomain_r 54 | nrm_l = nr_mt / ndomain_r 55 | nth_l = ntheta / ndomain_t 56 | nph_l = nphi / ndomain_p 57 | ! 58 | idomain_r = mod(my_rank,ndomain_r) 59 | idomain_t = (my_rank-idomain_r) / ndomain_r 60 | idomain_t = mod(idomain_t,ndomain_t) 61 | idomain_p = ( my_rank - idomain_r - idomain_t*ndomain_r ) & 62 | & / (ndomain_r*ndomain_t) 63 | idomain_r = idomain_r + 1 64 | idomain_t = idomain_t + 1 65 | idomain_p = idomain_p + 1 66 | ! 67 | end subroutine set_local_sph_dimension 68 | ! 69 | ! ----------------------------------------------------------------------- 70 | ! 71 | end module m_sph_trans_parameter 72 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/m_spheric_constants.f90: -------------------------------------------------------------------------------- 1 | !>@file m_spheric_constants.f90 2 | !!@brief module m_spheric_constants 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in July, 2007 6 | ! 7 | !>@brief Constants for spectr data 8 | !! 9 | !!@verbatim 10 | !! igrid_Chebyshev = 2 :: Chebyshev collocation points 11 | !! igrid_non_equidist = 1 :: non-equi-distance 12 | !! igrid_equidistance = 0 :: equi-distance 13 | !! 14 | !! spherical mesh type -1: none, 0: Gauss points only 15 | !! 1: include poles 16 | !! 2: include center 17 | !!@endverbatim 18 | ! 19 | module m_spheric_constants 20 | ! 21 | use m_precision 22 | ! 23 | integer(kind = kint), parameter :: igrid_half_Chebyshev = 3 24 | integer(kind = kint), parameter :: igrid_Chebyshev = 2 25 | integer(kind = kint), parameter :: igrid_non_equidist = 1 26 | integer(kind = kint), parameter :: igrid_equidistance = 0 27 | ! 28 | integer(kind = kint), parameter :: iflag_no_FEMMESH = -1 29 | integer(kind = kint), parameter :: iflag_MESH_same = 0 30 | integer(kind = kint), parameter :: iflag_MESH_w_pole = 1 31 | integer(kind = kint), parameter :: iflag_MESH_w_center = 2 32 | ! 33 | ! 34 | character(len = kchara), parameter & 35 | & :: label_half_Cbyv = 'half_Chebyshev' 36 | character(len = kchara), parameter & 37 | & :: label_Chebyshev = 'Chebyshev' 38 | character(len = kchara), parameter & 39 | & :: label_explicit = 'explicit' 40 | character(len = kchara), parameter & 41 | & :: label_equi = 'equi_distance' 42 | ! 43 | character(len = kchara), parameter & 44 | & :: label_no_FEMMESH = 'no_mesh' 45 | character(len = kchara), parameter & 46 | & :: label_MESH_same = 'no_pole' 47 | character(len = kchara), parameter & 48 | & :: label_MESH_pole = 'with_pole' 49 | character(len = kchara), parameter & 50 | & :: label_MESH_ctr = 'with_center' 51 | ! 52 | end module m_spheric_constants 53 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/t_spheric_mesh.f90: -------------------------------------------------------------------------------- 1 | !>@file t_spheric_mesh.f90 2 | !!@brief module t_spheric_mesh 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in July, 2007 6 | ! 7 | !> @brief Structure for grid and comm table for spherical transform 8 | ! 9 | module t_spheric_mesh 10 | ! 11 | use m_precision 12 | ! 13 | use t_spheric_parameter 14 | use t_sph_trans_comm_tbl 15 | use t_group_data 16 | ! 17 | implicit none 18 | ! 19 | ! 20 | !> Structure for grid and comm table for spherical transform 21 | type sph_group_data 22 | !> node group for grid space 23 | type(group_data) :: bc_rtp_grp 24 | !> radial group for grid space 25 | type(group_data) :: radial_rtp_grp 26 | !> meridional group for grid space 27 | type(group_data) :: theta_rtp_grp 28 | !> zonal group for grid space 29 | type(group_data) :: zonal_rtp_grp 30 | ! 31 | !> radial group for sprctrum space 32 | type(group_data) :: radial_rj_grp 33 | !> spherical harmonics group for sprctrum space 34 | type(group_data) :: sphere_rj_grp 35 | end type sph_group_data 36 | ! 37 | ! 38 | type sph_mesh_data 39 | !> spherical harmonics indexing data 40 | type(sph_grids) :: sph_mesh 41 | !> communication tables for spherical transform 42 | type(sph_comm_tables) :: sph_comms 43 | !> grouping data for harmonics indices 44 | type(sph_group_data) :: sph_grps 45 | end type sph_mesh_data 46 | ! 47 | ! 48 | end module t_spheric_mesh 49 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/gauss_integration/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | GAUSSDIR = $$(CORE_SRCDIR)/gauss_integration 6 | 7 | SRC_GAUSS = $(shell ls *.f90) 8 | MOD_GAUSS = $(addsuffix .o,$(basename $(SRC_GAUSS)) ) 9 | 10 | # 11 | # ------------------------------------------------------------------------- 12 | # 13 | 14 | dir_list: 15 | @echo 'GAUSSDIR = $(GAUSSDIR)' >> $(MAKENAME) 16 | 17 | lib_archve: 18 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_GAUSS)' >> $(MAKENAME) 19 | 20 | mod_list: 21 | @echo MOD_GAUSS= \\ >> $(MAKENAME) 22 | @echo $(MOD_GAUSS) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(GAUSSDIR)' $(SRC_GAUSS) 28 | 29 | clean: 30 | rm -f *.o *.mod *~ *.par *.diag *.a 31 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/spherical_harmonics/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SPH_DIR = $$(CORE_SRCDIR)/spherical_harmonics 6 | SRC_SPH = $(shell ls *.f90 *.F90) 7 | MOD_SPH = $(addsuffix .o,$(basename $(SRC_SPH)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'SPH_DIR = $(SPH_DIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_SPH)' >> $(MAKENAME) 18 | 19 | mod_list: 20 | @echo MOD_SPH= \\ >> $(MAKENAME) 21 | @echo $(MOD_SPH) >> $(MAKENAME) 22 | @echo '#' >> $(MAKENAME) 23 | 24 | 25 | module: 26 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(SPH_DIR)' $(SRC_SPH) 27 | 28 | clean: 29 | rm -f *.o *.mod *~ *.par *.diag *.a 30 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SERIAL_src/spherical_harmonics/factorials.f90: -------------------------------------------------------------------------------- 1 | !>@file factorials.f90 2 | !!@brief module factorials 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in 1993 6 | !!@n Modified in 2009 7 | ! 8 | !> @brief double precision function fact(ns,ne,ni) 9 | !! 10 | !!@verbatim 11 | !!******************************************** 12 | !!* * 13 | !!* caliculate factorials * 14 | !!* * 15 | !!* factorial(ns,ne,ni) = [ne! / ns!] **ni * 16 | !!* * 17 | !!******************************************** 18 | !!@endverbatim 19 | !! 20 | !!@n @param ns Start number for factorization 21 | !!@n @param ne End number for factorization 22 | !!@n @param ni Order of factorization 23 | !!@n @param fact(ns,ne,ni) \f$ \left(\frac{ns!}{ne!} \right)^{ni}\f$ 24 | ! 25 | module factorials 26 | ! 27 | use m_precision 28 | use m_constants 29 | ! 30 | implicit none 31 | ! 32 | ! 33 | ! --------------------------------------------------------------------- 34 | ! 35 | contains 36 | ! 37 | ! --------------------------------------------------------------------- 38 | ! 39 | double precision function factorial(ns,ne,ni) 40 | ! 41 | integer(kind = kint), intent(in) :: ns, ne, ni 42 | ! 43 | integer(kind = kint) :: i 44 | ! 45 | ! 46 | factorial = one 47 | if (ns.lt.0 .or. ne.lt.ns) then 48 | write (6,690) ns,ne,ni 49 | return 50 | end if 51 | ! 52 | do i = ns+1 ,ne 53 | factorial = factorial * (dble(i)**ni) 54 | end do 55 | ! 56 | 690 format('error in factrials (start,end,power) = ',3i3) 57 | ! 58 | end function factorial 59 | ! 60 | ! --------------------------------------------------------------------- 61 | ! 62 | end module factorials 63 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SOLVER_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SOLVER_SRCDIR = $$(F_SRCDIR)/SOLVER_src 6 | 7 | LIB_SOLVER = -lcalypso_solver 8 | LIB_SOLVER_FILE = libcalypso_solver.a 9 | 10 | SUBDIRS = \ 11 | direct_solver 12 | 13 | # 14 | # ------------------------------------------------------------------------- 15 | # 16 | 17 | dir_list: 18 | @echo 'SOLVER_SRCDIR = $(SOLVER_SRCDIR)' >> $(MAKENAME) 19 | @echo '#' >> $(MAKENAME) 20 | @for dir in $(SUBDIRS); do \ 21 | ( \ 22 | echo 'generate diectory list for ' $$dir ; \ 23 | cd $${dir}; \ 24 | $(GMAKE) \ 25 | GMAKE='$(GMAKE)' \ 26 | MAKENAME='$(MAKENAME)' \ 27 | dir_list; \ 28 | ) \ 29 | done 30 | @echo '#' >> $(MAKENAME) 31 | 32 | lib_name: 33 | @echo 'LIB_SOLVER = $(LIB_SOLVER)' >> $(MAKENAME) 34 | @echo 'LIB_SOLVER_FILE = $(LIB_SOLVER_FILE)' >> $(MAKENAME) 35 | @echo >> $(MAKENAME) 36 | 37 | lib_tasks: libtarget lib_archve 38 | @echo ' ''$$(RANLIB) $$@' >> $(MAKENAME) 39 | 40 | libtarget: 41 | @echo '' >> $(MAKENAME) 42 | @echo '$$(LIB_SOLVER_FILE): $$(MOD_SOLVERS)' >> $(MAKENAME) 43 | 44 | lib_archve: 45 | @for dir in $(SUBDIRS); do \ 46 | ( cd $${dir}; \ 47 | $(GMAKE) \ 48 | GMAKE='$(GMAKE)' \ 49 | MAKENAME='$(MAKENAME)' \ 50 | lib_archve; \ 51 | ) \ 52 | done 53 | 54 | 55 | mod_list: 56 | @echo MOD_SOLVERS= \\ >> $(MAKENAME) 57 | @echo \ 58 | '$$(MOD_SR) $$(MOD_DJDS_SOLVER)' \ 59 | '$$(MOD_CRS_SOLVER) $$(MOD_CRS_SOLVER_S) ' \ 60 | '$$(MOD_SOLVER_LU)' >> $(MAKENAME) 61 | @for dir in $(SUBDIRS); do \ 62 | ( cd $${dir}; \ 63 | $(GMAKE) \ 64 | GMAKE='$(GMAKE)' \ 65 | MAKENAME='$(MAKENAME)' \ 66 | mod_list; \ 67 | ) \ 68 | done 69 | 70 | module: 71 | @echo '' >> $(MAKENAME) 72 | @for dir in $(SUBDIRS); do \ 73 | ( cd $${dir}; \ 74 | $(GMAKE) \ 75 | GMAKE='$(GMAKE)' \ 76 | MAKE_MOD_DEP='$(MAKE_MOD_DEP)' \ 77 | MAKENAME='$(MAKENAME)' \ 78 | module; \ 79 | ) \ 80 | done 81 | 82 | 83 | clean: 84 | @for dir in $(SUBDIRS); do \ 85 | ( cd $${dir}; \ 86 | $(GMAKE) \ 87 | GMAKE='$(GMAKE)' \ 88 | clean \ 89 | ) \ 90 | done 91 | 92 | rm -f *.o *.mod *~ *.par *.diag *.a 93 | -------------------------------------------------------------------------------- /src/Fortran_libraries/SOLVER_src/direct_solver/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SOLVER_LU_DIR = $$(SOLVER_SRCDIR)/direct_solver 6 | SRC_SOLVER_LU = $(shell ls *.f90) 7 | MOD_SOLVER_LU = $(addsuffix .o,$(basename $(SRC_SOLVER_LU)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'SOLVER_LU_DIR = $(SOLVER_LU_DIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' ''$$(AR)' '$$(ARFLUGS)' rcsv '$$@' '$$(MOD_SOLVER_LU)' >> $(MAKENAME) 18 | 19 | 20 | mod_list: 21 | @echo MOD_SOLVER_LU= \\ >> $(MAKENAME) 22 | @echo $(MOD_SOLVER_LU) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(SOLVER_LU_DIR)' $(SRC_SOLVER_LU) 28 | 29 | clean: 30 | rm -f *.o *.mod *~ *.par *.diag *.a 31 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MERGE/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | MERGE_DIR = $$(UTILS_SRCDIR)/MERGE 6 | SRC_MERGE = $(shell ls *.f90 *.F90) 7 | MOD_MERGE = $(addsuffix .o,$(basename $(SRC_MERGE)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'MERGE_DIR = $(MERGE_DIR)' >> $(MAKENAME) 15 | 16 | lib_name: 17 | 18 | lib_tasks: libtarget lib_archve 19 | @echo ' ''$$(RANLIB)' '$$@' >> $(MAKENAME) 20 | 21 | libtarget: 22 | 23 | lib_archve: 24 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_MERGE)' >> $(MAKENAME) 25 | 26 | mod_list: 27 | @echo MOD_MERGE= \\ >> $(MAKENAME) 28 | @echo $(MOD_MERGE) >> $(MAKENAME) 29 | @echo >> $(MAKENAME) 30 | 31 | 32 | module: 33 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(MERGE_DIR)' $(SRC_MERGE) 34 | 35 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | MESHDIR = $$(UTILS_SRCDIR)/MESH 6 | SRC_MESH = $(shell ls *.f90) 7 | MOD_MESH = $(addsuffix .o,$(basename $(SRC_MESH)) ) 8 | 9 | # 10 | # ------------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'MESHDIR = $(MESHDIR)' >> $(MAKENAME) 15 | 16 | lib_archve: 17 | @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_MESH)' >> $(MAKENAME) 18 | 19 | 20 | mod_list: 21 | @echo MOD_MESH= \\ >> $(MAKENAME) 22 | @echo $(MOD_MESH) >> $(MAKENAME) 23 | @echo '#' >> $(MAKENAME) 24 | 25 | 26 | module: 27 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(MESHDIR)' $(SRC_MESH) 28 | 29 | clean: 30 | rm -f *.o *.mod *~ *.par *.diag *.a 31 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/load_mesh_data.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module load_mesh_data 3 | ! 4 | ! Written by H. Matsui on July, 2007 5 | ! 6 | ! subroutine input_mesh(my_rank) 7 | ! subroutine output_mesh(my_rank) 8 | ! 9 | module load_mesh_data 10 | ! 11 | use m_precision 12 | use m_machine_parameter 13 | ! 14 | use mesh_IO_select 15 | ! 16 | implicit none 17 | ! 18 | ! ----------------------------------------------------------------------- 19 | ! 20 | contains 21 | ! 22 | ! ----------------------------------------------------------------------- 23 | ! 24 | subroutine input_mesh(my_rank) 25 | ! 26 | use m_nod_comm_table 27 | use m_geometry_data 28 | use m_group_data 29 | ! 30 | use set_nnod_4_ele_by_type 31 | use set_mesh_types 32 | use set_group_types_4_IO 33 | ! 34 | integer(kind = kint), intent(in) :: my_rank 35 | ! 36 | ! set mesh informations 37 | call sel_read_mesh(my_rank) 38 | ! 39 | call set_mesh_geometry_data(nod_comm, node1, ele1) 40 | call set_grp_data_from_IO(nod_grp1, ele_grp1, sf_grp1) 41 | ! 42 | call set_3D_nnod_4_sfed_by_ele & 43 | & (ele1%nnod_4_ele, surf1%nnod_4_surf, edge1%nnod_4_edge) 44 | ! 45 | call allocate_ele_geometry_type(ele1) 46 | ! 47 | end subroutine input_mesh 48 | ! 49 | ! ----------------------------------------------------------------------- 50 | ! 51 | subroutine output_mesh(my_rank) 52 | ! 53 | use m_nod_comm_table 54 | use m_geometry_data 55 | use m_group_data 56 | ! 57 | use set_mesh_types 58 | use set_group_types_4_IO 59 | ! 60 | integer(kind = kint), intent(in) :: my_rank 61 | ! 62 | ! 63 | call set_mesh_data_to_IO(my_rank, nod_comm, node1, ele1) 64 | call set_grp_data_to_IO(nod_grp1, ele_grp1, sf_grp1) 65 | ! 66 | ! save mesh information 67 | call sel_write_mesh_file(my_rank) 68 | ! 69 | call deallocate_ele_connect_type(ele1) 70 | call deallocate_node_geometry_type(node1) 71 | ! 72 | call deallocate_grp_type(nod_grp1) 73 | call deallocate_grp_type(ele_grp1) 74 | call deallocate_sf_grp_type(sf_grp1) 75 | ! 76 | end subroutine output_mesh 77 | ! 78 | ! ----------------------------------------------------------------------- 79 | ! 80 | end module load_mesh_data 81 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/m_element_id_4_node.f90: -------------------------------------------------------------------------------- 1 | !>@file m_element_id_4_node.f90 2 | !!@brief module m_element_id_4_node 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed in Oct., 2006 6 | ! 7 | !> @brief included element list for each node 8 | !! 9 | module m_element_id_4_node 10 | ! 11 | use m_precision 12 | use m_constants 13 | use t_next_node_ele_4_node 14 | ! 15 | implicit none 16 | ! 17 | ! 18 | !> Structure of included element list for each node 19 | type(element_around_node), save :: ele_4_nod1 20 | ! 21 | !> Structure of neighbouring node list for each node 22 | type(next_nod_id_4_nod), save :: neib_nod1 23 | ! 24 | end module m_element_id_4_node 25 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/m_geometry_data.f90: -------------------------------------------------------------------------------- 1 | !>@file m_geometry_data.f90 2 | !!@brief module m_geometry_data 3 | !! 4 | !!@author H. Okuda and H. Matsui 5 | !!@date Programmed in 2001 6 | !!@date Modified in 2008 7 | !!@date Modified in Aug., 2015 8 | ! 9 | !> @brief geometry data for FEM mesh 10 | !! including node and element position, all connectivities 11 | !! 12 | ! 13 | module m_geometry_data 14 | ! 15 | use m_precision 16 | use t_geometry_data 17 | use t_surface_data 18 | use t_edge_data 19 | ! 20 | implicit none 21 | ! 22 | !> structure for node data (position) 23 | type(node_data), save :: node1 24 | ! node1%istack_internod 25 | ! 26 | !> structure for element data (position and connectivity) 27 | type(element_data), save :: ele1 28 | ! ele1%istack_interele 29 | ! 30 | !> structure of surface data (geometry and connectivity) 31 | type(surface_data), save :: surf1 32 | ! surf1%x_surf 33 | ! 34 | !> Structure for edge data 35 | type(edge_data), save :: edge1 36 | ! edge1%istack_numedge 37 | ! 38 | end module m_geometry_data 39 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/m_nod_comm_table.f90: -------------------------------------------------------------------------------- 1 | !>@file m_nod_comm_table.f90 2 | !!@brief module m_nod_comm_table 3 | !! 4 | !!@author H. Matsui and H. Okuda 5 | !!@date Programmed in 2000 6 | !!@n Modified in 2006 7 | ! 8 | !> @brief Communication table for node 9 | !! 10 | module m_nod_comm_table 11 | ! 12 | use m_precision 13 | use t_comm_table 14 | ! 15 | implicit none 16 | ! 17 | !> data structure for node communication table 18 | type(communication_table), save :: nod_comm 19 | ! 20 | ! 21 | end module m_nod_comm_table 22 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/m_node_phys_address.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_node_phys_address 3 | ! 4 | !> @brief Nodal field data addresses for FEM 5 | ! 6 | ! Written by H. Matsui 7 | ! 8 | ! subroutine initialize_nod_field_data 9 | ! 10 | module m_node_phys_address 11 | ! 12 | use m_precision 13 | use m_constants 14 | ! 15 | use t_phys_address 16 | ! 17 | ! 18 | implicit none 19 | ! 20 | ! label for simulation 21 | character(len=kchara) :: label_sim 22 | ! 23 | ! address for nodal fields 24 | type(phys_address), save :: iphys 25 | ! 26 | ! ------------------------------------------------------------------- 27 | ! 28 | contains 29 | ! 30 | ! ------------------------------------------------------------------- 31 | ! 32 | subroutine initialize_nod_field_data 33 | ! 34 | use m_geometry_data 35 | use m_node_phys_data 36 | use set_field_address 37 | ! 38 | ! 39 | ! allocation for physical values 40 | ! 41 | call alloc_phys_data_type(node1%numnod, nod_fld1) 42 | ! 43 | ! set address of nodal values 44 | ! 45 | call set_field_addresses(ione, nod_fld1%num_phys, & 46 | & nod_fld1%phys_name, nod_fld1%num_component, iphys) 47 | ! 48 | end subroutine initialize_nod_field_data 49 | ! 50 | ! -------------------------------------------------------------------- 51 | ! 52 | end module m_node_phys_address 53 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/m_node_phys_data.f90: -------------------------------------------------------------------------------- 1 | !m_node_phys_data.f90 2 | ! module m_node_phys_data 3 | ! 4 | !> @brief nodal field data for FEM 5 | ! 6 | ! Written by H. Matsui 7 | ! 8 | ! subroutine deallocate_phys_name 9 | ! subroutine deallocate_data_arrays 10 | ! subroutine check_nodal_data(my_rank, numdir, i_field) 11 | ! 12 | module m_node_phys_data 13 | ! 14 | use m_precision 15 | use t_phys_data 16 | ! 17 | implicit none 18 | ! 19 | !> Structure for nodal field data 20 | type(phys_data), save :: nod_fld1 21 | ! 22 | ! --------------------------------------------------------------------- 23 | ! 24 | contains 25 | ! 26 | ! --------------------------------------------------------------------- 27 | ! 28 | subroutine deallocate_phys_name 29 | ! 30 | call dealloc_phys_name_type(nod_fld1) 31 | ! 32 | end subroutine deallocate_phys_name 33 | ! 34 | ! -------------------------------------------------------------------- 35 | ! 36 | subroutine deallocate_data_arrays 37 | ! 38 | call dealloc_phys_data_type(nod_fld1) 39 | ! 40 | end subroutine deallocate_data_arrays 41 | ! 42 | ! -------------------------------------------------------------------- 43 | ! 44 | end module m_node_phys_data 45 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/m_quad_2_triangle.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_quad_2_triangle 3 | ! 4 | !> @brief Index table to devide one quadrature patch to triangles 5 | ! 6 | ! written by H. Matsui on March, 2007 7 | ! 8 | !> table to devide quadrature to two triangles 9 | !>@n@param ie_quad_2_tri(i,j) i... local triangle ID (1, 2, 3) 10 | !>@n j... devided triangle (1, 2) 11 | ! 12 | !>@code 13 | !! 4---3 4---3 14 | !! | | | /| 15 | !! | | --> | / | 16 | !! | | |/ | 17 | !! 1---2 1---2 18 | !>@endcode 19 | ! 20 | module m_quad_2_triangle 21 | ! 22 | use m_precision 23 | ! 24 | implicit none 25 | ! 26 | !> local index to construct triangle from one quadrature patch 27 | !> ie_quad_2_tri(i,j): i...triangle ID, j...devided ID 28 | integer (kind=kint), parameter :: ie_quad_2_tri(3,2) & 29 | & = reshape((/1, 2, 3, 1, 3, 4/), shape=(/3,2/)) 30 | ! 31 | ! --------------------------------------------------------------------- 32 | ! 33 | ! contains 34 | ! 35 | ! --------------------------------------------------------------------- 36 | ! 37 | end module m_quad_2_triangle 38 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/set_smp_4_group_types.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module set_smp_4_group_types 3 | ! 4 | ! Written by H. Matsui on Dec., 2008 5 | ! 6 | ! subroutine count_num_groups_type_smp(group) 7 | ! type(mesh_groups), intent(inout) :: group 8 | ! 9 | module set_smp_4_group_types 10 | ! 11 | use m_precision 12 | ! 13 | use m_machine_parameter 14 | ! 15 | implicit none 16 | ! 17 | !----------------------------------------------------------------------- 18 | ! 19 | contains 20 | ! 21 | !----------------------------------------------------------------------- 22 | ! 23 | subroutine count_num_groups_type_smp(group) 24 | ! 25 | use t_mesh_data 26 | use cal_minmax_and_stacks 27 | ! 28 | type(mesh_groups), intent(inout) :: group 29 | ! 30 | ! 31 | call count_grp_type_smp(group%nod_grp) 32 | call count_grp_type_smp(group%ele_grp) 33 | call count_surf_grp_type_smp(group%surf_grp) 34 | ! 35 | end subroutine count_num_groups_type_smp 36 | ! 37 | !----------------------------------------------------------------------- 38 | !----------------------------------------------------------------------- 39 | ! 40 | subroutine count_grp_type_smp(grp) 41 | ! 42 | use t_group_data 43 | use cal_minmax_and_stacks 44 | ! 45 | type(group_data), intent(inout) :: grp 46 | ! 47 | ! 48 | grp%num_grp_smp = np_smp * grp%num_grp 49 | ! 50 | call allocate_grp_type_smp(grp) 51 | ! 52 | call set_group_size_4_smp(np_smp, grp%num_grp, grp%istack_grp, & 53 | & grp%istack_grp_smp, grp%max_grp_smp) 54 | ! 55 | end subroutine count_grp_type_smp 56 | ! 57 | !----------------------------------------------------------------------- 58 | ! 59 | subroutine count_surf_grp_type_smp(sf_grp) 60 | ! 61 | use t_group_data 62 | use cal_minmax_and_stacks 63 | ! 64 | type(surface_group_data), intent(inout) :: sf_grp 65 | ! 66 | ! 67 | sf_grp%num_grp_smp = np_smp * sf_grp%num_grp 68 | ! 69 | call allocate_sf_grp_type_smp(sf_grp) 70 | ! 71 | call set_group_size_4_smp(np_smp, & 72 | & sf_grp%num_grp, sf_grp%istack_grp, & 73 | & sf_grp%istack_grp_smp, sf_grp%max_grp_smp) 74 | ! 75 | end subroutine count_surf_grp_type_smp 76 | ! 77 | !----------------------------------------------------------------------- 78 | ! 79 | end module set_smp_4_group_types 80 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/MESH/set_surface_id_4_surf_grp.f90: -------------------------------------------------------------------------------- 1 | !set_surface_id_4_surf_grp.f90 2 | ! module set_surface_id_4_surf_grp 3 | ! 4 | ! Writteg by H.Matsui on Aug., 2006 5 | ! 6 | !> @brief set surface ID for surface group items 7 | ! 8 | ! subroutine set_surface_id_4_surf_group(numele, isf_4_ele, & 9 | ! & num_surf, num_surf_bc, surf_istack, surf_item, & 10 | ! & isurf_grp, isurf_grp_n) 11 | ! 12 | module set_surface_id_4_surf_grp 13 | ! 14 | use m_precision 15 | use m_constants 16 | ! 17 | implicit none 18 | ! 19 | !------------------------------------------------------------------ 20 | ! 21 | contains 22 | ! 23 | !------------------------------------------------------------------ 24 | ! 25 | subroutine set_surface_id_4_surf_group(numele, isf_4_ele, & 26 | & num_surf, num_surf_bc, surf_istack, surf_item, & 27 | & isurf_grp, isurf_grp_n) 28 | ! 29 | use m_geometry_constants 30 | ! 31 | integer(kind = kint), intent(in) :: numele 32 | integer(kind = kint), intent(in) :: isf_4_ele(numele,nsurf_4_ele) 33 | integer(kind = kint), intent(in) :: num_surf, num_surf_bc 34 | integer(kind = kint), intent(in) :: surf_istack(0:num_surf) 35 | integer(kind = kint), intent(in) :: surf_item(2,num_surf_bc) 36 | ! 37 | integer(kind = kint), intent(inout) :: isurf_grp(num_surf_bc) 38 | integer(kind = kint), intent(inout) :: isurf_grp_n(num_surf_bc) 39 | ! 40 | integer(kind = kint) :: i_grp 41 | integer(kind = kint) :: inum, ist, ied, iele, isf, isf_n 42 | ! 43 | ! 44 | do i_grp = 1, num_surf 45 | ist = surf_istack(i_grp-1) + 1 46 | ied = surf_istack(i_grp) 47 | do inum = ist, ied 48 | iele = surf_item(1,inum) 49 | isf = surf_item(2,inum) 50 | isf_n = (isf - mod(isf-ione,itwo)) + mod(isf,itwo) 51 | ! 52 | isurf_grp(inum) = isf_4_ele(iele,isf) 53 | isurf_grp_n(inum) = isf_4_ele(iele,isf_n) 54 | end do 55 | end do 56 | ! 57 | end subroutine set_surface_id_4_surf_group 58 | ! 59 | !----------------------------------------------------------------------- 60 | ! 61 | end module set_surface_id_4_surf_grp 62 | -------------------------------------------------------------------------------- /src/Fortran_libraries/UTILS_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | UTILS_SRCDIR = $$(F_SRCDIR)/UTILS_src 6 | 7 | LIB_UTILS = -lcalypso_utils 8 | LIB_UTILS_FILE = libcalypso_utils.a 9 | 10 | SUBDIRS = \ 11 | MESH \ 12 | MERGE 13 | 14 | 15 | # 16 | # ------------------------------------------------------------------------- 17 | # 18 | 19 | dir_list: 20 | @echo 'UTILS_SRCDIR = $(UTILS_SRCDIR)' >> $(MAKENAME) 21 | @echo '#' >> $(MAKENAME) 22 | @for dir in $(SUBDIRS); do \ 23 | ( \ 24 | echo 'generate diectory list for ' $$dir ; \ 25 | cd $${dir}; \ 26 | $(GMAKE) \ 27 | GMAKE='$(GMAKE)' \ 28 | MAKENAME='$(MAKENAME)' \ 29 | dir_list \ 30 | ) \ 31 | done 32 | 33 | lib_name: 34 | @echo 'LIB_UTILS = $(LIB_UTILS)' >> $(MAKENAME) 35 | @echo 'LIB_UTILS_FILE = $(LIB_UTILS_FILE)' >> $(MAKENAME) 36 | @echo '#' >> $(MAKENAME) 37 | @for dir in $(SUBDIRS); do \ 38 | ( cd $${dir}; \ 39 | echo 'generate library list for ' $$dir ; \ 40 | $(GMAKE) \ 41 | GMAKE='$(GMAKE)' \ 42 | MAKEDIR='$(MAKEDIR)' \ 43 | MAKENAME='$(MAKENAME)' \ 44 | lib_name; \ 45 | ) \ 46 | done 47 | 48 | lib_tasks: libtarget lib_archve 49 | @echo ' ''$$(RANLIB) $$@' >> $(MAKENAME) 50 | @echo '#' >> $(MAKENAME) 51 | 52 | libtarget: 53 | @echo '' >> $(MAKENAME) 54 | @echo '$$(LIB_UTILS_FILE): $$(MOD_KEMO_UTILS)'>> $(MAKENAME) 55 | 56 | lib_archve: 57 | @for dir in $(SUBDIRS); do \ 58 | ( cd $${dir}; \ 59 | $(GMAKE) \ 60 | GMAKE='$(GMAKE)' \ 61 | MAKENAME='$(MAKENAME)' \ 62 | lib_archve; \ 63 | ) \ 64 | done 65 | 66 | mod_list: 67 | @echo '' >> $(MAKENAME) 68 | @echo MOD_KEMO_UTILS= \\ >> $(MAKENAME) 69 | @echo \ 70 | '$$(MOD_MESH)' \ 71 | '$$(MOD_MERGE)' >> $(MAKENAME) 72 | @echo '' >> $(MAKENAME) 73 | @for dir in $(SUBDIRS); do \ 74 | ( cd $${dir}; \ 75 | $(GMAKE) \ 76 | GMAKE='$(GMAKE)' \ 77 | MAKENAME='$(MAKENAME)' \ 78 | mod_list; \ 79 | ) \ 80 | done 81 | 82 | 83 | module: 84 | @echo '' >> $(MAKENAME) 85 | @for dir in $(SUBDIRS); do \ 86 | ( cd $${dir}; \ 87 | $(GMAKE) \ 88 | GMAKE='$(GMAKE)' \ 89 | MAKE_MOD_DEP='$(MAKE_MOD_DEP)' \ 90 | MAKENAME='$(MAKENAME)' \ 91 | module; \ 92 | ) \ 93 | done 94 | 95 | 96 | clean: 97 | @for dir in $(SUBDIRS); do \ 98 | ( cd $${dir}; \ 99 | $(GMAKE) \ 100 | GMAKE='$(GMAKE)' \ 101 | clean \ 102 | ) \ 103 | done 104 | 105 | rm -f *.o *.mod *~ *.par *.diag *.a 106 | -------------------------------------------------------------------------------- /src/Fortran_libraries/VIZ_src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | LIB_VIZ = -lkemo_viz 6 | LIB_VIZ_FILE = libkemo_viz.a 7 | 8 | SUBDIRS = \ 9 | surfacing 10 | 11 | # 12 | # ------------------------------------------------------------------------- 13 | # 14 | 15 | dir_list: 16 | @echo 'VIZ_SRCDIR = $$(F_SRCDIR)/VIZ_src' >> $(MAKENAME) 17 | @echo '#' >> $(MAKENAME) 18 | @for dir in $(SUBDIRS) ; do \ 19 | ( \ 20 | echo 'generate diectory list for ' $$dir ; \ 21 | cd $${dir}; \ 22 | $(GMAKE) \ 23 | GMAKE='$(GMAKE)' \ 24 | MAKEDIR='$(MAKEDIR)' \ 25 | MAKENAME='$(MAKENAME)' \ 26 | dir_list \ 27 | ) \ 28 | done 29 | @echo '#' >> $(MAKENAME) 30 | 31 | lib_name: 32 | @echo 'LIB_VIZ = $(LIB_VIZ)' >> $(MAKENAME) 33 | @echo 'LIB_VIZ_FILE = $(LIB_VIZ_FILE)' >> $(MAKENAME) 34 | @echo >> $(MAKENAME) 35 | 36 | lib_tasks: libtarget lib_archve 37 | @echo ' ''$$(RANLIB) $$@' >> $(MAKENAME) 38 | 39 | libtarget: 40 | @echo '' >> $(MAKENAME) 41 | @echo '$$(LIB_VIZ_FILE): $$(MOD_VIZ)' >> $(MAKENAME) 42 | 43 | lib_archve: 44 | @for dir in $(SUBDIRS); do \ 45 | ( cd $${dir}; \ 46 | $(GMAKE) \ 47 | GMAKE='$(GMAKE)' \ 48 | MAKENAME='$(MAKENAME)' \ 49 | lib_archve \ 50 | ) \ 51 | done; 52 | 53 | mod_list: 54 | @echo MOD_VIZ= \\ >> $(MAKENAME) 55 | @echo '$$(MOD_SURFACING)' \\ >> $(MAKENAME) 56 | @echo >> $(MAKENAME) 57 | 58 | @for dir in $(SUBDIRS); do \ 59 | ( cd $${dir}; \ 60 | $(GMAKE) \ 61 | GMAKE='$(GMAKE)' \ 62 | MAKENAME='$(MAKENAME)' \ 63 | mod_list \ 64 | ) \ 65 | done 66 | 67 | 68 | module: 69 | @for dir in $(SUBDIRS); do \ 70 | ( cd $${dir}; \ 71 | $(GMAKE) \ 72 | GMAKE='$(GMAKE)' \ 73 | MAKE_MOD_DEP='$(MAKE_MOD_DEP)' \ 74 | MAKENAME='$(MAKENAME)' \ 75 | module \ 76 | ) \ 77 | done 78 | 79 | 80 | clean: 81 | @for dir in $(SUBDIRS); do \ 82 | ( cd $${dir}; \ 83 | $(GMAKE) \ 84 | GMAKE='$(GMAKE)' \ 85 | clean \ 86 | ) \ 87 | done 88 | 89 | rm -f *.o *.mod *~ *.par *.diag *.a 90 | -------------------------------------------------------------------------------- /src/Fortran_libraries/VIZ_src/surfacing/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | PSF_SECTION_DIR = $$(VIZ_SRCDIR)/surfacing 6 | SRC_SURFACING = $(shell ls *.f90) 7 | MOD_SURFACING = $(addsuffix .o,$(basename $(SRC_SURFACING)) ) 8 | 9 | # 10 | # -------------------------------------------------------------------- 11 | # 12 | 13 | dir_list: 14 | @echo 'PSF_SECTION_DIR = $(PSF_SECTION_DIR)' >> $(MAKENAME) 15 | 16 | lib_name: 17 | 18 | lib_tasks: libtarget lib_archve 19 | @echo ' ''$$(RANLIB) $$@' >> $(MAKENAME) 20 | 21 | libtarget: 22 | 23 | lib_archve: 24 | @echo ' ''$$(AR)' '$$(ARFLUGS)' rcsv '$$@' '$$(MOD_SURFACING)' \ 25 | >> $(MAKENAME) 26 | 27 | 28 | mod_list: 29 | @echo MOD_SURFACING= \\ >> $(MAKENAME) 30 | @echo $(MOD_SURFACING) >> $(MAKENAME) 31 | @echo >> $(MAKENAME) 32 | 33 | 34 | module: 35 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(PSF_SECTION_DIR)' $(SRC_SURFACING) 36 | 37 | clean: 38 | rm -f *.o *.mod *~ *.par *.diag *.a 39 | -------------------------------------------------------------------------------- /src/Fortran_libraries/VIZ_src/surfacing/m_intersection_data_0.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_intersection_data_0 3 | ! 4 | module m_intersection_data_0 5 | ! 6 | ! Written by H. Matsui on june, 2006 7 | ! 8 | use m_precision 9 | ! 10 | implicit none 11 | ! 12 | ! 12345678: boundary...3 of 12 13 | ! 0: 00000000: none : none 14 | ! 15 | ! 12345678: boundary...3 of 12 16 | ! 255: 11111111: none : none 17 | ! 18 | integer(kind = kint), parameter :: nkind_etype_0 = 2 19 | integer(kind = kint), parameter & 20 | & :: iflag_psf_etype_0(2) = (/0, 255/) 21 | ! 22 | integer(kind = kint), parameter :: num_triangle_0 = 0 23 | integer(kind = kint), parameter :: num_patch_0 = 0 24 | ! 25 | integer(kind = kint), parameter & 26 | & :: iedge_4_patch_0(1,1) = reshape( (/0/), shape=(/1,1/)) 27 | ! 28 | end module m_intersection_data_0 29 | -------------------------------------------------------------------------------- /src/Fortran_libraries/VIZ_src/surfacing/m_intersection_data_13.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_intersection_data_13 3 | ! 4 | module m_intersection_data_13 5 | ! 6 | ! Written by H. Matsui on june, 2006 7 | ! 8 | use m_precision 9 | ! 10 | implicit none 11 | ! 12 | ! 13 | ! 4 nodes which have differrent sign remote each other 14 | ! (cover negative markers 4 triangles) 15 | ! 16 | ! flag = 1: c-c_ref >= 0 17 | ! flag = 1: c-c_ref < 0 18 | ! 19 | ! 12345678: boundary..all(12): 4triangles 20 | ! 165: 10100101: 3-4,4-8,4-1; 1-2,2-6,2-3; 1-5,8-5,5-6; 6-7,7-8,3-7 21 | ! 3-12-4, 1-10-2, 9-8-5, 6-7-11 22 | ! 90: 01011010: 1-2,4-1,1-5; 5-6,6-7,2-6; 3-4,2-3,3-7; 4-8,7-8,8-5 23 | ! 1-4-9, 5-6-10, 3-2-11, 12-7-8 24 | ! 25 | integer(kind = kint), parameter, private :: nnod_tri = 3 26 | ! 27 | integer(kind = kint), parameter :: nkind_etype_13 = 2 28 | integer(kind = kint), parameter :: num_tri_13 = 4 29 | integer(kind = kint), parameter :: num_patch_13 = 4 30 | integer(kind = kint), parameter :: itri_2_patch_13(3) & 31 | & = (/1, 2, 3/) 32 | ! 33 | integer(kind = kint), parameter & 34 | & :: iflag_psf_etype_13(nkind_etype_13) = (/165, 90/) 35 | ! 36 | integer(kind = kint), parameter & 37 | & :: iedge_tri_13(nnod_tri,num_tri_13,nkind_etype_13) & 38 | & = reshape( & 39 | & (/ 3, 12, 4, 1, 10, 2, 9, 8, 5, 6, 7, 11, & 40 | 1, 4, 9, 5, 6, 10, 3, 2, 11, 12, 7, 8/), & 41 | & shape=(/nnod_tri,num_tri_13,nkind_etype_13/) ) 42 | ! 43 | integer(kind = kint), parameter & 44 | & :: iedge_4_patch_13(nnod_tri,num_patch_13,nkind_etype_13) & 45 | & = reshape( & 46 | & (/ 3, 12, 4, 1, 10, 2, 9, 8, 5, 6, 7, 11, & 47 | 1, 4, 9, 5, 6, 10, 3, 2, 11, 12, 7, 8/), & 48 | & shape=(/nnod_tri,num_patch_13,nkind_etype_13/) ) 49 | ! 50 | end module m_intersection_data_13 51 | -------------------------------------------------------------------------------- /src/Fortran_libraries/VIZ_src/surfacing/m_intersection_data_8.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_intersection_data_8 3 | ! 4 | module m_intersection_data_8 5 | ! 6 | ! Written by H. Matsui on june, 2006 7 | ! 8 | use m_precision 9 | ! 10 | implicit none 11 | ! 12 | ! 13 | ! 4 nodes which have differrent sign on a surface 14 | ! (one quad ... 2 triangles) 15 | ! 16 | ! flag = 1: c-c_ref >= 0 17 | ! flag = 1: c-c_ref < 0 18 | ! 19 | ! 12345678: boundary...4 of 12: quad: (2-3-1), (1-3-4) 20 | ! 153: 10011001: 1-2, 5-6, 7-8, 3-4: 1-5-7-3; 5-7-1, 1-7-3 21 | ! 102: 01100110: 1-2, 3-4, 7-8, 5-6: 1-3-7-5: 3-7-1, 1-7-5 22 | ! 51: 11001100: 4-1, 2-3, 6-7, 8-5: 4-2-6-8: 2-6-4, 4-6-8 23 | ! 204: 00110011: 4-1, 8-5, 6-7, 2-3: 4-8-6-2; 8-6-4, 4-6-2 24 | ! 15: 11110000: 1-5, 4-8, 3-7, 2-6: 9-12-11-10: 12-11-9, 9-11-10 25 | ! 240: 00001111: 1-5, 2-6, 3-7, 4-8: 9-10-11-12; 10-11-9, 9-11-12 26 | ! 27 | integer(kind = kint), parameter, private :: nnod_tri = 3 28 | integer(kind = kint), parameter, private :: nnod_quad = 4 29 | ! 30 | integer(kind = kint), parameter :: nkind_etype_8 = 6 31 | integer(kind = kint), parameter :: num_patch_8 = 2 32 | integer(kind = kint), parameter :: itri_2_patch_8(6) & 33 | & = (/2, 3, 1, 1, 3, 4/) 34 | ! 35 | integer(kind = kint), parameter & 36 | & :: iflag_psf_etype_8(nkind_etype_8) & 37 | & = (/153, 102, 51, 204, 15, 240/) 38 | ! 39 | ! 40 | integer(kind = kint), parameter & 41 | & :: iedge_quad_8(nnod_quad, nkind_etype_8) & 42 | & = reshape( & 43 | & (/1, 5, 7, 3, 1, 3, 7, 5, 4, 2, 6, 8, & 44 | & 4, 8, 6, 2, 9, 12, 11, 10, 9, 10, 11, 12/), & 45 | & shape=(/nnod_quad, nkind_etype_8/) ) 46 | ! 47 | integer(kind = kint), parameter & 48 | & :: iedge_4_patch_8(nnod_tri,num_patch_8,nkind_etype_8) & 49 | & = reshape( & 50 | & (/ 5, 7, 1, 1, 7, 3, 3, 7, 1, 1, 7, 5, & 51 | & 2, 6, 4, 4, 6, 8, 8, 6, 4, 4, 6, 2, & 52 | & 12, 11, 9, 9, 11, 10, 10, 11, 9, 9, 11, 12/), & 53 | & shape=(/nnod_tri,num_patch_8,nkind_etype_8/) ) 54 | ! 55 | end module m_intersection_data_8 56 | 57 | -------------------------------------------------------------------------------- /src/Fortran_libraries/VIZ_src/surfacing/m_mpi_flags_4_section.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! module m_mpi_flags_4_section 3 | !....................................................................... 4 | ! 5 | ! Writen by H. Matsui on July., 2006 6 | ! 7 | ! subroutine allocate_flags_4_comm_psf 8 | ! subroutine deallocate_flags_4_comm_psf 9 | ! 10 | module m_mpi_flags_4_section 11 | ! 12 | use m_precision 13 | ! 14 | implicit none 15 | ! 16 | ! 17 | integer, save, allocatable :: sta1_psf(:,:) 18 | ! work array for communication (wait) 19 | integer, save, allocatable :: sta2_psf(:,:) 20 | ! work array for communication (wait) 21 | integer, save, allocatable :: req1_psf(: ) 22 | ! work array for communication (wait) 23 | integer, save, allocatable :: req2_psf(: ) 24 | ! work array for communication (wait) 25 | ! 26 | ! ---------------------------------------------------------------------- 27 | ! 28 | contains 29 | ! 30 | ! ---------------------------------------------------------------------- 31 | ! 32 | subroutine allocate_flags_4_comm_psf 33 | ! 34 | use calypso_mpi 35 | ! 36 | ! 37 | allocate (sta1_psf(MPI_STATUS_SIZE,nprocs)) 38 | allocate (sta2_psf(MPI_STATUS_SIZE,nprocs)) 39 | allocate (req1_psf(nprocs)) 40 | allocate (req2_psf(nprocs)) 41 | ! 42 | end subroutine allocate_flags_4_comm_psf 43 | ! 44 | ! ---------------------------------------------------------------------- 45 | ! 46 | subroutine deallocate_flags_4_comm_psf 47 | ! 48 | deallocate (sta1_psf) 49 | deallocate (sta2_psf) 50 | deallocate (req1_psf) 51 | deallocate (req2_psf) 52 | ! 53 | end subroutine deallocate_flags_4_comm_psf 54 | ! 55 | ! ---------------------------------------------------------------------- 56 | ! 57 | end module m_mpi_flags_4_section 58 | -------------------------------------------------------------------------------- /src/cmake/Modules/FindFFTW.cmake: -------------------------------------------------------------------------------- 1 | # - Find FFTW 2 | # Find the native FFTW includes and library 3 | # 4 | # FFTW_INCLUDES - where to find fftw3.h 5 | # FFTW_LIBRARIES - List of libraries when using FFTW. 6 | # FFTW_FOUND - True if FFTW found. 7 | 8 | if (FFTW_INCLUDES) 9 | # Already in cache, be silent 10 | set (FFTW_FIND_QUIETLY TRUE) 11 | endif (FFTW_INCLUDES) 12 | 13 | find_path (FFTW_INCLUDES fftw3.h) 14 | 15 | find_library (FFTW_LIBRARIES NAMES fftw3) 16 | 17 | # handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if 18 | # all listed variables are TRUE 19 | include (FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args (FFTW DEFAULT_MSG FFTW_LIBRARIES FFTW_INCLUDES) 21 | 22 | mark_as_advanced (FFTW_LIBRARIES FFTW_INCLUDES) 23 | -------------------------------------------------------------------------------- /src/cmake/Modules/LICENSE.txt: -------------------------------------------------------------------------------- 1 | FindOpenMP_Fortran.cmake from: 2 | 3 | https://github.com/SethMMorton/cmake_fortran_template 4 | 5 | FindFFTW.cmake from: 6 | https://github.com/jedbrown/cmake-modules 7 | 8 | Copyright $(git shortlog -s) 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without modification, 12 | are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright notice, this 15 | list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright notice, this 18 | list of conditions and the following disclaimer in the documentation and/or 19 | other materials provided with the distribution. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /src/programs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY (SPH_MHD) 2 | ADD_SUBDIRECTORY (data_utilities) 3 | ADD_SUBDIRECTORY (mesh_utilities) 4 | 5 | -------------------------------------------------------------------------------- /src/programs/SPH_MHD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE(sph_mhd main_sph_MHD_w_psf.f90 analyzer_sph_MHD_w_psf.f90 SPH_analyzer_MHD.f90) 2 | TARGET_LINK_LIBRARIES(sph_mhd calypso fftpack.5d) 3 | 4 | -------------------------------------------------------------------------------- /src/programs/SPH_MHD/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SPH_MHD_MAINDIR = $$(PROG_DIR)/SPH_MHD 6 | 7 | TARGET_SPH_MHD = sph_mhd 8 | 9 | SOURCES = $(shell ls *.f90) 10 | 11 | MOD_SPH_MHD_MAIN = \ 12 | main_sph_MHD_w_psf.o \ 13 | analyzer_sph_MHD_w_psf.o \ 14 | SPH_analyzer_MHD.o 15 | 16 | # 17 | # ------------------------------------------------------------------------- 18 | # 19 | 20 | dir_list: 21 | @echo 'SPH_MHD_MAINDIR = $(SPH_MHD_MAINDIR)' >> $(MAKENAME) 22 | 23 | target_list: 24 | @echo 'TARGET_SPH_MHD = $$(BUILDDIR)/$(TARGET_SPH_MHD)' >> $(MAKENAME) 25 | @echo >> $(MAKENAME) 26 | 27 | target_task: 28 | @echo sph_mhd: \ 29 | '$$(TARGET_SPH_MHD)' >> $(MAKENAME) 30 | @echo '' >> $(MAKENAME) 31 | @echo '$$(TARGET_SPH_MHD): $$(MOD_SPH_MHD_MAIN) $$(LIB_FILES_SPH_MHD)' \ 32 | >> $(MAKENAME) 33 | @echo ' ''$$(F90)' '$$(F90FLAGS)' -o '$$(TARGET_SPH_MHD)' '$$(MOD_SPH_MHD_MAIN)' \ 34 | '-L. $$(LIBS_SPH_MHD) $$(F90LIBS)' >> $(MAKENAME) 35 | @echo '' >> $(MAKENAME) 36 | 37 | 38 | lib_name: 39 | 40 | mod_list: 41 | @echo MOD_SPH_MHD_MAIN= \\ >> $(MAKENAME) 42 | @echo $(MOD_SPH_MHD_MAIN) >> $(MAKENAME) 43 | @echo '#' >> $(MAKENAME) 44 | 45 | 46 | module: 47 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(SPH_MHD_MAINDIR)' $(SOURCES) 48 | 49 | clean: 50 | rm -f *.o *~ *.mod *.diag *.L 51 | -------------------------------------------------------------------------------- /src/programs/SPH_MHD/main_sph_MHD_w_psf.f90: -------------------------------------------------------------------------------- 1 | !>@file main_sph_MHD_w_psf.f90 2 | !!@brief program kemorin_sph_MHD 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Okuda in 2000 6 | !!@n Modified by H. Matsui in May, 2003 (ver 2.0) 7 | !!@n Connect to vizs by H. Matsui in July 2006 (ver 2.0) 8 | ! 9 | !>@brief Main program for MHD dynamo simulation 10 | ! 11 | program kemorin_sph_MHD 12 | ! 13 | use m_precision 14 | ! 15 | use calypso_mpi 16 | use analyzer_sph_MHD_w_psf 17 | ! 18 | implicit none 19 | ! 20 | ! 21 | call calypso_MPI_init 22 | ! 23 | call initialize_sph_mhd_w_psf 24 | ! 25 | call evolution_sph_mhd_w_psf 26 | ! 27 | call calypso_MPI_finalize 28 | ! 29 | stop 30 | end program kemorin_sph_MHD 31 | -------------------------------------------------------------------------------- /src/programs/data_utilities/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB ASSEMBLE_SPH_SRC_FILES MERGE/*.[fF]90) 2 | ADD_EXECUTABLE(assemble_sph ${ASSEMBLE_SPH_SRC_FILES}) 3 | TARGET_LINK_LIBRARIES(assemble_sph calypso) 4 | 5 | SET(MOD_SPH_SNAP_MAIN_SRC_FILES SNAPSHOT_MHD/main_sph_snapshot_w_psf.f90 SNAPSHOT_MHD/SPH_analyzer_snap.f90 SNAPSHOT_MHD/analyzer_sph_snap_w_psf.f90) 6 | ADD_EXECUTABLE(sph_snapshot ${MOD_SPH_SNAP_MAIN_SRC_FILES}) 7 | TARGET_LINK_LIBRARIES(sph_snapshot calypso fftpack.5d) 8 | 9 | SET(MOD_SPH_ZM_SNAP_MAIN_SRC_FILES SNAPSHOT_MHD/main_sph_zm_snap.f90 SNAPSHOT_MHD/analyzer_sph_zm_snap.f90 SNAPSHOT_MHD/SPH_analyzer_snap.f90 SNAPSHOT_MHD/SPH_analyzer_zm_snap.f90) 10 | ADD_EXECUTABLE(sph_zm_snapshot ${MOD_SPH_ZM_SNAP_MAIN_SRC_FILES}) 11 | TARGET_LINK_LIBRARIES(sph_zm_snapshot calypso fftpack.5d) 12 | 13 | SET(MOD_SPH_D_BENCH_MAIN_SRC_FILES SNAPSHOT_MHD/main_sph_dynamobench.f90 SNAPSHOT_MHD/analyzer_sph_dynamobench.f90 SNAPSHOT_MHD/SPH_analyzer_d_bench.f90) 14 | ADD_EXECUTABLE(sph_dynamobench ${MOD_SPH_D_BENCH_MAIN_SRC_FILES}) 15 | TARGET_LINK_LIBRARIES(sph_dynamobench calypso fftpack.5d) 16 | 17 | SET(MOD_SPH_INITIAL INITIAL_FIELD/main_sph_initial_fld.f90 INITIAL_FIELD/SPH_analyzer_add_initial.f90 INITIAL_FIELD/SPH_analyzer_const_initial.f90 INITIAL_FIELD/const_sph_initial_spectr.f90) 18 | ADD_EXECUTABLE(sph_initial_field ${MOD_SPH_INITIAL}) 19 | TARGET_LINK_LIBRARIES(sph_initial_field calypso fftpack.5d) 20 | 21 | SET(SPH_ENE_CHECK_SRC_FILES TIME_HISTORIES/compare_sph_mean_square.f90) 22 | ADD_EXECUTABLE(sph_ene_check ${SPH_ENE_CHECK_SRC_FILES}) 23 | TARGET_LINK_LIBRARIES(sph_ene_check calypso fftpack.5d) 24 | -------------------------------------------------------------------------------- /src/programs/data_utilities/INITIAL_FIELD/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | INIT_SPECTR_DIR = $$(DATA_UTILS_DIR)/INITIAL_FIELD 6 | 7 | TARGET_SPH_INITIAL = sph_initial_field 8 | TARGET_SPH_ADD_INIT = sph_add_initial_field 9 | 10 | SOURCES = $(shell ls *.f90) 11 | 12 | MOD_SPH_INITIAL = \ 13 | main_sph_initial_fld.o \ 14 | SPH_analyzer_const_initial.o \ 15 | const_sph_initial_spectr.o 16 | 17 | MOD_SPH_ADD_INIT = \ 18 | main_sph_add_initial_fld.o \ 19 | SPH_analyzer_add_initial.o \ 20 | const_sph_initial_spectr.o 21 | 22 | 23 | # 24 | # ------------------------------------------------------------------------- 25 | # 26 | 27 | dir_list: 28 | @echo 'INIT_SPECTR_DIR = $(INIT_SPECTR_DIR)' >> $(MAKENAME) 29 | 30 | target_list: 31 | @echo 'TARGET_SPH_INITIAL = $$(BUILDDIR)/$(TARGET_SPH_INITIAL)'>> $(MAKENAME) 32 | @echo 'TARGET_SPH_ADD_INIT = $$(BUILDDIR)/$(TARGET_SPH_ADD_INIT)' >> $(MAKENAME) 33 | @echo >> $(MAKENAME) 34 | 35 | target_task: 36 | @echo sph_initial: \ 37 | '$$(TARGET_SPH_INITIAL)' \ 38 | '$$(TARGET_SPH_ADD_INIT)' >> $(MAKENAME) 39 | @echo '' >> $(MAKENAME) 40 | 41 | @echo '$$(TARGET_SPH_INITIAL): $$(MOD_SPH_INITIAL) $$(LIB_FILES_SPH_MHD)' \ 42 | >> $(MAKENAME) 43 | @echo ' ''$$(F90)' '$$(F90FLAGS)' -o '$$(TARGET_SPH_INITIAL)' '$$(MOD_SPH_INITIAL)' \ 44 | '-L. $$(LIBS_SPH_MHD) $$(F90LIBS)' >> $(MAKENAME) 45 | @echo '' >> $(MAKENAME) 46 | 47 | @echo '$$(TARGET_SPH_ADD_INIT): $$(MOD_SPH_ADD_INIT) $$(LIB_FILES_SPH_MHD)' \ 48 | >> $(MAKENAME) 49 | @echo ' ''$$(F90)' '$$(F90FLAGS)' -o '$$(TARGET_SPH_ADD_INIT)' '$$(MOD_SPH_ADD_INIT)' \ 50 | '-L. $$(LIBS_SPH_MHD) $$(F90LIBS)' >> $(MAKENAME) 51 | @echo '' >> $(MAKENAME) 52 | 53 | 54 | lib_name: 55 | 56 | mod_list: 57 | @echo MOD_SPH_INITIAL= \\ >> $(MAKENAME) 58 | @echo $(MOD_SPH_INITIAL) >> $(MAKENAME) 59 | @echo MOD_SPH_ADD_INIT= \\ >> $(MAKENAME) 60 | @echo $(MOD_SPH_ADD_INIT) >> $(MAKENAME) 61 | @echo '#' >> $(MAKENAME) 62 | 63 | 64 | module: 65 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(INIT_SPECTR_DIR)' $(SOURCES) 66 | 67 | clean: 68 | rm -f *.o *~ *.mod *.diag *.L 69 | -------------------------------------------------------------------------------- /src/programs/data_utilities/INITIAL_FIELD/main_sph_add_initial_fld.f90: -------------------------------------------------------------------------------- 1 | !>@file main_sph_add_initial_fld.f90 2 | !!@brief program sph_add_initial 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Matsui in Jan., 2014 6 | ! 7 | !>@brief Main program to add initial field to existing initial field 8 | !!@n Define initial field at const_sph_initial_spectr.f90 9 | ! 10 | program sph_add_initial 11 | ! 12 | use m_precision 13 | ! 14 | use calypso_mpi 15 | use SPH_analyzer_add_initial 16 | ! 17 | implicit none 18 | ! 19 | ! 20 | call calypso_MPI_init 21 | ! 22 | call initialize_add_sph_initial 23 | ! 24 | call calypso_MPI_finalize 25 | ! 26 | stop 27 | end program sph_add_initial 28 | -------------------------------------------------------------------------------- /src/programs/data_utilities/INITIAL_FIELD/main_sph_initial_fld.f90: -------------------------------------------------------------------------------- 1 | !>@file main_sph_initial_fld.f90 2 | !!@brief program sph_meke_initial 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Okuda in 2000 6 | !!@n Modified by H. Matsui in May, 2003 (ver 2.0) 7 | !!@n Connect to vizs by H. Matsui in July 2006 (ver 2.0) 8 | ! 9 | !>@brief Main program to generate initial field 10 | !!@n Define initial field at const_sph_initial_spectr.f90 11 | ! 12 | program sph_meke_initial 13 | ! 14 | use m_precision 15 | ! 16 | use calypso_mpi 17 | use SPH_analyzer_const_initial 18 | ! 19 | implicit none 20 | ! 21 | ! 22 | call calypso_MPI_init 23 | ! 24 | call initialize_const_sph_initial 25 | ! 26 | call calypso_MPI_finalize 27 | ! 28 | stop 29 | end program sph_meke_initial 30 | -------------------------------------------------------------------------------- /src/programs/data_utilities/MERGE/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | MERGE_SRCDIR = $$(DATA_UTILS_DIR)/MERGE 6 | 7 | TARGET_NEWSPH = assemble_sph 8 | 9 | SOURCES = $(shell ls *.f90) 10 | 11 | MOD_NEWSPH = \ 12 | main_assemble_sph.o \ 13 | analyzer_assemble_sph.o 14 | 15 | # 16 | # ------------------------------------------------------------------------- 17 | # 18 | 19 | dir_list: 20 | @echo 'MERGE_SRCDIR = $(MERGE_SRCDIR)' >> $(MAKENAME) 21 | 22 | target_list: 23 | @echo 'TARGET_NEWSPH = $$(BUILDDIR)/$(TARGET_NEWSPH)' >> $(MAKENAME) 24 | @echo >> $(MAKENAME) 25 | 26 | target_task: 27 | @echo assembles: \ 28 | '$$(TARGET_NEWSPH)' >> $(MAKENAME) 29 | @echo '' >> $(MAKENAME) 30 | @echo '$$(TARGET_NEWSPH)': '$$(MOD_NEWSPH)' \ 31 | '$$(LIB_CALYPSO_FILE)' \ 32 | >> $(MAKENAME) 33 | @echo ' ''$$(F90)' '$$(F90FLAGS)' -o '$$(TARGET_NEWSPH)' '$$(MOD_NEWSPH)' \ 34 | '-L. $$(LIB_CALYPSO)' \ 35 | '$$(F90LIBS)' >> $(MAKENAME) 36 | @echo '' >> $(MAKENAME) 37 | 38 | 39 | lib_name: 40 | 41 | mod_list: 42 | @echo MOD_NEWSPH= \\ >> $(MAKENAME) 43 | @echo $(MOD_NEWSPH) >> $(MAKENAME) 44 | @echo '#' >> $(MAKENAME) 45 | 46 | 47 | module: 48 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(MERGE_SRCDIR)' $(SOURCES) 49 | 50 | clean: 51 | rm -f *.o *~ *.mod *.diag *.L 52 | -------------------------------------------------------------------------------- /src/programs/data_utilities/MERGE/control_assemble_sph: -------------------------------------------------------------------------------- 1 | begin assemble_control 2 | ! 3 | begin data_files_def 4 | num_subdomain_ctl 2 5 | 6 | sph_file_prefix 'sph_lm31t48r96c_2/in' 7 | restart_file_prefix 'rst_2/rst' 8 | ! 9 | sph_file_fmt_ctl 'gzip' 10 | restart_file_fmt_ctl 'gzip' 11 | end data_files_def 12 | ! 13 | begin new_data_files_def 14 | num_new_domain_ctl 4 15 | ! 16 | new_sph_mode_prefix 'sph_lm31t48r96c_4/in' 17 | new_restart_prefix 'rst_4/rst' 18 | ! 19 | new_sph_files_fmt_ctl 'ascii' 20 | new_rst_files_fmt_ctl 'ascii' 21 | ! 22 | delete_original_data_flag 'YES' 23 | end new_data_files_def 24 | ! 25 | begin control 26 | !!!!! information for time integration 27 | begin time_step_ctl 28 | i_step_init_ctl 0 29 | i_step_number_ctl 2000 30 | i_step_rst_ctl 800 31 | end time_step_ctl 32 | end control 33 | ! 34 | begin newrst_magne_ctl 35 | magnetic_field_ratio_ctl 1.0d0 36 | end newrst_magne_ctl 37 | ! 38 | end assemble_control 39 | -------------------------------------------------------------------------------- /src/programs/data_utilities/MERGE/main_assemble_sph.f90: -------------------------------------------------------------------------------- 1 | !>@file main_assemble_sph.f90 2 | !!@brief program assemble_sph 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Matsui in July 2014 6 | ! 7 | !>@brief Main program for assemble spectr data 8 | ! 9 | program assemble_sph 10 | ! 11 | use m_precision 12 | ! 13 | use calypso_mpi 14 | use analyzer_assemble_sph 15 | ! 16 | implicit none 17 | ! 18 | ! 19 | call calypso_MPI_init 20 | ! 21 | call init_assemble_sph 22 | call analyze_assemble_sph 23 | ! 24 | call calypso_MPI_finalize 25 | ! 26 | write(*,*) '***** program finished *****' 27 | stop 28 | ! 29 | end program assemble_sph 30 | -------------------------------------------------------------------------------- /src/programs/data_utilities/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | SUBDIRS = \ 6 | MERGE \ 7 | INITIAL_FIELD \ 8 | SNAPSHOT_MHD \ 9 | TIME_HISTORIES 10 | 11 | 12 | # 13 | # ------------------------------------------------------------------------- 14 | # 15 | 16 | dir_list: 17 | @echo 'DATA_UTILS_DIR = $$(PROG_DIR)/data_utilities' >> $(MAKENAME) 18 | @echo '#' >> $(MAKENAME) 19 | @for dir in $(SUBDIRS); do \ 20 | ( \ 21 | echo 'generate diectory list for ' $$dir ; \ 22 | cd $${dir}; \ 23 | $(GMAKE) \ 24 | GMAKE='$(GMAKE)' \ 25 | MAKENAME='$(MAKENAME)' \ 26 | dir_list \ 27 | ) \ 28 | done 29 | @echo '#' >> $(MAKENAME) 30 | 31 | target_list: 32 | @for dir in $(SUBDIRS); do \ 33 | ( cd $${dir}; \ 34 | $(GMAKE) \ 35 | GMAKE='$(GMAKE)' \ 36 | BUILDDIR='$(BUILDDIR)' \ 37 | MAKENAME='$(MAKENAME)' \ 38 | target_list \ 39 | ) \ 40 | done 41 | 42 | target_task: 43 | @echo data_utils: \ 44 | assembles \ 45 | sph_snapshots \ 46 | sph_initial \ 47 | >> $(MAKENAME) 48 | @echo '' >> $(MAKENAME) 49 | @for dir in $(SUBDIRS); do \ 50 | ( cd $${dir}; \ 51 | $(GMAKE) \ 52 | GMAKE='$(GMAKE)' \ 53 | MAKENAME='$(MAKENAME)' \ 54 | target_task \ 55 | ) \ 56 | done 57 | 58 | 59 | lib_name: 60 | @for dir in $(SUBDIRS); do \ 61 | ( cd $${dir}; \ 62 | $(GMAKE) \ 63 | GMAKE='$(GMAKE)' \ 64 | MAKENAME='$(MAKENAME)' \ 65 | lib_name \ 66 | ) \ 67 | done 68 | 69 | mod_list: 70 | @for dir in $(SUBDIRS); do \ 71 | ( cd $${dir}; \ 72 | $(GMAKE) \ 73 | GMAKE='$(GMAKE)' \ 74 | MAKENAME='$(MAKENAME)' \ 75 | mod_list \ 76 | ) \ 77 | done 78 | 79 | 80 | module: 81 | @for dir in $(SUBDIRS); do \ 82 | ( cd $${dir}; \ 83 | $(GMAKE) \ 84 | GMAKE='$(GMAKE)' \ 85 | MAKENAME='$(MAKENAME)' \ 86 | module; \ 87 | ) \ 88 | done 89 | 90 | 91 | 92 | clean: 93 | @for dir in $(SUBDIRS); do \ 94 | ( cd $${dir}; \ 95 | $(GMAKE) \ 96 | GMAKE='$(GMAKE)' \ 97 | clean \ 98 | ) \ 99 | done 100 | 101 | rm -f *.o *.mod *~ *.par *.diag *.a 102 | -------------------------------------------------------------------------------- /src/programs/data_utilities/SNAPSHOT_MHD/main_sph_dynamobench.f90: -------------------------------------------------------------------------------- 1 | !>@file main_sph_dynamobench.f90 2 | !!@brief program sph_dynamobench 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Okuda in 2000 6 | !!@n Modified by H. Matsui in May, 2003 (ver 2.0) 7 | !!@n Connect to vizs by H. Matsui in July 2006 (ver 2.0) 8 | ! 9 | !> @brief Main program for dynamo benchmark check 10 | ! 11 | program sph_dynamobench 12 | ! 13 | use m_precision 14 | ! 15 | use calypso_mpi 16 | use analyzer_sph_dynamobench 17 | ! 18 | implicit none 19 | ! 20 | ! 21 | call calypso_MPI_init 22 | ! 23 | call initialize_sph_dynamobench 24 | ! 25 | call evolution_sph_dynamobench 26 | ! 27 | call calypso_MPI_finalize 28 | ! 29 | write(*,*) '***** program finished *****' 30 | stop 31 | ! 32 | end program sph_dynamobench 33 | -------------------------------------------------------------------------------- /src/programs/data_utilities/SNAPSHOT_MHD/main_sph_snapshot_w_psf.f90: -------------------------------------------------------------------------------- 1 | !>@file main_sph_snapshot_w_psf.f90 2 | !!@brief program sph_snapshot_w_psf 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Okuda in 2000 6 | !!@n Modified by H. Matsui in May, 2003 (ver 2.0) 7 | !!@n Connect to vizs by H. Matsui in July 2006 (ver 2.0) 8 | ! 9 | !>@brief Main program to evaluate snapshots from spectr data 10 | ! 11 | program sph_snapshot_w_psf 12 | ! 13 | use m_precision 14 | ! 15 | use calypso_mpi 16 | use analyzer_sph_snap_w_psf 17 | ! 18 | implicit none 19 | ! 20 | ! 21 | call calypso_MPI_init 22 | ! 23 | call initialize_sph_snap_w_psf 24 | ! 25 | call evolution_sph_snap_w_psf 26 | ! 27 | call calypso_MPI_finalize 28 | ! 29 | write(*,*) '***** program finished *****' 30 | stop 31 | ! 32 | end program sph_snapshot_w_psf 33 | -------------------------------------------------------------------------------- /src/programs/data_utilities/SNAPSHOT_MHD/main_sph_zm_snap.f90: -------------------------------------------------------------------------------- 1 | !>@file main_sph_zm_snap.f90 2 | !!@brief program kemorin_sph_zm_snap 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Okuda in 2000 6 | !!@n Modified by H. Matsui in May, 2003 (ver 2.0) 7 | !!@n Connect to vizs by H. Matsui in July 2006 (ver 2.0) 8 | ! 9 | !>@brief Main program to evaluate zonal mean field 10 | ! 11 | program kemorin_sph_zm_snap 12 | ! 13 | use m_precision 14 | ! 15 | use calypso_mpi 16 | use analyzer_sph_zm_snap 17 | ! 18 | implicit none 19 | ! 20 | ! 21 | call calypso_MPI_init 22 | ! 23 | call initialize_sph_zm_snap 24 | call evolution_sph_zm_snap 25 | ! 26 | call calypso_MPI_finalize 27 | ! 28 | write(*,*) '***** program finished *****' 29 | stop 30 | ! 31 | end program kemorin_sph_zm_snap 32 | -------------------------------------------------------------------------------- /src/programs/mesh_utilities/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE(gen_sph_grids main_generate_sph_grids.f90 analyzer_gen_sph_grids.f90) 2 | TARGET_LINK_LIBRARIES(gen_sph_grids calypso) 3 | 4 | SET(MOD_TEST_SPH_GRID cmp_trans_sph_indices.f90 cmp_trans_sph_tests.f90 analyzer_test_sph.f90 main_test_sph.f90) 5 | ADD_EXECUTABLE(check_sph_grids ${MOD_TEST_SPH_GRID}) 6 | TARGET_LINK_LIBRARIES(check_sph_grids calypso) 7 | 8 | -------------------------------------------------------------------------------- /src/programs/mesh_utilities/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | GEN_SPH_GRIDDIR = $$(PROG_DIR)/mesh_utilities 6 | 7 | TARGET_GEN_SPH = gen_sph_grids 8 | TARGET_TEST_SPH_GRID = check_sph_grids 9 | 10 | 11 | SOURCES = $(shell ls *.f90) 12 | 13 | MOD_GEN_SPH_GRID = \ 14 | main_generate_sph_grids.o \ 15 | analyzer_gen_sph_grids.o 16 | 17 | MOD_TEST_SPH_GRID = \ 18 | m_read_ctl_gen_sph_shell.o \ 19 | cmp_trans_sph_indices.o \ 20 | cmp_trans_sph_tests.o \ 21 | \ 22 | analyzer_test_sph.o \ 23 | main_test_sph.o 24 | # 25 | # ------------------------------------------------------------------------- 26 | # 27 | 28 | dir_list: 29 | @echo 'GEN_SPH_GRIDDIR = $(GEN_SPH_GRIDDIR)' >> $(MAKENAME) 30 | 31 | target_list: 32 | @echo 'TARGET_GEN_SPH = $$(BUILDDIR)/$(TARGET_GEN_SPH)' \ 33 | >> $(MAKENAME) 34 | @echo 'TARGET_TEST_SPH_GRID = $$(BUILDDIR)/$(TARGET_TEST_SPH_GRID)' \ 35 | >> $(MAKENAME) 36 | @echo >> $(MAKENAME) 37 | 38 | target_task: 39 | @echo mesh_utils: \ 40 | '$$(TARGET_TEST_SPH_GRID)' \ 41 | '$$(TARGET_GEN_SPH)' >> $(MAKENAME) 42 | @echo '' >> $(MAKENAME) 43 | @echo '$$(TARGET_GEN_SPH)': '$$(MOD_GEN_SPH_GRID)' \ 44 | '$$(LIB_CALYPSO_FILE)' \ 45 | >> $(MAKENAME) 46 | @echo ' ''$$(F90)' '$$(F90FLAGS)' -o '$$(TARGET_GEN_SPH)' \ 47 | '$$(MOD_GEN_SPH_GRID)' \ 48 | '-L. $$(LIB_CALYPSO)' \ 49 | '$$(F90LIBS)' >> $(MAKENAME) 50 | @echo '' >> $(MAKENAME) 51 | @echo '$$(TARGET_TEST_SPH_GRID):' \ 52 | '$$(MOD_TEST_SPH_GRID) $$(LIB_CALYPSO_FILE)' \ 53 | >> $(MAKENAME) 54 | @echo ' ''$$(F90)' '$$(F90FLAGS)' -o '$$(TARGET_TEST_SPH_GRID)' \ 55 | '$$(MOD_TEST_SPH_GRID)' \ 56 | '-L. $$(LIB_CALYPSO)' \ 57 | '$$(F90LIBS)' >> $(MAKENAME) 58 | @echo '' >> $(MAKENAME) 59 | 60 | 61 | lib_name: 62 | 63 | mod_list: 64 | @echo MOD_GEN_SPH_GRID= \\ >> $(MAKENAME) 65 | @echo $(MOD_GEN_SPH_GRID) >> $(MAKENAME) 66 | @echo MOD_TEST_SPH_GRID= \\ >> $(MAKENAME) 67 | @echo $(MOD_TEST_SPH_GRID) >> $(MAKENAME) 68 | @echo '#' >> $(MAKENAME) 69 | 70 | module: 71 | @$(MAKE_MOD_DEP) '$(MAKENAME)' '$$(GEN_SPH_GRIDDIR)' $(SOURCES) 72 | -------------------------------------------------------------------------------- /src/programs/mesh_utilities/main_generate_sph_grids.f90: -------------------------------------------------------------------------------- 1 | !>@file main_generate_sph_grids.f90 2 | !!@brief program generate_sph_grids 3 | !! 4 | !!@author H. Matsui 5 | !!@date Programmed by H. Matsui in Feb., 2015 6 | ! 7 | !>@brief Main program generate spherical harmonics indices 8 | ! 9 | program generate_sph_grids 10 | ! 11 | use m_precision 12 | ! 13 | use calypso_mpi 14 | use analyzer_gen_sph_grids 15 | ! 16 | implicit none 17 | ! 18 | ! 19 | call calypso_MPI_init 20 | ! 21 | call init_gen_sph_grids 22 | call analyze_gen_sph_grids 23 | ! 24 | call calypso_MPI_finalize 25 | ! 26 | write(*,*) '***** program finished *****' 27 | stop 28 | ! 29 | end program generate_sph_grids 30 | -------------------------------------------------------------------------------- /src/programs/mesh_utilities/main_test_sph.f90: -------------------------------------------------------------------------------- 1 | !main_test_sph.f90 2 | ! program test_sph_model 3 | ! 4 | program test_sph_model 5 | ! 6 | use m_precision 7 | ! 8 | use calypso_mpi 9 | use analyzer_test_sph 10 | 11 | implicit none 12 | ! 13 | ! 14 | call calypso_MPI_init 15 | ! 16 | call init_test_sph 17 | call analyze_test_sph 18 | 19 | call calypso_MPI_finalize 20 | ! 21 | write(*,*) '***** program finished *****' 22 | stop 23 | ! 24 | end program test_sph_model 25 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # A function that extracts from file control_MHD 2 | # the number of MPI processes this test is to be invoked as. 3 | # This is encoded in .prm files through lines of the form 4 | # 'num_subdomain_ctl 4' 5 | # The result is returned in a variable _mpi_count in the 6 | # caller's scope. 7 | FUNCTION(get_mpi_count _filename) 8 | FILE(STRINGS ${_filename} _input_lines 9 | REGEX "^ * num_subdomain_ctl") 10 | # MESSAGE( STATUS "Read line is: " ${_input_lines} ) 11 | IF("${_input_lines}" STREQUAL "") 12 | SET(_mpi_count 1 PARENT_SCOPE) 13 | ELSE() 14 | # go over the (possibly multiple) lines with MPI markers and choose the last 15 | FOREACH(_input_line ${_input_lines}) 16 | SET(_last_line ${_input_line}) 17 | ENDFOREACH() 18 | STRING(REGEX REPLACE "^ *num_subdomain_ctl *([0-9]+) *$" "\\1" 19 | _mpi_count ${_last_line}) 20 | # MESSAGE( STATUS "MPI_count: " ${_mpi_count} ) 21 | SET(_mpi_count "${_mpi_count}" PARENT_SCOPE) 22 | ENDIF() 23 | ENDFUNCTION() 24 | # A function that extracts from file control_MHD 25 | # the number of openMP threads this test is to be invoked with. 26 | # This is encoded in control_MHD files through lines of the form 27 | # 'num_smp_ctl 2' 28 | # The result is returned in a variable _mpi_count in the 29 | # caller's scope. 30 | FUNCTION(get_openmp_count _filename) 31 | FILE(STRINGS ${_filename} _input_lines 32 | REGEX "^ * num_smp_ctl") 33 | # MESSAGE( STATUS "Read line is: " ${_input_lines} ) 34 | IF("${_input_lines}" STREQUAL "") 35 | SET(_mpi_count 1 PARENT_SCOPE) 36 | ELSE() 37 | # go over the (possibly multiple) lines with MPI markers and choose the last 38 | FOREACH(_input_line ${_input_lines}) 39 | SET(_last_line ${_input_line}) 40 | ENDFOREACH() 41 | STRING(REGEX REPLACE "^ *num_smp_ctl *([0-9]+) *$" "\\1" 42 | _openmp_count ${_last_line}) 43 | # MESSAGE( STATUS "MPI_count: " ${_openmp_count} ) 44 | SET(_mpi_count "${_mpi_count}" PARENT_SCOPE) 45 | ENDIF() 46 | ENDFUNCTION() 47 | 48 | ADD_SUBDIRECTORY(Dynamobench_case1) 49 | ADD_SUBDIRECTORY(Dynamobench_case2) 50 | ADD_SUBDIRECTORY(heterogineous_temp) 51 | -------------------------------------------------------------------------------- /tests/Dynamobench_case1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | GET_MPI_COUNT("control_MHD") 2 | GET_OPENMP_COUNT("control_MHD") 3 | 4 | configure_file(control_MHD ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1/control_MHD COPYONLY) 5 | configure_file(control_sph_shell ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1/control_sph_shell COPYONLY) 6 | 7 | file(COPY field DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1) 8 | file(COPY rst_4 DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1) 9 | file(COPY sph_lm31r48c_4 DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1) 10 | file(COPY reference DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1) 11 | 12 | add_test (NAME "Dynamobench_case1_gen_sph_grids" 13 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1 14 | COMMAND mpirun -np ${_mpi_count} ${CMAKE_BINARY_DIR}/bin/gen_sph_grids) 15 | 16 | add_test (NAME "Dynamobench_case1_sph_mhd" 17 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1 18 | COMMAND mpirun -np ${_mpi_count} ${CMAKE_BINARY_DIR}/bin/sph_mhd) 19 | 20 | add_test (NAME "Dynamobench_case1_sph_ene_check" 21 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/Dynamobench_case1 22 | COMMAND ${CMAKE_BINARY_DIR}/bin/sph_ene_check) 23 | -------------------------------------------------------------------------------- /tests/Dynamobench_case1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Kemo's Dynamo toolkit 3 | # Written by H. Matsui 4 | # 5 | SHELL = /bin/sh 6 | # 7 | # directories of Kemo's Dynamo toolkit 8 | # 9 | SRCDIR = /Users/matsui/src_kemo 10 | # 11 | MHDDIR = $(SRCDIR)/MHD 12 | BUILDDIR= $(SRCDIR)/bin 13 | TESTDIR= $(SRCDIR)/tests 14 | # 15 | # MPI settings 16 | # 17 | MPICHDIR = 18 | MPICHLIBDIR = $(MPICHDIR)/lib 19 | MPICHBINDIR = $(MPICHDIR)/bin 20 | MPICHINCDIR = 21 | MPILIBS = 22 | # 23 | 24 | all: test 25 | 26 | test: 27 | rm -f *.dat 28 | $(MPIRUN) -np 4 $(BUILDDIR)/gen_sph_grids 29 | $(MPIRUN) -np 4 $(BUILDDIR)/sph_mhd 30 | echo 'Compare with reference mean square data' 31 | $(BUILDDIR)/sph_ene_check 32 | 33 | clean: 34 | rm -f *.dat rst_4/rst.* sph_lm31r48c_4/in.* 35 | 36 | distclean: clean 37 | -------------------------------------------------------------------------------- /tests/Dynamobench_case1/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_4/in' 5 | end data_files_def 6 | ! 7 | begin num_domain_ctl 8 | num_radial_domain_ctl 2 9 | num_horizontal_domain_ctl 2 10 | end num_domain_ctl 11 | ! 12 | begin num_grid_sph 13 | truncation_level_ctl 31 14 | ! 15 | ngrid_meridonal_ctl 48 16 | ngrid_zonal_ctl 96 17 | ! 18 | radial_grid_type_ctl Chebyshev 19 | num_fluid_grid_ctl 48 20 | fluid_core_size_ctl 1.0 21 | ICB_to_CMB_ratio_ctl 0.35 22 | end num_grid_sph 23 | end spherical_shell_ctl 24 | -------------------------------------------------------------------------------- /tests/Dynamobench_case1/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! field data directory for dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Field data for visualization are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/Dynamobench_case1/reference/sph_pwr_volume_s.dat: -------------------------------------------------------------------------------- 1 | radial_layers, truncation 2 | 0 31 3 | ICB_id, CMB_id 4 | 1 49 5 | number of components 6 | 3 7 7 | 3 1 3 8 | t_step time K_ene_pol K_ene_tor K_ene temperature M_ene_pol M_ene_tor M_ene 9 | 50 2.50000000000000E-003 1.20285080867821E+001 6.85065267943266E+000 1.88791607662148E+001 8.36509824396160E-002 2.87589346354095E+000 3.05329223841909E+000 5.92918570196004E+000 10 | 100 5.00000000000000E-003 2.95758296097016E+000 1.80498078789989E+001 2.10073908399691E+001 8.35753846753617E-002 2.87623019021592E+000 2.98954489450576E+000 5.86577508472168E+000 11 | -------------------------------------------------------------------------------- /tests/Dynamobench_case1/rst_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! restart data directory for dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/Dynamobench_case1/sph_lm31r48c_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! index data directory for dynamo benchmark test Case 1 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/Dynamobench_case2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | GET_MPI_COUNT("control_MHD") 2 | GET_OPENMP_COUNT("control_MHD") 3 | 4 | configure_file(control_MHD ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2/control_MHD COPYONLY) 5 | configure_file(control_sph_shell ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2/control_sph_shell COPYONLY) 6 | 7 | file(COPY field DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2) 8 | file(COPY rst_4 DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2) 9 | file(COPY sph_lm31r48c_ic_4 DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2) 10 | file(COPY reference DESTINATION ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2) 11 | 12 | add_test (NAME "Dynamobench_case2_gen_sph_grids" 13 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2 14 | COMMAND mpirun -np ${_mpi_count} ${CMAKE_BINARY_DIR}/bin/gen_sph_grids) 15 | 16 | add_test (NAME "Dynamobench_case2_sph_mhd" 17 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2 18 | COMMAND mpirun -np ${_mpi_count} ${CMAKE_BINARY_DIR}/bin/sph_mhd) 19 | 20 | add_test (NAME "Dynamobench_case2_sph_ene_check" 21 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/Dynamobench_case2 22 | COMMAND ${CMAKE_BINARY_DIR}/bin/sph_ene_check) 23 | -------------------------------------------------------------------------------- /tests/Dynamobench_case2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Kemo's Dynamo toolkit 3 | # Written by H. Matsui 4 | # 5 | SHELL = /bin/sh 6 | # 7 | # directories of Kemo's Dynamo toolkit 8 | # 9 | SRCDIR = /Users/matsui/src_kemo 10 | # 11 | MHDDIR = $(SRCDIR)/MHD 12 | BUILDDIR= $(SRCDIR)/bin 13 | TESTDIR= $(SRCDIR)/tests 14 | # 15 | # MPI settings 16 | # 17 | MPICHDIR = 18 | MPICHLIBDIR = $(MPICHDIR)/lib 19 | MPICHBINDIR = $(MPICHDIR)/bin 20 | MPICHINCDIR = 21 | MPILIBS = 22 | # 23 | 24 | all: test 25 | 26 | test: 27 | rm -f *.dat 28 | $(MPIRUN) -np 4 $(BUILDDIR)/gen_sph_grids 29 | $(MPIRUN) -np 4 $(BUILDDIR)/sph_mhd 30 | echo 'Compare with reference mean square data' 31 | $(BUILDDIR)/sph_ene_check 32 | 33 | clean: 34 | rm -f *.dat rst_4/rst.* sph_lm31r48c_ic_4/in.* 35 | 36 | distclean: clean 37 | -------------------------------------------------------------------------------- /tests/Dynamobench_case2/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 4 4 | sph_file_prefix 'sph_lm31r48c_ic_4/in' 5 | ! 6 | memory_conservation_ctl 'YES' 7 | end data_files_def 8 | ! 9 | begin num_domain_ctl 10 | num_radial_domain_ctl 2 11 | num_horizontal_domain_ctl 2 12 | end num_domain_ctl 13 | ! 14 | begin num_grid_sph 15 | truncation_level_ctl 31 16 | ! 17 | ngrid_meridonal_ctl 48 18 | ngrid_zonal_ctl 96 19 | ! 20 | radial_grid_type_ctl Chebyshev 21 | num_fluid_grid_ctl 48 22 | fluid_core_size_ctl 1.0 23 | ICB_to_CMB_ratio_ctl 0.35 24 | Min_radius_ctl 0.0 25 | Max_radius_ctl 2.0 26 | end num_grid_sph 27 | end spherical_shell_ctl 28 | -------------------------------------------------------------------------------- /tests/Dynamobench_case2/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! field data directory for dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Field data for visualization are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/Dynamobench_case2/reference/sph_pwr_volume_s.dat: -------------------------------------------------------------------------------- 1 | radial_layers, truncation 2 | 0 31 3 | ICB_id, CMB_id 4 | 25 73 5 | number of components 6 | 3 7 7 | 3 1 3 8 | t_step time K_ene_pol K_ene_tor K_ene temperature M_ene_pol M_ene_tor M_ene 9 | 50 2.50000000000000E-003 9.01593666008513E+000 7.04667348737713E+000 1.60626101474623E+001 8.36512421586630E-002 2.27673850328712E+000 2.63966590573787E+000 4.91640440902499E+000 10 | 100 5.00000000000000E-003 6.48510480860388E+000 1.56747128661799E+001 2.21598176747838E+001 8.35848938589507E-002 2.29094189735628E+000 2.49693739556158E+000 4.78787929291786E+000 11 | -------------------------------------------------------------------------------- /tests/Dynamobench_case2/rst_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! restart data directory for dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/Dynamobench_case2/sph_lm31r48c_ic_4/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! index data directory for dynamo benchmark test Case 2 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Kemo's Dynamo toolkit 3 | # Written by H. Matsui 4 | # 5 | SHELL = /bin/sh 6 | # 7 | # directories of Kemo's Dynamo toolkit 8 | # 9 | SRCDIR = /Users/matsui/src_kemo 10 | # 11 | MHDDIR = $(SRCDIR)/MHD 12 | BUILDDIR= $(SRCDIR)/bin 13 | TESTDIR= $(SRCDIR)/tests 14 | # 15 | # MPI settings 16 | # 17 | MPICHDIR = 18 | MPICHLIBDIR = $(MPICHDIR)/lib 19 | MPICHBINDIR = $(MPICHDIR)/bin 20 | MPICHINCDIR = 21 | MPILIBS = 22 | # 23 | # 24 | # ------------------------------------------------------------------------- 25 | # 26 | SUBDIRS = \ 27 | Dynamobench_case1 \ 28 | Dynamobench_case2 \ 29 | heterogineous_temp 30 | 31 | # 32 | # ------------------------------------------------------------------------- 33 | # 34 | 35 | 36 | all: test 37 | 38 | test: 39 | echo "# Test output test..."; \ 40 | for dir in $(SUBDIRS) ; do \ 41 | echo "# Test in $${dir} directory..."; \ 42 | ( cd $${dir}; \ 43 | $(GMAKE) \ 44 | GMAKE="$(GMAKE)" \ 45 | BUILDDIR="$(BUILDDIR)" \ 46 | TESTDIR="$(TESTDIR)" \ 47 | MHDDIR="$(MHDDIR)" \ 48 | MPIRUN="$(MPIRUN)" \ 49 | test)\ 50 | done; \ 51 | rm -f mpif.h *.o *.mod *~ *.par *.diag *.a *.f90 52 | 53 | clean: 54 | for dir in $(SUBDIRS) ; do \ 55 | echo "# cleaning $${dir} directory..."; \ 56 | ( cd $${dir}; \ 57 | make clean )\ 58 | done; \ 59 | rm -f mpif.h *.o *.mod *~ *.par *.diag *.a *.f90 60 | 61 | distclean: clean 62 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | GET_MPI_COUNT("control_MHD") 2 | GET_OPENMP_COUNT("control_MHD") 3 | 4 | configure_file(control_MHD ${CMAKE_BINARY_DIR}/tests/heterogineous_temp/control_MHD COPYONLY) 5 | configure_file(control_sph_shell ${CMAKE_BINARY_DIR}/tests/heterogineous_temp/control_sph_shell COPYONLY) 6 | configure_file(bc_spectr.btx ${CMAKE_BINARY_DIR}/tests/heterogineous_temp/bc_spectr.btx COPYONLY) 7 | 8 | file(COPY field DESTINATION ${CMAKE_BINARY_DIR}/tests/heterogineous_temp) 9 | file(COPY rst_2 DESTINATION ${CMAKE_BINARY_DIR}/tests/heterogineous_temp) 10 | file(COPY sph_lm4r64c_2 DESTINATION ${CMAKE_BINARY_DIR}/tests/heterogineous_temp) 11 | file(COPY reference DESTINATION ${CMAKE_BINARY_DIR}/tests/heterogineous_temp) 12 | 13 | add_test (NAME "heterogineous_temp_gen_sph_grids" 14 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/heterogineous_temp 15 | COMMAND mpirun -np ${_mpi_count} ${CMAKE_BINARY_DIR}/bin/gen_sph_grids) 16 | 17 | add_test (NAME "heterogineous_temp_sph_mhd" 18 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/heterogineous_temp 19 | COMMAND mpirun -np ${_mpi_count} ${CMAKE_BINARY_DIR}/bin/sph_mhd) 20 | 21 | add_test (NAME "heterogineous_temp_sph_ene_check" 22 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/heterogineous_temp 23 | COMMAND ${CMAKE_BINARY_DIR}/bin/sph_ene_check) 24 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Kemo's Dynamo toolkit 3 | # Written by H. Matsui 4 | # 5 | SHELL = /bin/sh 6 | # 7 | # directories of Kemo's Dynamo toolkit 8 | # 9 | SRCDIR = /Users/matsui/src_kemo 10 | # 11 | MHDDIR = $(SRCDIR)/MHD 12 | BUILDDIR= $(SRCDIR)/bin 13 | TESTDIR= $(SRCDIR)/tests 14 | # 15 | # MPI settings 16 | # 17 | MPICHDIR = 18 | MPICHLIBDIR = $(MPICHDIR)/lib 19 | MPICHBINDIR = $(MPICHDIR)/bin 20 | MPICHINCDIR = 21 | MPILIBS = 22 | # 23 | 24 | all: test 25 | 26 | test: 27 | rm -f *.dat 28 | $(MPIRUN) -np 2 $(BUILDDIR)/gen_sph_grids 29 | $(MPIRUN) -np 2 $(BUILDDIR)/sph_mhd 30 | echo 'Compare with reference mean square data' 31 | $(BUILDDIR)/sph_ene_check 32 | 33 | clean: 34 | rm -f *.dat rst_2/rst.* sph_lm4r64c_2/in.* 35 | 36 | distclean: clean 37 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/bc_spectr.btx: -------------------------------------------------------------------------------- 1 | # 2 | # number of boundary conditions 3 | 4 4 | # 5 | # boundary condition data list 6 | # 7 | # Fixed temperature at ICB 8 | temperature 9 | ICB 10 | 3 11 | 0 0 1.000E+00 12 | 1 1 2.000E-01 13 | 2 2 3.000E-01 14 | # 15 | # Fixed heat flux at CMB 16 | heat_flux 17 | CMB 18 | 2 19 | 0 0 -0.9E+0 20 | 1 -1 5.0E-1 21 | # 22 | # Fixed composition flux at ICB 23 | composite_flux 24 | ICB 25 | 2 26 | 0 0 0.000E+00 27 | 2 0 -2.500E-01 28 | # 29 | # Fixed composition at CMB 30 | composition 31 | CMB 32 | 2 33 | 0 0 1.000E+00 34 | 2 -2 5.000E-01 35 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/control_sph_shell: -------------------------------------------------------------------------------- 1 | begin spherical_shell_ctl 2 | begin data_files_def 3 | num_subdomain_ctl 2 4 | sph_file_prefix 'sph_lm4r64c_2/in' 5 | boundary_data_file_name 'bc_spectr.btx' 6 | end data_files_def 7 | ! 8 | begin num_domain_ctl 9 | array num_domain_sph_grid 2 10 | num_domain_sph_grid radial 2 end 11 | num_domain_sph_grid meridional 1 end 12 | end array num_domain_sph_grid 13 | ! 14 | array num_domain_legendre 2 15 | num_domain_legendre radial 2 end 16 | num_domain_legendre zonal 1 end 17 | end array num_domain_legendre 18 | ! 19 | array num_domain_spectr 1 20 | num_domain_spectr modes 2 end 21 | end array num_domain_spectr 22 | end num_domain_ctl 23 | ! 24 | begin num_grid_sph 25 | truncation_level_ctl 4 26 | ! 27 | ngrid_meridonal_ctl 12 28 | ngrid_zonal_ctl 24 29 | ! 30 | radial_grid_type_ctl Chebyshev 31 | num_fluid_grid_ctl 64 32 | fluid_core_size_ctl 1.0 33 | ICB_to_CMB_ratio_ctl 0.35 34 | end num_grid_sph 35 | end spherical_shell_ctl 36 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/field/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! field data directory for heterogenious thermal boundary 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Field data for visualization are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/reference/sph_pwr_volume_s.dat: -------------------------------------------------------------------------------- 1 | radial_layers, truncation 2 | 0 4 3 | ICB_id, CMB_id 4 | 1 65 5 | number of components 6 | 2 2 7 | 1 1 8 | t_step time temperature composition 9 | 50 5.00000000000000E-003 1.24633611598717E-002 7.07296547178564E-002 10 | 100 1.00000000000000E-002 1.82576213418588E-002 1.00255167268881E-001 11 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/rst_2/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! restart data directory for heterogenious thermal boundary 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | -------------------------------------------------------------------------------- /tests/heterogineous_temp/sph_lm4r64c_2/README: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! index data directory for heterogenious thermal boundary 3 | ! Please see Christensen et.al. (2001) for the model description 4 | !----------------------------------------------------------------------- 5 | ! 6 | Restart data files are stored in this directory. 7 | --------------------------------------------------------------------------------