Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions rdcon/dcon.f
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ SUBROUTINE dcon_run

LOGICAL :: cyl_flag=.FALSE.,regrid_flag=.FALSE.,verbose=.TRUE.
INTEGER :: mmin,ipsi
REAL(r8) :: zeff0
COMPLEX(r8), DIMENSION(:,:), ALLOCATABLE :: mx0
COMPLEX(r8), DIMENSION(:), ALLOCATABLE :: vx0

Expand Down Expand Up @@ -346,6 +347,24 @@ SUBROUTINE dcon_run
IF(MRE_flag)THEN
CALL read_var_len(Zeff,Zeff_)
CALL read_var_len(psi_N_Zeff,psi_N_Zeff_)
c one Zeff value (default 1.52) without psi_N_Zeff: flat profile.
IF(.NOT.ALLOCATED(psi_N_Zeff_))THEN
zeff0=1.52_r8
IF(ALLOCATED(Zeff_))THEN
IF(SIZE(Zeff_) > 1)
$ CALL program_stop("A Zeff profile needs psi_N_Zeff")
zeff0=Zeff_(1)
DEALLOCATE(Zeff_)
ENDIF
ALLOCATE(Zeff_(4),psi_N_Zeff_(4))
Zeff_=zeff0
psi_N_Zeff_=(/0.0_r8,1.0_r8/3,2.0_r8/3,1.0_r8/)
ENDIF
IF(.NOT.ALLOCATED(Zeff_) .OR. SIZE(Zeff_) /= SIZE(psi_N_Zeff_)
$ .OR. SIZE(Zeff_) < 4)
$ CALL program_stop("Zeff, psi_N_Zeff: equal sizes, >= 4")
IF(ANY(psi_N_Zeff_(2:) <= psi_N_Zeff_(:SIZE(psi_N_Zeff_)-1)))
$ CALL program_stop("psi_N_Zeff must be strictly increasing")
CALL spline_alloc(mreterms,mpsi,30)
mreterms%xs=sq%xs
mreterms%fs=0
Expand Down
12 changes: 4 additions & 8 deletions rdcon/mercier.f
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ SUBROUTINE mercier_scan
c-----------------------------------------------------------------------
IF(MRE_flag)THEN
CALL spline_alloc(ff,mtheta,22)
IF(ALLOCATED(Zeff_) .AND. ALLOCATED(psi_N_Zeff_))THEN
CALL spline_alloc(Zeff_spline,SIZE(psi_N_Zeff_)-1,1)
Zeff_spline%xs=psi_N_Zeff_
Zeff_spline%fs(:,1)=Zeff_
CALL spline_fit(Zeff_spline,"extrap")
ELSE
CALL program_stop("Provide Zeff profile values")
ENDIF
CALL spline_alloc(Zeff_spline,SIZE(psi_N_Zeff_)-1,1)
Zeff_spline%xs=psi_N_Zeff_
Zeff_spline%fs(:,1)=Zeff_
CALL spline_fit(Zeff_spline,"extrap")
ELSE
CALL spline_alloc(ff,mtheta,5)
ENDIF
Expand Down
Loading