[cig-commits] [commit] Hiro_latest: Use temperature and compositional boundary spectra in m_boundary_params_sph_MHD (f2586b4)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Nov 18 16:21:49 PST 2013


Repository : ssh://geoshell/calypso

On branch  : Hiro_latest
Link       : https://github.com/geodynamics/calypso/compare/93e9f8f974c7a247c8f02e54ec18de063f86c8fb...3c548304673360ddedd7d68c8095b3fb74a2b9ce

>---------------------------------------------------------------

commit f2586b4d657217e82f65b0a14e48e61a69c1477d
Author: Hiroaki Matsui <h_kemono at mac.com>
Date:   Tue Nov 12 11:59:29 2013 -0800

    Use temperature and compositional boundary spectra in m_boundary_params_sph_MHD


>---------------------------------------------------------------

f2586b4d657217e82f65b0a14e48e61a69c1477d
 .../MHD_src/sph_MHD/adjust_fixed_flux_sph.f90      | 12 ++--
 .../MHD_src/sph_MHD/cal_sol_sph_fluid_crank.f90    | 12 ++--
 .../MHD_src/sph_MHD/const_sph_diffusion.f90        | 36 ++++++-----
 .../MHD_src/sph_MHD/const_sph_divergence.f90       | 16 ++---
 .../MHD_src/sph_MHD/const_sph_radial_grad.f90      | 20 +++---
 .../MHD_src/sph_MHD/m_control_params_sph_MHD.f90   | 71 ----------------------
 .../MHD_src/sph_MHD/set_bc_sph_mhd.f90             | 16 ++---
 .../MHD_src/sph_MHD/set_bc_sph_scalars.f90         | 58 +++++++++---------
 .../MHD_src/sph_MHD/set_reference_sph_mhd.f90      | 22 ++++---
 .../MHD_src/sph_MHD/set_scalar_boundary_sph.f90    | 70 ++++++---------------
 10 files changed, 124 insertions(+), 209 deletions(-)

diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/adjust_fixed_flux_sph.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/adjust_fixed_flux_sph.f90
index 96e2c48..cd7911a 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/adjust_fixed_flux_sph.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/adjust_fixed_flux_sph.f90
@@ -39,10 +39,11 @@
       use m_physical_property
       use m_sph_phys_address
       use m_coef_fdm_fixed_ICB
+      use m_boundary_params_sph_MHD
 !
 !
       call adjust_in_fixed_flux_sph(nidx_rj(2), coef_fdm_fix_dr_ICB_2,  &
-     &    nlayer_ICB, h_flux_ICB_bc, coef_d_temp, coef_imp_t, dt,       &
+     &    nlayer_ICB, sph_bc_T%ICB_flux, coef_d_temp, coef_imp_t, dt,   &
      &    ipol%i_temp)
 !
       end subroutine adjust_icb_fix_h_flux_sph
@@ -56,10 +57,11 @@
       use m_physical_property
       use m_sph_phys_address
       use m_coef_fdm_fixed_CMB
+      use m_boundary_params_sph_MHD
 !
 !
       call adjust_out_fixed_flux_sph(nidx_rj(2), coef_fdm_fix_dr_CMB_2, &
-     &    nlayer_CMB, h_flux_CMB_bc, coef_d_temp, coef_imp_t, dt,       &
+     &    nlayer_CMB, sph_bc_T%CMB_flux, coef_d_temp, coef_imp_t, dt,   &
      &    ipol%i_temp)
 !
       end subroutine adjust_cmb_fix_h_flux_sph
@@ -74,10 +76,11 @@
       use m_physical_property
       use m_sph_phys_address
       use m_coef_fdm_fixed_ICB
+      use m_boundary_params_sph_MHD
 !
 !
       call adjust_in_fixed_flux_sph(nidx_rj(2), coef_fdm_fix_dr_ICB_2,  &
-     &    nlayer_ICB, c_flux_ICB_bc, coef_d_light, coef_imp_c, dt,      &
+     &    nlayer_ICB, sph_bc_C%ICB_flux, coef_d_light, coef_imp_c, dt,  &
      &    ipol%i_light)
 !
       end subroutine adjust_icb_fix_c_flux_sph
@@ -91,10 +94,11 @@
       use m_physical_property
       use m_sph_phys_address
       use m_coef_fdm_fixed_CMB
+      use m_boundary_params_sph_MHD
 !
 !
       call adjust_out_fixed_flux_sph(nidx_rj(2), coef_fdm_fix_dr_CMB_2, &
-     &    nlayer_CMB, c_flux_CMB_bc, coef_d_light, coef_imp_c, dt,      &
+     &    nlayer_CMB, sph_bc_C%CMB_flux, coef_d_light, coef_imp_c, dt,  &
      &    ipol%i_light)
 !
       end subroutine adjust_cmb_fix_c_flux_sph
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_sol_sph_fluid_crank.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_sol_sph_fluid_crank.f90
index 367fa5c..051d5e1 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_sol_sph_fluid_crank.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_sol_sph_fluid_crank.f90
@@ -230,13 +230,15 @@
       if (sph_bc_T%iflag_icb .eq. iflag_fixed_flux) then
         call adjust_icb_fix_h_flux_sph
       else
-        call set_icb_fix_temp_sph
+        call set_fixed_scalar_sph(nidx_rj(2), ione, nlayer_ICB,         &
+     &      ipol%i_temp, sph_bc_T%ICB_fld)
       end if
 !
       if (sph_bc_T%iflag_cmb .eq. iflag_fixed_flux) then
         call adjust_cmb_fix_h_flux_sph
       else
-        call set_cmb_fix_temp_sph
+        call set_fixed_scalar_sph(nidx_rj(2), nlayer_CMB, nidx_rj(1),   &
+     &      ipol%i_temp, sph_bc_T%CMB_fld)
       end if
 !
       call lubksb_3band_mul(np_smp, idx_rj_smp_stack(0,2),              &
@@ -257,13 +259,15 @@
       if (sph_bc_C%iflag_icb .eq. iflag_fixed_flux) then
         call adjust_icb_fix_c_flux_sph
       else
-        call set_icb_fix_composition_sph
+        call set_fixed_scalar_sph(nidx_rj(2), ione, nlayer_ICB,         &
+     &      ipol%i_light, sph_bc_C%ICB_fld)
       end if
 !
       if (sph_bc_C%iflag_cmb .eq. iflag_fixed_flux) then
         call adjust_cmb_fix_c_flux_sph
       else
-        call set_cmb_fix_composition_sph
+        call set_fixed_scalar_sph(nidx_rj(2), nlayer_CMB, nidx_rj(1),   &
+     &      ipol%i_light, sph_bc_C%CMB_fld)
       end if
 !
       call lubksb_3band_mul(np_smp, idx_rj_smp_stack(0,2),              &
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_diffusion.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_diffusion.f90
index ffe252d..bede760 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_diffusion.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_diffusion.f90
@@ -206,19 +206,23 @@
      &    coef_d_temp, ipol%i_temp, ipol%i_t_diffuse)
 !
       if (sph_bc_T%iflag_icb .eq. iflag_fixed_flux) then
-        call cal_sph_icb_fix_flux_diffuse2(nidx_rj(2), h_flux_ICB_bc,   &
-     &      coef_d_temp, ipol%i_temp, ipol%i_t_diffuse)
+        call cal_sph_icb_fix_flux_diffuse2                              &
+     &     (nidx_rj(2), sph_bc_T%ICB_flux, coef_d_temp,                 &
+     &      ipol%i_temp, ipol%i_t_diffuse)
       else
-        call cal_sph_icb_fix_scalar_diffuse2(nidx_rj(2), temp_ICB_bc,   &
-     &      coef_d_temp, ipol%i_temp, ipol%i_t_diffuse)
+        call cal_sph_icb_fix_scalar_diffuse2                            &
+     &     (nidx_rj(2), sph_bc_T%ICB_fld, coef_d_temp,                  &
+     &      ipol%i_temp, ipol%i_t_diffuse)
       end if
 !
       if (sph_bc_T%iflag_cmb .eq. iflag_fixed_flux) then
-        call cal_sph_cmb_fix_flux_diffuse2(nidx_rj(2), h_flux_CMB_bc,   &
-     &      coef_d_temp, ipol%i_temp, ipol%i_t_diffuse)
+        call cal_sph_cmb_fix_flux_diffuse2                              &
+     &     (nidx_rj(2), sph_bc_T%CMB_flux, coef_d_temp,                 &
+     &      ipol%i_temp, ipol%i_t_diffuse)
       else
-        call cal_sph_cmb_fix_scalar_diffuse2(nidx_rj(2), temp_CMB_bc,   &
-     &      coef_d_temp, ipol%i_temp, ipol%i_t_diffuse)
+        call cal_sph_cmb_fix_scalar_diffuse2                            &
+     &     (nidx_rj(2), sph_bc_T%CMB_fld, coef_d_temp,                  &
+     &      ipol%i_temp, ipol%i_t_diffuse)
       end if
 !
       end subroutine const_sph_thermal_diffusion
@@ -237,20 +241,22 @@
      &    coef_d_light, ipol%i_light, ipol%i_c_diffuse)
 !
       if (sph_bc_C%iflag_icb .eq. iflag_fixed_flux) then
-        call cal_sph_icb_fix_flux_diffuse2(nidx_rj(2), c_flux_ICB_bc,   &
-     &      coef_d_light, ipol%i_light, ipol%i_c_diffuse)
+        call cal_sph_icb_fix_flux_diffuse2                              &
+     &     (nidx_rj(2), sph_bc_C%ICB_flux, coef_d_light,                &
+     &      ipol%i_light, ipol%i_c_diffuse)
       else
         call cal_sph_icb_fix_scalar_diffuse2(nidx_rj(2),                &
-     &      composition_ICB_bc, coef_d_light,                           &
+     &      sph_bc_C%ICB_fld, coef_d_light,                             &
      &      ipol%i_light, ipol%i_c_diffuse)
       end if
 !
       if (sph_bc_C%iflag_cmb .eq. iflag_fixed_flux) then
-        call cal_sph_cmb_fix_flux_diffuse2(nidx_rj(2), c_flux_CMB_bc,   &
-     &      coef_d_light, ipol%i_light, ipol%i_c_diffuse)
+        call cal_sph_cmb_fix_flux_diffuse2                              &
+     &     (nidx_rj(2), sph_bc_C%CMB_flux, coef_d_light,                &
+     &      ipol%i_light, ipol%i_c_diffuse)
       else
-        call cal_sph_cmb_fix_scalar_diffuse2(nidx_rj(2),                &
-     &      composition_CMB_bc, coef_d_light,                           &
+        call cal_sph_cmb_fix_scalar_diffuse2                            &
+     &     (nidx_rj(2), sph_bc_C%CMB_fld, coef_d_light,                 &
      &      ipol%i_light, ipol%i_c_diffuse)
       end if
 !
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_divergence.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_divergence.f90
index a6c08c4..c41575a 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_divergence.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_divergence.f90
@@ -44,18 +44,18 @@
      &    ipol%i_h_flux, ipol%i_h_advect)
 !
       if (sph_bc_T%iflag_icb .eq. iflag_fixed_flux) then
-        call cal_div_sph_icb_fix_flux_2(nidx_rj(2), h_flux_ICB_bc,      &
+        call cal_div_sph_icb_fix_flux_2(nidx_rj(2), sph_bc_T%ICB_flux,  &
      &      ipol%i_h_flux, ipol%i_h_advect)
       else
-        call cal_sph_div_flux_4_icb_fix(nidx_rj(2), temp_ICB_bc,        &
+        call cal_sph_div_flux_4_icb_fix(nidx_rj(2), sph_bc_T%ICB_fld,   &
      &      ipol%i_h_flux, ipol%i_h_advect)
       end if
 !
       if (sph_bc_T%iflag_cmb .eq. iflag_fixed_flux) then
-        call cal_div_sph_cmb_fix_flux_2(nidx_rj(2), h_flux_CMB_bc,      &
+        call cal_div_sph_cmb_fix_flux_2(nidx_rj(2), sph_bc_T%CMB_flux,  &
      &      ipol%i_h_flux, ipol%i_h_advect)
       else
-        call cal_sph_div_flux_4_cmb_fix(nidx_rj(2), temp_CMB_bc,        &
+        call cal_sph_div_flux_4_cmb_fix(nidx_rj(2), sph_bc_T%CMB_fld,   &
      &      ipol%i_h_flux, ipol%i_h_advect)
       end if
 !
@@ -74,18 +74,18 @@
      &    ipol%i_c_flux, ipol%i_c_advect)
 !
       if (sph_bc_T%iflag_icb .eq. iflag_fixed_flux) then
-        call cal_div_sph_icb_fix_flux_2(nidx_rj(2), c_flux_ICB_bc,      &
+        call cal_div_sph_icb_fix_flux_2(nidx_rj(2), sph_bc_C%ICB_flux,  &
      &      ipol%i_c_flux, ipol%i_c_advect)
       else
-        call cal_sph_div_flux_4_icb_fix(nidx_rj(2), composition_ICB_bc, &
+        call cal_sph_div_flux_4_icb_fix(nidx_rj(2), sph_bc_C%ICB_fld,   &
      &      ipol%i_c_flux, ipol%i_c_advect)
       end if
 !
       if (sph_bc_T%iflag_cmb .eq. iflag_fixed_flux) then
-        call cal_div_sph_cmb_fix_flux_2(nidx_rj(2), c_flux_CMB_bc,      &
+        call cal_div_sph_cmb_fix_flux_2(nidx_rj(2), sph_bc_C%CMB_flux,  &
      &      ipol%i_c_flux, ipol%i_c_advect)
       else
-        call cal_sph_div_flux_4_icb_fix(nidx_rj(2), composition_CMB_bc, &
+        call cal_sph_div_flux_4_icb_fix(nidx_rj(2), sph_bc_C%CMB_fld,   &
      &      ipol%i_c_flux, ipol%i_c_advect)
       end if
 !
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_radial_grad.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_radial_grad.f90
index 3091603..38d1a71 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_radial_grad.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/const_sph_radial_grad.f90
@@ -65,19 +65,19 @@
      &    d_rj(1,ipol%i_temp), d_rj(1,ipol%i_grad_t) )
 !
       if (sph_bc_T%iflag_icb .eq. iflag_fixed_flux) then
-        call cal_dsdr_sph_icb_fix_flux_2(nidx_rj(2), h_flux_ICB_bc,     &
+        call cal_dsdr_sph_icb_fix_flux_2(nidx_rj(2), sph_bc_T%ICB_flux, &
      &      ipol%i_temp, ipol%i_grad_t)
       else
-        call cal_dsdr_sph_icb_fix_scalar_2(nidx_rj(2), temp_ICB_bc,     &
-     &      ipol%i_temp, ipol%i_grad_t)
+        call cal_dsdr_sph_icb_fix_scalar_2                              &
+     &     (nidx_rj(2), sph_bc_T%ICB_fld, ipol%i_temp, ipol%i_grad_t)
       end if
 !
       if (sph_bc_T%iflag_cmb .eq. iflag_fixed_flux) then
-        call cal_dsdr_sph_cmb_fix_flux_2(nidx_rj(2), h_flux_CMB_bc,     &
+        call cal_dsdr_sph_cmb_fix_flux_2(nidx_rj(2), sph_bc_T%CMB_flux, &
      &      ipol%i_temp, ipol%i_grad_t)
       else
-        call cal_dsdr_sph_cmb_fix_scalar_2(nidx_rj(2), temp_CMB_bc,     &
-     &      ipol%i_temp, ipol%i_grad_t)
+        call cal_dsdr_sph_cmb_fix_scalar_2                              &
+     &     (nidx_rj(2), sph_bc_T%CMB_fld, ipol%i_temp, ipol%i_grad_t)
       end if
 !
       end subroutine const_radial_grad_temp
@@ -96,19 +96,19 @@
      &     d_rj(1,ipol%i_light), d_rj(1,ipol%i_grad_composit) )
 !
       if (sph_bc_T%iflag_icb .eq. iflag_fixed_flux) then
-        call cal_dsdr_sph_icb_fix_flux_2(nidx_rj(2), c_flux_ICB_bc,     &
+        call cal_dsdr_sph_icb_fix_flux_2(nidx_rj(2), sph_bc_C%ICB_flux, &
      &      ipol%i_light, ipol%i_grad_composit)
       else
         call cal_dsdr_sph_icb_fix_scalar_2(nidx_rj(2),                  &
-     &      composition_ICB_bc, ipol%i_light, ipol%i_grad_composit)
+     &      sph_bc_C%ICB_fld, ipol%i_light, ipol%i_grad_composit)
       end if
 !
       if (sph_bc_T%iflag_cmb .eq. iflag_fixed_flux) then
-        call cal_dsdr_sph_cmb_fix_flux_2(nidx_rj(2), c_flux_CMB_bc,     &
+        call cal_dsdr_sph_cmb_fix_flux_2(nidx_rj(2), sph_bc_C%CMB_flux, &
      &      ipol%i_light, ipol%i_grad_composit)
       else
         call cal_dsdr_sph_cmb_fix_scalar_2(nidx_rj(2),                  &
-     &       composition_CMB_bc, ipol%i_light, ipol%i_grad_composit)
+     &       sph_bc_C%CMB_fld, ipol%i_light, ipol%i_grad_composit)
       end if
 !
       end subroutine const_radial_grad_composit
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/m_control_params_sph_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/m_control_params_sph_MHD.f90
index 8e4197e..318b3e4 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/m_control_params_sph_MHD.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/m_control_params_sph_MHD.f90
@@ -47,25 +47,6 @@
 !>      Fixed toroidal velocity spectrum for CMB
       real(kind= kreal), allocatable :: vt_CMB_bc(:)
 !
-!>      Fixed temperature spectrum for ICB
-      real(kind= kreal), allocatable :: temp_ICB_bc(:)
-!>      Fixed temperature spectrum for CMB
-      real(kind= kreal), allocatable :: temp_CMB_bc(:)
-!>      Fixed heat flux spectrum for ICB
-      real(kind= kreal), allocatable :: h_flux_ICB_bc(:)
-!>      Fixed heat flux spectrum for CMB
-      real(kind= kreal), allocatable :: h_flux_CMB_bc(:)
-!
-!>      Fixed composition spectrum for ICB
-      real(kind= kreal), allocatable :: composition_ICB_bc(:)
-!>      Fixed composition spectrum for CMB
-      real(kind= kreal), allocatable :: composition_CMB_bc(:)
-!>      Fixed composition flux spectrum for ICB
-      real(kind= kreal), allocatable :: c_flux_ICB_bc(:)
-!>      Fixed composition flux spectrum for CMB
-      real(kind= kreal), allocatable :: c_flux_CMB_bc(:)
-!
-!
       integer(kind = kint) :: iflag_sph_coriolis_file = 0
 !
 !>      Number of grid points in zonal direction for dynamo benchmark
@@ -93,40 +74,6 @@
       end subroutine allocate_vsp_bc_array
 !
 ! -----------------------------------------------------------------------
-!
-      subroutine allocate_temp_bc_array(jmax)
-!
-      integer(kind= kint), intent(in) :: jmax
-!
-      allocate(temp_ICB_bc(jmax))
-      allocate(temp_CMB_bc(jmax))
-      allocate(h_flux_ICB_bc(jmax))
-      allocate(h_flux_CMB_bc(jmax))
-      temp_ICB_bc = 0.0d0
-      temp_CMB_bc = 0.0d0
-      h_flux_ICB_bc = 0.0d0
-      h_flux_CMB_bc = 0.0d0
-!
-      end subroutine allocate_temp_bc_array
-!
-! -----------------------------------------------------------------------
-!
-      subroutine allocate_dscalar_bc_array(jmax)
-!
-      integer(kind= kint), intent(in) :: jmax
-!
-      allocate(composition_ICB_bc(jmax))
-      allocate(composition_CMB_bc(jmax))
-      allocate(c_flux_ICB_bc(jmax))
-      allocate(c_flux_CMB_bc(jmax))
-      composition_ICB_bc = 0.0d0
-      composition_CMB_bc = 0.0d0
-      c_flux_ICB_bc = 0.0d0
-      c_flux_CMB_bc = 0.0d0
-!
-      end subroutine allocate_dscalar_bc_array
-!
-! -----------------------------------------------------------------------
 ! -----------------------------------------------------------------------
 !
       subroutine deallocate_vsp_bc_array
@@ -138,22 +85,4 @@
 !
 ! -----------------------------------------------------------------------
 !
-      subroutine deallocate_temp_bc_array
-!
-      deallocate(temp_ICB_bc,   temp_CMB_bc)
-      deallocate(h_flux_ICB_bc, h_flux_CMB_bc)
-!
-      end subroutine deallocate_temp_bc_array
-!
-! -----------------------------------------------------------------------
-!
-      subroutine deallocate_dscalar_bc_array
-!
-      deallocate(composition_ICB_bc, composition_CMB_bc)
-      deallocate(c_flux_ICB_bc,  c_flux_CMB_bc)
-!
-      end subroutine deallocate_dscalar_bc_array
-!
-! -----------------------------------------------------------------------
-!
       end module m_control_params_sph_MHD
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90
index 2ccaeee..616ac69 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90
@@ -167,13 +167,13 @@
         if(sph_bc_T%iflag_icb .eq. iflag_fixed_field) then
           do i = 1, nidx_rj(2)
             write(*,*) 'temp_ICB', idx_gl_1d_rj_j(i,1:3),               &
-     &                  temp_ICB_bc(i)
+     &                  sph_bc_T%ICB_fld(i)
           end do
         end if
         if(sph_bc_T%iflag_icb .eq. iflag_fixed_flux) then
           do i = 1, nidx_rj(2)
             write(*,*) 'heat_flux_ICB', idx_gl_1d_rj_j(i,1:3),          &
-     &                  h_flux_ICB_bc(i)
+     &                  sph_bc_T%ICB_flux(i)
           end do
         end if
 !
@@ -181,13 +181,13 @@
         if(sph_bc_T%iflag_cmb .eq. iflag_fixed_field) then
           do i = 1, nidx_rj(2)
             write(*,*) 'temp_CMB', idx_gl_1d_rj_j(i,1:3),               &
-     &                  temp_CMB_bc(i)
+     &                  sph_bc_T%CMB_fld(i)
           end do
         end if
         if(sph_bc_T%iflag_cmb .eq. iflag_fixed_flux) then
           do i = 1, nidx_rj(2)
             write(*,*) 'heat_flux_CMB', idx_gl_1d_rj_j(i,1:3),          &
-     &                  h_flux_CMB_bc(i)
+     &                  sph_bc_T%CMB_flux(i)
           end do
         end if
 !
@@ -210,13 +210,13 @@
         if(sph_bc_C%iflag_icb .eq. iflag_fixed_field) then
           do i = 1, nidx_rj(2)
             write(*,*) 'comp_ICB', idx_gl_1d_rj_j(i,1:3),               &
-     &                  composition_ICB_bc(i)
+     &                  sph_bc_C%ICB_fld(i)
           end do
         end if
         if(sph_bc_C%iflag_icb .eq. iflag_fixed_flux) then
           do i = 1, nidx_rj(2)
             write(*,*) 'comp_flux_ICB', idx_gl_1d_rj_j(i,1:3),          &
-     &                  c_flux_ICB_bc(i)
+     &                  sph_bc_C%ICB_flux(i)
           end do
         end if
 !
@@ -224,13 +224,13 @@
         if(sph_bc_C%iflag_cmb .eq. iflag_fixed_field) then
           do i = 1, nidx_rj(2)
             write(*,*) 'comp_CMB', idx_gl_1d_rj_j(i,1:3),               &
-     &                  composition_CMB_bc(i)
+     &                  sph_bc_C%CMB_fld(i)
           end do
         end if
         if(sph_bc_C%iflag_cmb .eq. iflag_fixed_flux) then
           do i = 1, nidx_rj(2)
             write(*,*) 'comp_flux_CMB', idx_gl_1d_rj_j(i,1:3),          &
-     &                  c_flux_CMB_bc(i)
+     &                  sph_bc_C%CMB_flux(i)
           end do
         end if
 !
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_scalars.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_scalars.f90
index 84194f2..86893f4 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_scalars.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_scalars.f90
@@ -46,25 +46,25 @@
       integer(kind = kint) :: i
 !
 !
-      call allocate_temp_bc_array( nidx_rj(2) )
+      call alloc_fixed_bc_array(nidx_rj(2), sph_bc_T)
 !
       do i = 1, h_flux_surf%num_bc
         if ( h_flux_surf%ibc_type(i)  .eq. iflag_bc_fix_s) then
           call set_homogenious_grad_bc                                  &
      &       (ICB_nod_grp_name, ICB_sf_grp_name,                        &
      &        h_flux_surf%bc_name(i), h_flux_surf%bc_magnitude(i),      &
-     &        nidx_rj(2), h_flux_ICB_bc, sph_bc_T%iflag_icb)
+     &        nidx_rj(2), sph_bc_T%ICB_flux, sph_bc_T%iflag_icb)
           call set_homogenious_grad_bc                                  &
      &       (CMB_nod_grp_name, CMB_sf_grp_name,                        &
      &        h_flux_surf%bc_name(i), h_flux_surf%bc_magnitude(i),      &
-     &        nidx_rj(2), h_flux_CMB_bc, sph_bc_T%iflag_cmb)
+     &        nidx_rj(2), sph_bc_T%CMB_flux, sph_bc_T%iflag_cmb)
         else if (h_flux_surf%ibc_type(i)  .eq. iflag_bc_file_s) then
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_temp, ICB_nod_grp_name, ICB_sf_grp_name,              &
-     &        nidx_rj(2), h_flux_ICB_bc, sph_bc_T%iflag_icb)
+     &        nidx_rj(2), sph_bc_T%ICB_flux, sph_bc_T%iflag_icb)
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_temp, CMB_nod_grp_name, CMB_sf_grp_name,              &
-     &        nidx_rj(2), h_flux_CMB_bc, sph_bc_T%iflag_cmb)
+     &        nidx_rj(2), sph_bc_T%CMB_flux, sph_bc_T%iflag_cmb)
         else if ( h_flux_surf%ibc_type(i) .eq. iflag_sph_2_center       &
      &       .and. h_flux_surf%bc_name(i) .eq. CTR_sf_grp_name) then
          sph_bc_T%iflag_icb = iflag_sph_fill_center
@@ -79,34 +79,34 @@
           call set_homogenious_grad_bc                                  &
      &       (ICB_nod_grp_name, ICB_sf_grp_name,                        &
      &        temp_nod%bc_name(i), temp_nod%bc_magnitude(i),            &
-     &        nidx_rj(2), h_flux_ICB_bc, sph_bc_T%iflag_icb)
+     &        nidx_rj(2), sph_bc_T%ICB_flux, sph_bc_T%iflag_icb)
           call set_homogenious_grad_bc                                  &
      &       (CMB_nod_grp_name, CMB_sf_grp_name,                        &
      &        temp_nod%bc_name(i), temp_nod%bc_magnitude(i),            &
-     &        nidx_rj(2), h_flux_CMB_bc, sph_bc_T%iflag_cmb)
+     &        nidx_rj(2), sph_bc_T%CMB_flux, sph_bc_T%iflag_cmb)
 !
         else if ( temp_nod%ibc_type(i)  .eq. iflag_bc_file_flux) then
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_h_flux, ICB_nod_grp_name, ICB_sf_grp_name,            &
-     &        nidx_rj(2), h_flux_ICB_bc, sph_bc_T%iflag_icb)
+     &        nidx_rj(2), sph_bc_T%ICB_flux, sph_bc_T%iflag_icb)
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_h_flux, CMB_nod_grp_name, CMB_sf_grp_name,            &
-     &        nidx_rj(2), h_flux_CMB_bc, sph_bc_T%iflag_cmb)
+     &        nidx_rj(2), sph_bc_T%CMB_flux, sph_bc_T%iflag_cmb)
 !
 !
         else if ( temp_nod%ibc_type(i)  .eq. iflag_bc_fix_s) then
           call set_homogenious_scalar_bc(ICB_nod_grp_name,              &
      &        temp_nod%bc_name(i), temp_nod%bc_magnitude(i),            &
-     &        nidx_rj(2), temp_ICB_bc, sph_bc_T%iflag_icb)
+     &        nidx_rj(2), sph_bc_T%ICB_fld, sph_bc_T%iflag_icb)
           call set_homogenious_scalar_bc(CMB_nod_grp_name,              &
      &        temp_nod%bc_name(i), temp_nod%bc_magnitude(i),            &
-     &        nidx_rj(2), temp_CMB_bc, sph_bc_T%iflag_cmb)
+     &        nidx_rj(2), sph_bc_T%CMB_fld, sph_bc_T%iflag_cmb)
 !
         else if ( temp_nod%ibc_type(i)  .eq. iflag_bc_file_s) then
           call set_fixed_scalar_bc_by_file(fhd_temp, ICB_nod_grp_name,  &
-     &        nidx_rj(2), temp_ICB_bc, sph_bc_T%iflag_icb)
+     &        nidx_rj(2), sph_bc_T%ICB_fld, sph_bc_T%iflag_icb)
           call set_fixed_scalar_bc_by_file(fhd_temp, CMB_nod_grp_name,  &
-     &        nidx_rj(2), temp_CMB_bc, sph_bc_T%iflag_cmb)
+     &        nidx_rj(2), sph_bc_T%CMB_fld, sph_bc_T%iflag_cmb)
 !
         else if ( temp_nod%ibc_type(i) .eq. iflag_sph_2_center          &
      &       .and. temp_nod%bc_name(i) .eq. CTR_sf_grp_name) then
@@ -117,7 +117,8 @@
         end if
       end do
 !
-      h_flux_ICB_bc(1:nidx_rj(2)) = - h_flux_ICB_bc(1:nidx_rj(2))
+      sph_bc_T%ICB_flux(1:nidx_rj(2))                                   &
+     &      = -sph_bc_T%ICB_flux(1:nidx_rj(2))
 !
       end subroutine set_sph_bc_temp_sph
 !
@@ -135,7 +136,7 @@
       integer(kind = kint) :: i
 !
 !
-      call allocate_dscalar_bc_array( nidx_rj(2) )
+      call alloc_fixed_bc_array(nidx_rj(2), sph_bc_C)
 !
 !      Boundary setting using surface group data
 !
@@ -144,18 +145,18 @@
           call set_homogenious_grad_bc                                  &
      &       (ICB_nod_grp_name, ICB_sf_grp_name,                        &
      &        light_surf%bc_name(i), light_surf%bc_magnitude(i),        &
-     &        nidx_rj(2), c_flux_ICB_bc, sph_bc_C%iflag_icb)
+     &        nidx_rj(2), sph_bc_C%ICB_flux, sph_bc_C%iflag_icb)
           call set_homogenious_grad_bc                                  &
      &       (CMB_nod_grp_name, CMB_sf_grp_name,                        &
      &        light_surf%bc_name(i), light_surf%bc_magnitude(i),        &
-     &        nidx_rj(2), c_flux_CMB_bc, sph_bc_C%iflag_cmb)
+     &        nidx_rj(2), sph_bc_C%CMB_flux, sph_bc_C%iflag_cmb)
         else if (light_surf%ibc_type(i)  .eq. iflag_bc_file_s) then
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_light, ICB_nod_grp_name, ICB_sf_grp_name,             &
-     &        nidx_rj(2), c_flux_ICB_bc, sph_bc_C%iflag_icb)
+     &        nidx_rj(2), sph_bc_C%ICB_flux, sph_bc_C%iflag_icb)
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_light, CMB_nod_grp_name, CMB_sf_grp_name,             &
-     &        nidx_rj(2), c_flux_CMB_bc, sph_bc_C%iflag_cmb)
+     &        nidx_rj(2), sph_bc_C%CMB_flux, sph_bc_C%iflag_cmb)
         else if ( light_surf%ibc_type(i) .eq. iflag_sph_2_center        &
      &       .and. light_surf%bc_name(i) .eq. CTR_sf_grp_name) then
           sph_bc_C%iflag_icb = iflag_sph_fill_center
@@ -172,34 +173,34 @@
           call set_homogenious_grad_bc                                  &
      &       (ICB_nod_grp_name, ICB_sf_grp_name,                        &
      &        light_nod%bc_name(i), light_nod%bc_magnitude(i),          &
-     &        nidx_rj(2), c_flux_ICB_bc, sph_bc_C%iflag_icb)
+     &        nidx_rj(2), sph_bc_C%ICB_flux, sph_bc_C%iflag_icb)
           call set_homogenious_grad_bc                                  &
      &       (CMB_nod_grp_name, CMB_sf_grp_name,                        &
      &        light_nod%bc_name(i), light_nod%bc_magnitude(i),          &
-     &        nidx_rj(2), c_flux_CMB_bc, sph_bc_C%iflag_cmb)
+     &        nidx_rj(2), sph_bc_C%CMB_flux, sph_bc_C%iflag_cmb)
 !
         else if ( light_nod%ibc_type(i)  .eq. iflag_bc_file_flux) then
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_c_flux, ICB_nod_grp_name, ICB_sf_grp_name,            &
-     &        nidx_rj(2), c_flux_ICB_bc, sph_bc_C%iflag_icb)
+     &        nidx_rj(2), sph_bc_C%ICB_flux, sph_bc_C%iflag_icb)
           call set_fixed_gradient_bc_by_file                            &
      &       (fhd_c_flux, CMB_nod_grp_name, CMB_sf_grp_name,            &
-     &        nidx_rj(2), c_flux_CMB_bc, sph_bc_C%iflag_cmb)
+     &        nidx_rj(2), sph_bc_C%CMB_flux, sph_bc_C%iflag_cmb)
 !
 !
         else if ( light_nod%ibc_type(i)  .eq. iflag_bc_fix_s) then
           call set_homogenious_scalar_bc(ICB_nod_grp_name,              &
      &        light_nod%bc_name(i), light_nod%bc_magnitude(i),          &
-     &        nidx_rj(2), composition_ICB_bc, sph_bc_C%iflag_icb)
+     &        nidx_rj(2), sph_bc_C%ICB_fld, sph_bc_C%iflag_icb)
           call set_homogenious_scalar_bc(CMB_nod_grp_name,              &
      &        light_nod%bc_name(i), light_nod%bc_magnitude(i),          &
-     &        nidx_rj(2), composition_CMB_bc, sph_bc_C%iflag_cmb)
+     &        nidx_rj(2), sph_bc_C%CMB_fld, sph_bc_C%iflag_cmb)
 !
         else if ( light_nod%ibc_type(i)  .eq. iflag_bc_file_s) then
           call set_fixed_scalar_bc_by_file(fhd_light, ICB_nod_grp_name, &
-     &        nidx_rj(2), composition_ICB_bc, sph_bc_C%iflag_icb)
+     &        nidx_rj(2), sph_bc_C%ICB_fld, sph_bc_C%iflag_icb)
           call set_fixed_scalar_bc_by_file(fhd_light, CMB_nod_grp_name, &
-     &        nidx_rj(2), composition_CMB_bc, sph_bc_C%iflag_cmb)
+     &        nidx_rj(2), sph_bc_C%CMB_fld, sph_bc_C%iflag_cmb)
 !
         else if ( light_nod%ibc_type(i) .eq. iflag_sph_2_center         &
      &       .and. light_nod%bc_name(i) .eq. CTR_sf_grp_name) then
@@ -210,7 +211,8 @@
         end if
       end do
 !
-      c_flux_ICB_bc(1:nidx_rj(2)) = -c_flux_ICB_bc(1:nidx_rj(2))
+      sph_bc_C%ICB_flux(1:nidx_rj(2))                                   &
+     &      = -sph_bc_C%ICB_flux(1:nidx_rj(2))
 !
       end subroutine set_sph_bc_composition_sph
 !
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_reference_sph_mhd.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_reference_sph_mhd.f90
index 867ca54..e46b913 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/set_reference_sph_mhd.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_reference_sph_mhd.f90
@@ -173,19 +173,23 @@
 !
       use m_spheric_parameter
       use m_sph_spectr_data
-      use m_control_params_sph_MHD
+      use m_boundary_params_sph_MHD
 !
 !
       if(idx_rj_degree_zero .gt. 0                                      &
      &      .and. iflag_4_ref_temp .eq. id_sphere_ref_temp) then
-        temp_ICB_bc(idx_rj_degree_zero)                                 &
-     &   = temp_ICB_bc(idx_rj_degree_zero) - reftemp_rj(nlayer_ICB,0)
-        temp_CMB_bc(idx_rj_degree_zero)                                 &
-     &   = temp_CMB_bc(idx_rj_degree_zero) - reftemp_rj(nlayer_CMB,0)
-        h_flux_ICB_bc(idx_rj_degree_zero)                               &
-     &   = h_flux_ICB_bc(idx_rj_degree_zero) - reftemp_rj(nlayer_ICB,1)
-        h_flux_CMB_bc(idx_rj_degree_zero)                               &
-     &   = h_flux_CMB_bc(idx_rj_degree_zero) - reftemp_rj(nlayer_CMB,1)
+        sph_bc_T%ICB_fld(idx_rj_degree_zero)                            &
+     &   = sph_bc_T%ICB_fld(idx_rj_degree_zero)                         &
+     &    - reftemp_rj(nlayer_ICB,0)
+        sph_bc_T%CMB_fld(idx_rj_degree_zero)                            &
+     &   = sph_bc_T%CMB_fld(idx_rj_degree_zero)                         &
+     &     - reftemp_rj(nlayer_CMB,0)
+        sph_bc_T%ICB_flux(idx_rj_degree_zero)                           &
+     &   = sph_bc_T%ICB_flux(idx_rj_degree_zero)                        &
+     &    - reftemp_rj(nlayer_ICB,1)
+        sph_bc_T%CMB_flux(idx_rj_degree_zero)                           &
+     &   = sph_bc_T%CMB_flux(idx_rj_degree_zero)                        &
+     &    - reftemp_rj(nlayer_CMB,1)
       end if
 !
       end subroutine adjust_sph_temp_bc_by_reftemp
diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_scalar_boundary_sph.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_scalar_boundary_sph.f90
index fdedd75..d4deeaa 100644
--- a/src/Fortran_libraries/MHD_src/sph_MHD/set_scalar_boundary_sph.f90
+++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_scalar_boundary_sph.f90
@@ -8,16 +8,22 @@
 !!
 !!@verbatim
 !!      subroutine set_icb_fix_temp_sph
-!!      subroutine set_cmb_fix_temp_sph
 !!      subroutine set_icb_fix_h_flux_sph
 !!      subroutine set_cmb_fix_h_flux_sph
 !!
-!!      subroutine set_icb_fix_composition_sph
-!!      subroutine set_cmb_fix_composition_sph
 !!      subroutine set_icb_fix_c_flux_sph
 !!      subroutine set_cmb_fix_c_flux_sph
+!!
+!!      subroutine set_fixed_scalar_sph(jmax, kr_bc_st, kr_bc_ed,       &
+!!     &          is_fld, fixed_bc)
 !!@endverbatim
-!
+!!
+!!@param  jmax        Number of modes for local spectrum
+!!@param  kr_bc_st    Start radial address to set fixed field
+!!@param  kr_bc_ed    End radial address to set fixed field
+!!@param  is_fld           Field address
+!!@param  fixed_bc(jmax)   Boundary condition spectrum
+!!
       module set_scalar_boundary_sph
 !
       use m_precision
@@ -30,40 +36,18 @@
 !
       implicit none
 !
-      private :: set_fixed_scalar_sph
-!
 ! -----------------------------------------------------------------------
 !
       contains
 !
 ! -----------------------------------------------------------------------
 !
-      subroutine set_icb_fix_temp_sph
-!
-!
-      call set_fixed_scalar_sph(nidx_rj(2), ione, nlayer_ICB,           &
-     &    ipol%i_temp, temp_ICB_bc)
-!
-      end subroutine set_icb_fix_temp_sph
-!
-! -----------------------------------------------------------------------
-!
-      subroutine set_cmb_fix_temp_sph
-!
-!
-      call set_fixed_scalar_sph(nidx_rj(2), nlayer_CMB, nidx_rj(1),     &
-     &    ipol%i_temp, temp_CMB_bc)
-!
-      end subroutine set_cmb_fix_temp_sph
-!
-! -----------------------------------------------------------------------
-! -----------------------------------------------------------------------
-!
       subroutine set_icb_fix_h_flux_sph
 !
+      use m_boundary_params_sph_MHD
 !
       call set_fixed_scalar_sph(nidx_rj(2), ione, nlayer_ICB,           &
-     &    ipol%i_grad_t, h_flux_ICB_bc)
+     &    ipol%i_grad_t, sph_bc_T%ICB_flux)
 !
       end subroutine set_icb_fix_h_flux_sph
 !
@@ -71,41 +55,22 @@
 !
       subroutine set_cmb_fix_h_flux_sph
 !
+      use m_boundary_params_sph_MHD
 !
       call set_fixed_scalar_sph(nidx_rj(2), nlayer_CMB, nidx_rj(1),     &
-     &    ipol%i_grad_t, h_flux_CMB_bc)
+     &    ipol%i_grad_t, sph_bc_T%CMB_flux)
 !
       end subroutine set_cmb_fix_h_flux_sph
 !
 ! -----------------------------------------------------------------------
 ! -----------------------------------------------------------------------
 !
-      subroutine set_icb_fix_composition_sph
-!
-!
-      call set_fixed_scalar_sph(nidx_rj(2), ione, nlayer_ICB,           &
-     &    ipol%i_light, composition_ICB_bc)
-!
-      end subroutine set_icb_fix_composition_sph
-!
-! -----------------------------------------------------------------------
-!
-      subroutine set_cmb_fix_composition_sph
-!
-!
-      call set_fixed_scalar_sph(nidx_rj(2), nlayer_CMB, nidx_rj(1),     &
-     &    ipol%i_light, composition_CMB_bc)
-!
-      end subroutine set_cmb_fix_composition_sph
-!
-! -----------------------------------------------------------------------
-! -----------------------------------------------------------------------
-!
       subroutine set_icb_fix_c_flux_sph
 !
+      use m_boundary_params_sph_MHD
 !
       call set_fixed_scalar_sph(nidx_rj(2), ione, nlayer_ICB,           &
-     &    ipol%i_grad_composit, c_flux_ICB_bc)
+     &    ipol%i_grad_composit, sph_bc_C%ICB_flux)
 !
       end subroutine set_icb_fix_c_flux_sph
 !
@@ -113,9 +78,10 @@
 !
       subroutine set_cmb_fix_c_flux_sph
 !
+      use m_boundary_params_sph_MHD
 !
       call set_fixed_scalar_sph(nidx_rj(2), nlayer_CMB, nidx_rj(1),     &
-     &    ipol%i_grad_composit, c_flux_CMB_bc)
+     &    ipol%i_grad_composit, sph_bc_C%CMB_flux)
 !
       end subroutine set_cmb_fix_c_flux_sph
 !



More information about the CIG-COMMITS mailing list