From cd12712f7e79d86cd5f8c22fa1d259b111eaf11d Mon Sep 17 00:00:00 2001 From: lazersos Date: Thu, 17 Oct 2024 13:46:49 +0200 Subject: [PATCH] PENTA: Subroutine interface checked. --- PENTA/Sources/penta_interface_mod.f90 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PENTA/Sources/penta_interface_mod.f90 b/PENTA/Sources/penta_interface_mod.f90 index ca80e205..07b86cb6 100644 --- a/PENTA/Sources/penta_interface_mod.f90 +++ b/PENTA/Sources/penta_interface_mod.f90 @@ -133,7 +133,7 @@ SUBROUTINE read_penta_run_params_namelist(filename,istat) END IF READ(iunit,NML=run_params,IOSTAT=istat) IF (istat /= 0) THEN - WRITE(6,'(A)') 'ERROR reading PENTA ion_params namelist from file: ',TRIM(filename) + WRITE(6,'(A)') 'ERROR reading PENTA run_params namelist from file: ',TRIM(filename) backspace(iunit) read(iunit,fmt='(A)') line write(6,'(A)') 'Invalid line in namelist: '//TRIM(line) @@ -280,7 +280,6 @@ SUBROUTINE penta_read_input_files USE coeff_var_pass, ONLY: D11_mat, cmul, num_c USE phys_const, ONLY: p_mass, elem_charge, e_mass USE read_input_file_mod - USE PENTA_subroutines, ONLY : define_friction_coeffs IMPLICIT NONE CALL read_vmec_file_2(js,run_ident) CALL read_pprof_file(pprof_char,num_ion_species,roa_surf,arad,kord_pprof) @@ -298,7 +297,7 @@ SUBROUTINE penta_read_input_files U2=1.5d0*D11_mat(num_c,1)/cmul(num_c); ENDIF ! Change Er test range to V/cm if necessary - IF ( input_is_Er) THEN + IF ( .not. input_is_Er) THEN Er_min = Er_min * Te / arad Er_max = Er_max * Te / arad ENDIF @@ -322,9 +321,6 @@ SUBROUTINE penta_read_input_files vths=(/vth_e,vth_i/) dTdrs=(/dTedr,dTidr/) dndrs=(/dnedr,dnidr/) - ! Define matrix of friction coefficients (lmat) - Call define_friction_coeffs(masses,charges,vths,Temps,dens,loglambda, & - num_species,Smax,lmat) RETURN END SUBROUTINE penta_read_input_files @@ -412,7 +408,7 @@ SUBROUTINE penta_open_output ! Set write status IF (i_append == 0) THEN fstatus = "unknown" - fpos = "asis" + fpos = "SEQUENTIAL" ELSEIF (i_append == 1) THEN fstatus = "old" fpos = "append" @@ -490,8 +486,11 @@ END SUBROUTINE penta_open_output SUBROUTINE penta_fit_rad_trans USE coeff_var_pass USE vmec_var_pass - USE PENTA_subroutines, ONLY : fit_coeffs + USE PENTA_subroutines, ONLY : fit_coeffs, define_friction_coeffs IMPLICIT NONE + ! Define matrix of friction coefficients (lmat) + Call define_friction_coeffs(masses,charges,vths,Temps,dens,loglambda, & + num_species,Smax,lmat) ! Fit radial transport coefficients specific to different methods SELECT CASE (Method) CASE ('T', 'MBT') @@ -537,6 +536,7 @@ END SUBROUTINE penta_fit_rad_trans SUBROUTINE penta_run_1_init IMPLICIT NONE INTEGER :: istat + CALL init_penta_input istat = 0 CALL read_penta_ion_params_namelist('ion_params',istat) istat = 0