@@ -568,18 +568,34 @@ subroutine transform_to_grid_space(this, nR, nBc, lViscBcCalc, lRmsCalc, &
568568 & this% gsa% dvtdpc, this% gsa% dvpdpc, l_R(nR))
569569 end if
570570 else if ( nBc == 2 ) then
571- if ( nR == n_r_cmb .and. (.not. l_radial_flow_bc) ) then
572- call v_rigid_boundary(nR, omega_ma, lDeriv, this% gsa% vrc, &
573- & this% gsa% vtc, this% gsa% vpc, this% gsa% cvrc, &
574- & this% gsa% dvrdtc, this% gsa% dvrdpc, &
575- & this% gsa% dvtdpc,this% gsa% dvpdpc)
576- else if ( nR == n_r_icb .and. ellip_fac_icb == 0.0_cp ) then
577- call v_rigid_boundary(nR, omega_ic, lDeriv, this% gsa% vrc, &
578- & this% gsa% vtc, this% gsa% vpc, &
579- & this% gsa% cvrc, this% gsa% dvrdtc, &
580- & this% gsa% dvrdpc, this% gsa% dvtdpc, &
581- & this% gsa% dvpdpc)
571+ if ( nR == n_r_cmb ) then
572+ if ( l_radial_flow_bc ) then
573+ call torpol_to_spat(w_Rloc(:,nR), dw_Rloc(:,nR), z_Rloc(:,nR), &
574+ & this% gsa% vrc, this% gsa% vtc, this% gsa% vpc, l_R(nR))
575+ end if
576+ call v_rigid_boundary(nR, omega_ma, lDeriv, this% gsa% vrc, &
577+ & this% gsa% vtc, this% gsa% vpc, this% gsa% cvrc, &
578+ & this% gsa% dvrdtc, this% gsa% dvrdpc, &
579+ & this% gsa% dvtdpc, this% gsa% dvpdpc, l_radial_flow_bc)
582580 end if
581+
582+ if ( nR == n_r_icb ) then
583+ if ( ellip_fac_icb == 0.0_cp ) then
584+ call torpol_to_spat(w_Rloc(:,nR), dw_Rloc(:,nR), z_Rloc(:,nR), &
585+ & this% gsa% vrc, this% gsa% vtc, this% gsa% vpc, l_R(nR))
586+
587+ call v_rigid_boundary(nR, omega_ma, lDeriv, this% gsa% vrc, &
588+ & this% gsa% vtc, this% gsa% vpc, this% gsa% cvrc, &
589+ & this% gsa% dvrdtc, this% gsa% dvrdpc, &
590+ & this% gsa% dvtdpc, this% gsa% dvpdpc, l_radial_flow_bc)
591+ else
592+ call v_rigid_boundary(nR, omega_ma, lDeriv, this% gsa% vrc, &
593+ & this% gsa% vtc, this% gsa% vpc, this% gsa% cvrc, &
594+ & this% gsa% dvrdtc, this% gsa% dvrdpc, &
595+ & this% gsa% dvtdpc, this% gsa% dvpdpc, .false. ) ! A bit hacky, should ideally separate icb and cmb BC flags, TBD
596+ end if
597+ end if
598+
583599 if ( lDeriv ) then
584600 call torpol_to_spat(dw_Rloc(:,nR), ddw_Rloc(:,nR), dz_Rloc(:,nR), &
585601 & this% gsa% dvrdrc, this% gsa% dvtdrc, &
0 commit comments