From d3b94a51607181bb564d47b0c42ffe210f90b01e Mon Sep 17 00:00:00 2001 From: Hiroaki Matsui Date: Thu, 23 May 2024 23:03:45 -0700 Subject: [PATCH 1/3] Modify Makefile --- src/C_libraries/BASE/Makefile | 6 ++++-- .../SPH_SHELL_src/leg_bwd_trans_on_the_fly.f90 | 9 +++------ .../legendre_bwd_trans_testloop.f90 | 10 ++++------ .../IO_ZLIB/gz_layer_mean_monitor_IO.F90 | 2 ++ src/confdb/ax_openmp.m4 | 2 +- src/programs/TESTS/Compare/Makefile | 4 ++-- src/programs/TESTS/FFT_test/Makefile | 16 ++++++++-------- src/programs/TESTS/Gauss_point_test/Makefile | 8 ++++---- src/programs/TESTS/Legendre_test/Makefile | 4 ++-- src/programs/TESTS/Makefile | 6 ++++-- 10 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/C_libraries/BASE/Makefile b/src/C_libraries/BASE/Makefile index 158403cb..b1b2150d 100644 --- a/src/C_libraries/BASE/Makefile +++ b/src/C_libraries/BASE/Makefile @@ -3,6 +3,8 @@ # C_BASE_DIR = $$(C_SRCDIR)/BASE + +CURRENTDIR = $(shell pwd) SRC_BASE_C = $(shell ls *.c) INC_BASE_C = $(addsuffix .h,$(basename $(SRC_BASE_C)) ) OBJ_BASE_C = $(addsuffix .o,$(basename $(SRC_BASE_C)) ) @@ -37,11 +39,11 @@ depends: @for sources in $(SRC_BASE_C) ; do \ ( \ cd $(MAKEDIR); \ - $(CC) $(DEPFLAGS) $(OPTFLAGS_GL) $(C_INCLUDE) $(MHDDIR)/C_libraries/BASE/$$sources >> $(MAKENAME).tmp; \ + $(CC) $(DEPFLAGS) $(OPTFLAGS_GL) $(C_INCLUDE) $(CURRENTDIR)/$$sources >> $(MAKENAME).tmp; \ echo ' ''$$(CC)' -c '$$(OPTFLAGS) $$(C_INCLUDE) $$<' >> $(MAKENAME).tmp \ ) \ done - @sed -e 's@'$(MHDDIR)/C_libraries'@'$$\(C_SRCDIR\)'@g' $(MAKENAME).tmp > $(MHDDIR)/C_libraries/BASE/Makefile.depends + @sed -e 's@'$(MHDDIR)/C_libraries'@'$$\(C_SRCDIR\)'@g' $(CURRENTDIR)/Makefile.depends @rm $(MAKENAME).tmp clean: diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/leg_bwd_trans_on_the_fly.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/leg_bwd_trans_on_the_fly.f90 index c51999f5..96c78eb8 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/leg_bwd_trans_on_the_fly.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/leg_bwd_trans_on_the_fly.f90 @@ -130,8 +130,7 @@ subroutine legendre_b_trans_on_the_fly & call leg_bwd_trans_1latitude(lp_rtm, jst, mm, & & mp_rlm, idx_trns%mn_rlm(mp_rlm), nkrs, nkrt, & & iflag_matmul, ncomp, nvector, nscalar, & - & sph_rlm, sph_rtm, comm_rlm, comm_rtm, & - & idx_trns, leg, n_WR, n_WS, WR, WS, & + & sph_rlm, sph_rtm, comm_rtm, leg, n_WR, n_WS, WR, WS, & & WK_l_otf%n_jk_e(mp_rlm), WK_l_otf%n_jk_o(mp_rlm), & & WK_l_otf%Smat(1), WK_l_otf%Pjt_mat(ip), & & WK_l_otf%Fmat(ip), WK_l_otf%wk_plm(ip)) @@ -175,8 +174,7 @@ end subroutine legendre_b_trans_on_the_fly subroutine leg_bwd_trans_1latitude & & (lp_rtm, jst, mm, mp_rlm, mn_rlm, nkrs, nkrt, & & iflag_matmul, ncomp, nvector, nscalar, & - & sph_rlm, sph_rtm, comm_rlm, comm_rtm, & - & idx_trns, leg, n_WR, n_WS, WR, WS, & + & sph_rlm, sph_rtm, comm_rtm, leg, n_WR, n_WS, WR, WS, & & n_jk_e, n_jk_o, Smat, Pjt_mat, Fmat, wk_plm) ! use t_schmidt_poly_on_rtm @@ -192,9 +190,8 @@ subroutine leg_bwd_trans_1latitude & integer(kind = kint), intent(in) :: iflag_matmul type(sph_rlm_grid), intent(in) :: sph_rlm type(sph_rtm_grid), intent(in) :: sph_rtm - type(sph_comm_tbl), intent(in) :: comm_rlm, comm_rtm + type(sph_comm_tbl), intent(in) :: comm_rtm type(legendre_4_sph_trans), intent(in) :: leg - type(index_4_sph_trans), intent(in) :: idx_trns ! integer(kind = kint), intent(in) :: ncomp, nvector, nscalar integer(kind = kint), intent(in) :: n_WR, n_WS diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/legendre_bwd_trans_testloop.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/legendre_bwd_trans_testloop.f90 index cb26b075..c9fc6625 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/legendre_bwd_trans_testloop.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/legendre_bwd_trans_testloop.f90 @@ -49,6 +49,7 @@ module legendre_bwd_trans_testloop ! implicit none ! + private :: leg_bwd_trans_1latitude integer, external :: omp_get_max_threads ! ! ----------------------------------------------------------------------- @@ -128,8 +129,7 @@ subroutine legendre_b_trans_vector_test & call leg_bwd_trans_1latitude(lp_rtm, jst, mm, & & mp_rlm, idx_trns%mn_rlm(mp_rlm), nkrs, nkrt, & & iflag_matmul, ncomp, nvector, nscalar, & - & sph_rlm, sph_rtm, comm_rlm, comm_rtm, & - & idx_trns, leg, n_WR, n_WS, WR, WS, & + & sph_rlm, sph_rtm, comm_rtm, leg, n_WR, n_WS, WR, WS, & & WK_l_tst%n_jk_e(mp_rlm), WK_l_tst%n_jk_o(mp_rlm), & & WK_l_tst%Smat(1), WK_l_tst%Pjt_mat(ip), & & WK_l_tst%Fmat(ip), WK_l_tst%wk_plm(ip)) @@ -172,8 +172,7 @@ end subroutine legendre_b_trans_vector_test subroutine leg_bwd_trans_1latitude & & (lp_rtm, jst, mm, mp_rlm, mn_rlm, nkrs, nkrt, & & iflag_matmul, ncomp, nvector, nscalar, & - & sph_rlm, sph_rtm, comm_rlm, comm_rtm, & - & idx_trns, leg, n_WR, n_WS, WR, WS, & + & sph_rlm, sph_rtm, comm_rtm, leg, n_WR, n_WS, WR, WS, & & n_jk_e, n_jk_o, Smat, Pjt_mat, Fmat, wk_plm) ! use t_schmidt_poly_on_rtm @@ -189,9 +188,8 @@ subroutine leg_bwd_trans_1latitude & integer(kind = kint), intent(in) :: iflag_matmul type(sph_rlm_grid), intent(in) :: sph_rlm type(sph_rtm_grid), intent(in) :: sph_rtm - type(sph_comm_tbl), intent(in) :: comm_rlm, comm_rtm + type(sph_comm_tbl), intent(in) :: comm_rtm type(legendre_4_sph_trans), intent(in) :: leg - type(index_4_sph_trans), intent(in) :: idx_trns ! integer(kind = kint), intent(in) :: ncomp, nvector, nscalar integer(kind = kint), intent(in) :: n_WR, n_WS diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_mean_monitor_IO.F90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_mean_monitor_IO.F90 index 667d4950..a50388cf 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_mean_monitor_IO.F90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_mean_monitor_IO.F90 @@ -52,7 +52,9 @@ module gz_layer_mean_monitor_IO ! implicit none ! +#ifdef ZLIB_IO private :: gz_write_layer_mean_monitor +#endif ! ! ----------------------------------------------------------------------- ! diff --git a/src/confdb/ax_openmp.m4 b/src/confdb/ax_openmp.m4 index 7a17363b..fb55a4ac 100644 --- a/src/confdb/ax_openmp.m4 +++ b/src/confdb/ax_openmp.m4 @@ -45,7 +45,7 @@ ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown # -xopenmp (Sun), -omp (Tru64), # -qsmp=omp (AIX), # none -ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" +ax_openmp_flags="-openmp -qopenmp -fopenmp -mp -xopenmp -omp -qsmp=omp none" if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" fi diff --git a/src/programs/TESTS/Compare/Makefile b/src/programs/TESTS/Compare/Makefile index 52a296a9..c3343997 100644 --- a/src/programs/TESTS/Compare/Makefile +++ b/src/programs/TESTS/Compare/Makefile @@ -4,7 +4,7 @@ COMPARISON_DIR = $$(TESTS_DIR)/Compare -TARGET_COMPARE_PSF = tests/compare_psf +TARGET_COMPARE_PSF = compare_psf SOURCES = $(shell ls *.f90) @@ -22,7 +22,7 @@ dir_list: @echo 'COMPARISON_DIR = $(COMPARISON_DIR)' >> $(MAKENAME) target_list: - @echo 'TARGET_COMPARE_PSF = $$(BUILDDIR)/$(TARGET_COMPARE_PSF)' \ + @echo 'TARGET_COMPARE_PSF = $$(TEST_BUILD_DIR)/$(TARGET_COMPARE_PSF)' \ >> $(MAKENAME) @echo >> $(MAKENAME) diff --git a/src/programs/TESTS/FFT_test/Makefile b/src/programs/TESTS/FFT_test/Makefile index e81918bb..320a14a0 100644 --- a/src/programs/TESTS/FFT_test/Makefile +++ b/src/programs/TESTS/FFT_test/Makefile @@ -6,11 +6,11 @@ FFT_TEST_DIR = $$(TESTS_DIR)/FFT_test -TARGET_FFTPACK_TEST = tests/test_FFTPACK -TARGET_FFW3_F_TEST = tests/test_FFTW3_f -TARGET_SGL_FFW3_TEST = tests/test_single_FFTW3 +TARGET_FFTPACK_TEST = test_FFTPACK +TARGET_FFW3_F_TEST = test_FFTW3_f +TARGET_SGL_FFW3_TEST = test_single_FFTW3 -TARGET_CMPR_FFT_TEST = tests/compare_fft_test +TARGET_CMPR_FFT_TEST = compare_fft_test TARGETS_FFT_TEST = \ '$$(TARGET_FFTPACK_TEST)' \ @@ -89,10 +89,10 @@ dir_list: @echo 'FFT_TEST_DIR = $(FFT_TEST_DIR)' >> $(MAKENAME) target_list: - @echo 'TARGET_FFTPACK_TEST = $$(BUILDDIR)/$(TARGET_FFTPACK_TEST)' >> $(MAKENAME) - @echo 'TARGET_FFW3_F_TEST = $$(BUILDDIR)/$(TARGET_FFW3_F_TEST)' >> $(MAKENAME) - @echo 'TARGET_SGL_FFW3_TEST = $$(BUILDDIR)/$(TARGET_SGL_FFW3_TEST)' >> $(MAKENAME) - @echo 'TARGET_CMPR_FFT_TEST = $$(BUILDDIR)/$(TARGET_CMPR_FFT_TEST)' >> $(MAKENAME) + @echo 'TARGET_FFTPACK_TEST = $$(TEST_BUILD_DIR)/$(TARGET_FFTPACK_TEST)' >> $(MAKENAME) + @echo 'TARGET_FFW3_F_TEST = $$(TEST_BUILD_DIR)/$(TARGET_FFW3_F_TEST)' >> $(MAKENAME) + @echo 'TARGET_SGL_FFW3_TEST = $$(TEST_BUILD_DIR)/$(TARGET_SGL_FFW3_TEST)' >> $(MAKENAME) + @echo 'TARGET_CMPR_FFT_TEST = $$(TEST_BUILD_DIR)/$(TARGET_CMPR_FFT_TEST)' >> $(MAKENAME) target_task: @echo fft_test: $(TARGETS_FFT_TEST) >> $(MAKENAME) diff --git a/src/programs/TESTS/Gauss_point_test/Makefile b/src/programs/TESTS/Gauss_point_test/Makefile index 60e526fb..123eab86 100644 --- a/src/programs/TESTS/Gauss_point_test/Makefile +++ b/src/programs/TESTS/Gauss_point_test/Makefile @@ -4,8 +4,8 @@ GAUSS_TEST_DIR = $$(TESTS_DIR)/Gauss_point_test -TARGET_GAUSS_TEST = tests/gauss_points -TARGET_CMP_GAUSS_TEST = tests/compare_gauss_points +TARGET_GAUSS_TEST = gauss_points +TARGET_CMP_GAUSS_TEST = compare_gauss_points SOURCES = $(shell ls *.f90) @@ -26,9 +26,9 @@ dir_list: @echo 'GAUSS_TEST_DIR = $(GAUSS_TEST_DIR)' >> $(MAKENAME) target_list: - @echo 'TARGET_GAUSS_TEST = $$(BUILDDIR)/$(TARGET_GAUSS_TEST)' \ + @echo 'TARGET_GAUSS_TEST = $$(TEST_BUILD_DIR)/$(TARGET_GAUSS_TEST)' \ >> $(MAKENAME) - @echo 'TARGET_CMP_GAUSS_TEST = $$(BUILDDIR)/$(TARGET_CMP_GAUSS_TEST)' \ + @echo 'TARGET_CMP_GAUSS_TEST = $$(TEST_BUILD_DIR)/$(TARGET_CMP_GAUSS_TEST)' \ >> $(MAKENAME) @echo >> $(MAKENAME) diff --git a/src/programs/TESTS/Legendre_test/Makefile b/src/programs/TESTS/Legendre_test/Makefile index 2298ee89..6f10fa55 100644 --- a/src/programs/TESTS/Legendre_test/Makefile +++ b/src/programs/TESTS/Legendre_test/Makefile @@ -4,7 +4,7 @@ SMDT_POLY_TEST_DIR = $$(TESTS_DIR)/Legendre_test -TARGET_SMDT_POLY = tests/test_schmidt_Legendre +TARGET_SMDT_POLY = test_schmidt_Legendre SOURCES = $(shell ls *.f90) @@ -21,7 +21,7 @@ dir_list: @echo 'SMDT_POLY_TEST_DIR = $(SMDT_POLY_TEST_DIR)' >> $(MAKENAME) target_list: - @echo 'TARGET_SMDT_POLY = $$(BUILDDIR)/$(TARGET_SMDT_POLY)' >> $(MAKENAME) + @echo 'TARGET_SMDT_POLY = $$(TEST_BUILD_DIR)/$(TARGET_SMDT_POLY)' >> $(MAKENAME) @echo >> $(MAKENAME) target_task: diff --git a/src/programs/TESTS/Makefile b/src/programs/TESTS/Makefile index c59018e9..43db6d54 100644 --- a/src/programs/TESTS/Makefile +++ b/src/programs/TESTS/Makefile @@ -1,7 +1,8 @@ # # # -TESTS_DIR = $$(PROG_DIR)/TESTS +TESTS_DIR = $$(PROG_DIR)/TESTS +TEST_BUILD_DIR = $$(BUILDDIR)/tests SUBDIRS = \ Gauss_point_test \ @@ -14,7 +15,8 @@ Compare # dir_list: - @echo 'TESTS_DIR = $(TESTS_DIR)' >> $(MAKENAME) + @echo 'TESTS_DIR = $(TESTS_DIR)' >> $(MAKENAME) + @echo 'TEST_BUILD_DIR = $(TEST_BUILD_DIR)' >> $(MAKENAME) @echo '#' >> $(MAKENAME) @for dir in $(SUBDIRS); do \ ( \ From b88001f93f0a3a3c77f2ed9236f3e0507227daa9 Mon Sep 17 00:00:00 2001 From: Hiroaki Matsui Date: Fri, 18 Oct 2024 14:26:49 -0700 Subject: [PATCH 2/3] Replace pause statement to write message --- .../SOLVER_src/direct_solver/m_ludcmp_band.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 b/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 index f257cf25..b4c2b915 100644 --- a/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 +++ b/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 @@ -115,7 +115,8 @@ subroutine ludcmp_band(n, nband, band_a, band_lu ,indx, d) aamax = max(aamax, abs(band_a(k,j))) ! aamax = max(aamax, abs(a(i,j))) end do - if (aamax.eq.0.0d0) pause 'singular matrix in ludcmp_band' + if (aamax.eq.0.0d0) write(*,*) & + & '!!!!!! singular matrix in ludcmp !!!!!!' vv(i)=1.0d0 / aamax idx_org(i) = i end do From 54b56aef4b4079065aa230ff5396feb1bf70c534 Mon Sep 17 00:00:00 2001 From: Hiroaki Matsui Date: Fri, 18 Oct 2024 14:42:50 -0700 Subject: [PATCH 3/3] Add macro to skip private statements --- .../SERIAL_src/IO/write_pick_sph_spectr_data.F90 | 3 +++ .../SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 | 2 ++ .../SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 b/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 index 9a601033..0be4716a 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 +++ b/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 @@ -35,7 +35,10 @@ module write_pick_sph_spectr_data ! implicit none ! +#ifdef ZLIB_IO private :: gz_write_picked_spec_data +#endif +! private :: dup_pick_sph_file_header_base ! ! ----------------------------------------------------------------------- diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 index 32ac0031..e0ca41d2 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 @@ -55,7 +55,9 @@ module gz_layer_spectr_monitor_IO ! implicit none ! +#ifdef ZLIB_IO private :: gz_write_layer_spectr_monitor +#endif ! ! ----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 index 78911806..ad4aa67a 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 @@ -46,7 +46,9 @@ module gz_volume_spectr_monitor_IO ! implicit none ! +#ifdef ZLIB_IO private :: gz_write_volume_spectr_monitor +#endif ! ! ----------------------------------------------------------------------- !