24小时热门版块排行榜     石溪大学接受考研调剂申请>

【调剂】北京石油化工学院2024年16个专业接受调剂
查看: 609  |  回复: 0
【悬赏金币】回答本帖问题,作者rlafite将赠送您 60 个金币

rlafite

木虫 (正式写手)

[求助] 这段F90代码如何用OpenMP并行运算?

这段代码如何用openmp并行运算?(附件是全模块) 并保证不溢出16gb内存
全套程序下载地址如下:
http://www.atomic-theory.uni-jen ... ange/ratip-2012.tgz

subroutine auger_calculate_amplitudes()
   !--------------------------------------------------------------------
   ! calculates for all transitions in turn the required continuum
   ! spinors and auger amplitudes.
   !
   ! calls: add_csf_to_basis(), anco_calculate_csf_matrix(),
   ! auger_channel_amplitude(), auger_pure_matrix(),
   ! auger_transition_properties() cowf_iterate_csp(),
   ! cowf_set_xk_coefficients(), cowf_set_yk_coefficients(),
   ! print_configuration_scheme()
   ! set_configuration_scheme().
   !--------------------------------------------------------------------
      !
      integer       :: i, j, n, nw, nocsf
      real(kind=dp) :: energy
      type(nkappa)  :: subshell
      integer, dimension(, allocatable :: ndx
      !
      n = asf_final%csf_set%nocsf + asf_initial%csf_set%nocsf
      !
      ! allocate for a "first time"; it is first dellocated before any usage
      allocate( auger_csp%p(1:n_grasp92), auger_csp%q(1:n_grasp92) )
      allocate( cowf_csp%p(1:10), cowf_csp%q(1:10) )
      allocate( ndx(1:n) )
      do  i = 1,number_of_transitions
         if (transition(i)%energy < zero) then
            transition(i)%probability = zero
            transition(i)%alpha_2     = zero
            transition(i)%alpha_4     = zero
            transition(i)%eta_2       = zero
            transition(i)%eta_4       = zero
            cycle
         end if
         !
         do  j = 1,transition(i)%number_of_channels
            energy = transition(i)%energy
            !!x print *, "auger_calculate_amplitudes - a"
            call set_configuration_scheme(asf_final%csf_set,asf_cont%csf_set,&
                     -1,transition(i)%channel(j)%kappa,                      &
                     transition(i)%totalj_f,transition(i)%parity_f,          &
                     transition(i)%totalj_i,transition(i)%parity_i,          &
                     append=.false.,index=ndx)
            !
            auger%no_f = asf_cont%csf_set%nocsf
            allocate( auger%ndx_f(auger%no_f) )
            auger%ndx_f(1:auger%no_f) = ndx(1:auger%no_f)
            !
            nw = asf_cont%csf_set%nwshells
            if (rabs_use_stop  .and. nw /= asf_final%csf_set%nwshells + 1) then
               stop "auger_calculate_amplitudes(): program stop a."
            end if
            ! calculate the mcp coefficients for the current coupling scheme
            ! as well as the d_rs,  y_k(ab), and x_k(abcd) coefficients
            nocsf = asf_cont%csf_set%nocsf
            call anco_calculate_csf_matrix(asf_cont%csf_set,1,nocsf,1,nocsf)
            call cowf_set_drs_coefficients(transition(i)%asff,             &
                                           asf_cont%csf_set,ndx)
            subshell = nkappa(-1,transition(i)%channel(j)%kappa)
            call cowf_set_yk_coefficients(subshell,asf_cont%csf_set)
            !!x print *, "auger_calculate_amplitudes - f"
            call cowf_set_xk_coefficients(subshell,asf_cont%csf_set)
            !!x print *, "auger_calculate_amplitudes - g"
            !
            ! now iterate the continuum spinors for this channel
            ! cowf_solve_homogeneous_eqn     = .true.
            cowf_start_homogeneous         = .true.
            cowf_phaseshift_wkb            = .true.
            cowf_phaseshift_zero_potential = .false.
            cowf_phaseshift_coulomb        = .false.
            !
            !! cowf_norm_nonrel               = .true.
            cowf_norm_wkb                  = .true.
            call cowf_iterate_csp(energy,subshell)
            !
            auger_csp = cowf_csp
            transition(i)%channel(j)%phase = auger_csp%phase
            !
            ! define the 'extended' configuration scheme for calculating
            ! the auger matrix and allocate memory
            call add_csf_to_basis(asf_initial%csf_set,asf_cont%csf_set,      &
                     transition(i)%totalj_i,transition(i)%parity_i,index=ndx)
            if (auger_print_csf_scheme) then
               call print_configuration_scheme(6,asf_cont%csf_set)
            end if
            !
            auger%no_i = asf_cont%csf_set%nocsf - auger%no_f
            allocate( auger%ndx_i(auger%no_i) )
            auger%ndx_i(1:auger%no_i) = ndx(1+auger%no_f:asf_cont%csf_set%nocsf)
            allocate( auger%matrix(1:auger%no_f,1:auger%no_i) )
            !
            ! calculate the 'pure' auger matrix in the given csf scheme
            ! (not including mixing coefficients)
            call auger_pure_matrix(asf_cont%csf_set,i)
            !
            call auger_channel_amplitude(i,j)
            !
            deallocate( auger%ndx_f, auger%ndx_i, auger%matrix  )
            call deallocate_csf_basis(asf_cont%csf_set)
         end do
         !
         ! calculates all selected properties for the selected transition
         call auger_transition_properties(transition(i))
      end do
      deallocate( ndx, auger_csp%p, auger_csp%q)
      !
   end subroutine auger_calculate_amplitudes
   !
   !
   subroutine auger_channel_amplitude(i,j)
   !--------------------------------------------------------------------
   ! calculates the auger amplitude of channel j of transition i
   ! by summing over the 'pure' auger matrix using the proper weights of
   ! transition i.
   !
   ! calls:
   !--------------------------------------------------------------------
      !
      integer, intent(in) :: i, j
      !
      integer       :: asfi, asff, l, r, rr, s, ss
      real(kind=dp) :: phase, value
      !
      if (auger_print_main_csf_me) then
         print *, " "
         print *, "main contribution from initial- and final-state csf "// &
                  "(abs(c_i*c_f) > 0.01)"
         print *, "----------------------------------------------------"// &
                  "---------------------"
         print *, " "
         print *, "   i-csf     f-csf   kappa    c_i     c_f       c_i*c_f"//&
                  "   c_i*c_f*a_if  "
         print *, "-------------------------------------------------------"//&
                  "-----------------"
      end if
      !
      asfi  = transition(i)%asfi;  asff = transition(i)%asff
      value = zero
      do  r = 1,auger%no_f
         rr = auger%ndx_f(r)
         do  s = 1,auger%no_i
            ss = auger%ndx_i(s)
            value = value + asf_final%asf(asff)%eigenvector(rr) * &
                    auger%matrix(r,s) * asf_initial%asf(asfi)%eigenvector(ss)
            !
            if (auger_print_main_csf_me) then
               if (abs(asf_final%asf(asff)%eigenvector(rr)*                   &
                       asf_initial%asf(asfi)%eigenvector(ss)) > 0.01_dp  .and.&
                   abs(asf_final%asf(asff)%eigenvector(rr) *                  &
                       auger%matrix(r,s) *                                    &
                   asf_initial%asf(asfi)%eigenvector(ss)) > 0.000001_dp)   then
                  !
                  ! determine first the radial integrals from the occupation
                  ! of the csf
                  write(*,1) ss,rr,                                         &
                     orbital_symmetry(transition(i)%channel(j)%kappa),      &
                             asf_initial%asf(asfi)%eigenvector(ss),         &
                             asf_final%asf(asff)%eigenvector(rr),           &
                             asf_final%asf(asff)%eigenvector(rr)*           &
                             asf_initial%asf(asfi)%eigenvector(ss),         &
                             asf_final%asf(asff)%eigenvector(rr)*           &
                             asf_initial%asf(asfi)%eigenvector(ss)*         &
                             auger%matrix(r,s)
                1 format(1x,i7,i10,6x,a2,3x,f6.3,2x,f6.3,5x,f8.5,4x,f9.6)
                end if
            end if
            !
         end do
      end do
      !
      if (auger_print_main_csf_me) then
         print *, "-------------------------------------------------------"//&
                  "-----------------"
      end if
      !
      l     = angular_momentum_l(transition(i)%channel(j)%kappa)
      phase = transition(i)%channel(j)%phase
      !
      transition(i)%channel(j)%amplitude_re = value
      transition(i)%channel(j)%amplitude    = cmplx(zero,one)**l *           &
                              exp( -cmplx(zero,one)*phase) * cmplx(value,zero)
      !
      print *, "i,j,transition(i)%channel(j)%amplitude = ",  &
                i,j,transition(i)%channel(j)%amplitude
      !
   end subroutine auger_channel_amplitude
   !
回复此楼

» 本帖附件资源列表

  • 欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
    本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:libolin3@tal.com
  • 附件 1 : rabs_auger.f90
  • 2019-05-04 05:23:07, 86.51 K

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 rlafite 的主题更新
不应助 确定回帖应助 (注意:应助才可能被奖励,但不允许灌水,必须填写15个字符以上)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] &quot;颜宁:基础研究应顶天立地&quot;能做到基础研究同时顶天立地的才是牛人 +6 zju2000 2024-04-24 6/300 2024-04-27 10:17 by kcmn1000
[教师之家] 大学直属学院卸任的副院长退休后还享受副处级的养老待遇吗? +4 苏东坡二世 2024-04-27 4/200 2024-04-27 10:12 by ZHONGWU_U
[硕博家园] 博士白读了 +47 Da_Meng_Zi 2024-04-21 52/2600 2024-04-27 08:25 by shl2112501
[有机交流] 如何分离原料与产品 5+4 qwerasdf587 2024-04-24 13/650 2024-04-26 23:18 by 119966984
[论文投稿] LWT投 +3 AChen92 2024-04-26 3/150 2024-04-26 22:16 by hizifu
[考博] 真的好想读博! +15 wangzhe_bs 2024-04-22 22/1100 2024-04-26 22:11 by 小木雄子
[论文投稿] 研二光催化6月底四篇二区什么水平 5+5 wjtab 2024-04-22 15/750 2024-04-26 19:25 by wjtab
[有机交流] 环肽的合成 +3 徐来不惊 2024-04-25 5/250 2024-04-26 16:56 by 徐来不惊
[考博] 申博求助 +4 dskabdh 2024-04-24 11/550 2024-04-26 15:54 by dskabdh
[硕博家园] 考研,求职还是考编? +15 xizj 2024-04-21 24/1200 2024-04-26 11:49 by Kan客
[论文投稿] Chemical Engineering Journal投稿3周了,一直显示With editor状态。这是送审了吗? 10+4 yifeng11 2024-04-20 13/650 2024-04-26 09:48 by yifeng11
[论文投稿] Nature一直在编辑手里,考虑好几天了,是悬了吗 +12 彩虹初见 2024-04-24 12/600 2024-04-25 19:21 by 雪径踏青
[考博] 求博导 +6 好okjh 2024-04-21 10/500 2024-04-25 14:04 by 好okjh
[电化学] 耗材发问 +4 Happy C 2024-04-22 4/200 2024-04-25 11:03 by 普通小虫
[考博] 24年 申博 化学/材料 一作6篇sci +9 wangyp123 2024-04-23 11/550 2024-04-24 19:01 by bangbangbiu
[考博] 博士招生 +4 zx179 2024-04-24 7/350 2024-04-24 15:01 by H考研成功
[论文投稿] 期刊推荐 20+4 木颜尘ip 2024-04-22 7/350 2024-04-24 10:06 by bobvan
[考博] 申博成果界定是根据Jcr分区还是中科院分区 +4 我属驴核动力驴 2024-04-22 5/250 2024-04-24 08:47 by 晓目崇
[考博] 研二光催化6月底4篇2区 +7 wjtab 2024-04-22 11/550 2024-04-23 06:59 by byron2012
[论文投稿] 编辑是选国外的好还是国内的好。 +8 lizhengke06 2024-04-20 8/400 2024-04-22 08:58 by cuiyunjian
信息提示
请填处理意见