-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94d1d90
commit 8f3b2c8
Showing
19 changed files
with
368 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
!############################################################################### | ||
!###################### READ ADIABATIC ELECTRONS NAMELIST ###################### | ||
!############################################################################### | ||
! Read the <adiabatic_electrons> namelist in the input file: | ||
! | ||
! &adiabatic_electroms | ||
! adiabatic_option = 'field-line-average-term' | ||
! tite = 1.0 | ||
! nine = 1.0 | ||
!/ | ||
!############################################################################### | ||
module namelist_adiabatic_electrons | ||
|
||
implicit none | ||
|
||
public :: read_namelist | ||
|
||
private | ||
|
||
contains | ||
|
||
subroutine read_namelist(adiabatic_option_switch, nine, tite, & | ||
adiabatic_option_fieldlineavg, adiabatic_option_periodic) | ||
|
||
use mp, only: proc0 | ||
|
||
implicit none | ||
|
||
real, intent(out) :: tite, nine | ||
integer, intent(out) :: adiabatic_option_switch | ||
integer, intent(out) :: adiabatic_option_periodic | ||
integer, intent(out) :: adiabatic_option_fieldlineavg | ||
|
||
! Local variable to set <adiabatic_option_switch> | ||
character(30) :: adiabatic_option | ||
|
||
if (.not. proc0) return | ||
call set_default_parameters | ||
call read_input_file | ||
call check_inputs | ||
|
||
contains | ||
|
||
!********************************************************************** | ||
! DEFAULT PARAMETERS ! | ||
!********************************************************************** | ||
! Set the default input parameters. | ||
!********************************************************************** | ||
subroutine set_default_parameters() | ||
|
||
implicit none | ||
|
||
adiabatic_option = 'field-line-average-term' | ||
tite = 1.0 | ||
nine = 1.0 | ||
|
||
end subroutine set_default_parameters | ||
|
||
|
||
!********************************************************************** | ||
! READ INPUT FILE ! | ||
!********************************************************************** | ||
! Overwrite any default options with those specified in the input file. | ||
! Then change the other parameters consistently. | ||
!********************************************************************** | ||
subroutine read_input_file | ||
|
||
use file_utils, only: input_unit_exist, error_unit | ||
use text_options, only: text_option, get_option_value | ||
|
||
implicit none | ||
|
||
! Variables needed to read the input file | ||
integer :: ierr, in_file | ||
logical :: dexist | ||
|
||
! Create parameters for the text option | ||
integer, parameter :: periodic = 1 | ||
integer, parameter :: fieldlineavg = 2 | ||
|
||
! Link text options for <adiabatic_option> to an integer value | ||
type(text_option), dimension(6), parameter :: adiabaticopts = & | ||
(/text_option('default', fieldlineavg), & | ||
text_option('no-field-line-average-term', periodic), & | ||
text_option('field-line-average-term', fieldlineavg), & | ||
text_option('iphi00=0', periodic), & | ||
text_option('iphi00=1', periodic), & | ||
text_option('iphi00=2', fieldlineavg)/) | ||
|
||
! Define variables in the <adiabatic_electrons> namelist | ||
namelist /adiabatic_electrons/ adiabatic_option, tite, nine | ||
|
||
!---------------------------------------------------------------------- | ||
|
||
! Save the values of the adiabatic option | ||
adiabatic_option_periodic = periodic | ||
adiabatic_option_fieldlineavg = fieldlineavg | ||
|
||
! Overwrite the default input parameters by those specified in the input file | ||
in_file = input_unit_exist("adiabatic_electrons", dexist) | ||
if (dexist) read (unit=in_file, nml=adiabatic_electrons) | ||
|
||
! Read the text option in <adiabatic_option> and store it in <adiabatic_option_switch> | ||
ierr = error_unit() | ||
call get_option_value(adiabatic_option, adiabaticopts, adiabatic_option_switch, & | ||
ierr, "adiabatic_option in parameters_physics") | ||
|
||
end subroutine read_input_file | ||
|
||
|
||
!********************************************************************** | ||
! CHECK INPUTS ! | ||
!********************************************************************** | ||
! Make sure that the input variables are set correctly. | ||
!********************************************************************** | ||
subroutine check_inputs | ||
|
||
implicit none | ||
|
||
end subroutine check_inputs | ||
|
||
end subroutine read_namelist | ||
|
||
end module namelist_adiabatic_electrons | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
!############################################################################### | ||
!########################## READ DISSIPATION NAMELIST ########################## | ||
!############################################################################### | ||
! Read the <dissipation> namelist in the input file | ||
!############################################################################### | ||
module namelist_dissipation | ||
|
||
implicit none | ||
|
||
public :: read_namelist | ||
|
||
private | ||
|
||
contains | ||
|
||
subroutine read_namelist(include_collisions, collisions_implicit, collision_model, hyper_dissipation) | ||
|
||
use mp, only: proc0 | ||
|
||
implicit none | ||
|
||
logical, intent(out) :: include_collisions, collisions_implicit, hyper_dissipation | ||
character(30), intent(out) :: collision_model | ||
|
||
if (.not. proc0) return | ||
call set_default_parameters | ||
call read_input_file | ||
call check_inputs | ||
|
||
contains | ||
|
||
!********************************************************************** | ||
! READ INPUT FILE ! | ||
!********************************************************************** | ||
! Overwrite any default options with those specified in the input file. | ||
! Then change the other parameters consistently. | ||
!********************************************************************** | ||
subroutine read_input_file | ||
|
||
use file_utils, only: input_unit_exist | ||
|
||
implicit none | ||
|
||
integer :: in_file | ||
logical :: dexist | ||
|
||
! Variables in the <dissipation> namelist | ||
namelist /dissipation/ include_collisions, collisions_implicit, collision_model, hyper_dissipation | ||
|
||
! Overwrite the default input parameters by those specified in the input file | ||
in_file = input_unit_exist("dissipation", dexist) | ||
if (dexist) read (unit=in_file, nml=dissipation) | ||
|
||
end subroutine read_input_file | ||
|
||
|
||
!********************************************************************** | ||
! CHECK INPUTS ! | ||
!********************************************************************** | ||
! Make sure that the input variables are set correctly. | ||
!********************************************************************** | ||
subroutine check_inputs | ||
|
||
implicit none | ||
|
||
if (.not. include_collisions) collisions_implicit = .false. | ||
|
||
end subroutine check_inputs | ||
|
||
|
||
!********************************************************************** | ||
! DEFAULT PARAMETERS ! | ||
!********************************************************************** | ||
! Set the default input parameters. | ||
!********************************************************************** | ||
subroutine set_default_parameters() | ||
|
||
implicit none | ||
|
||
include_collisions = .false. | ||
collisions_implicit = .true. | ||
hyper_dissipation = .false. | ||
|
||
! dougherty or fokker-planck | ||
collision_model = "dougherty" | ||
|
||
end subroutine set_default_parameters | ||
|
||
end subroutine read_namelist | ||
|
||
end module namelist_dissipation | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.