FIXME : Add documentation
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | istep_last | = | 0 | ||
integer, | private | :: | nonlinear_mode_switch | ||||
integer, | private, | parameter | :: | nonlinear_mode_none | = | 1 | |
integer, | private, | parameter | :: | nonlinear_mode_on | = | 2 | |
real, | private, | dimension (:,:), allocatable | :: | ba | |||
real, | private, | dimension (:,:), allocatable | :: | gb | |||
real, | private, | dimension (:,:), allocatable | :: | bracket | |||
real, | private, | dimension (:,:,:), allocatable | :: | aba | |||
real, | private, | dimension (:,:,:), allocatable | :: | agb | |||
real, | private, | dimension (:,:,:), allocatable | :: | abracket | |||
real, | public | :: | cfl | ||||
real, | private | :: | cflx | ||||
real, | private | :: | cfly | ||||
real, | private, | dimension(3) | :: | max_vel_components |
Data on maximum velocity of the nonlinear term, the reciprocal of the maximum timestep that satisfies the CFL condition. This currently has to be module level due to potential non-blocking reduction. Stores max_vel_x, max_vel_y and max_vel_error components to allow a max reduction over each element. |
||
integer, | public | :: | cfl_req_hand | = | mp_request_null | ||
logical, | private | :: | use_cfl_limit | ||||
logical, | private | :: | use_2d_cfl | ||||
real, | private | :: | error_target |
Variables related to the order based error estimate -- see config documentation |
|||
integer, | private | :: | istep_error_start | ||||
logical, | private | :: | use_order_based_error | ||||
logical, | public | :: | split_nonlinear | ||||
logical, | private | :: | include_apar | ||||
logical, | private | :: | include_bpar | ||||
logical, | private | :: | include_phi | ||||
real, | public | :: | time_add_explicit_terms(2) | = | 0. | ||
real, | public | :: | time_add_explicit_terms_mpi | = | 0. | ||
real, | public | :: | time_add_explicit_terms_field(2) | = | 0. | ||
logical, | public | :: | nonlin | = | .false. | ||
logical, | private | :: | initialized | = | .false. | ||
logical, | private | :: | initializing | = | .true. | ||
logical, | private | :: | alloc | = | .true. | ||
logical, | private | :: | zip | = | .false. | ||
logical, | private | :: | nl_forbid_force_zero | = | .true. | ||
logical, | public | :: | accelerated | = | .false. | ||
logical, | private | :: | exist | = | .false. | ||
real, | private, | parameter | :: | dt_cfl_default_large | = | 1.e8 |
The "large" cfl time step limit to use when we don't have a valid cfl limit from the NL term. |
type(nonlinear_terms_config_type), | private | :: | nonlinear_terms_config |
Public type allowing tests to access otherwise-private routines
procedure , public , nopass :: add_nl Subroutine |
Used to represent the input configuration of nonlinear_terms
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | public | :: | exist | = | .false. |
Does the related namelist exist in the target input file? |
|
integer, | public | :: | index | = | 0 |
Used to hold the specific index of numbered namelists |
|
logical, | public | :: | skip_read | = | .false. |
Do we want to skip the read step in init? |
|
logical, | public | :: | skip_broadcast | = | .false. |
Do we want to skip the broadcast step in init? |
|
real, | public | :: | cfl | = | 0.95 |
Scales the estimate CFL limit used to determine when the
timestep should be changed. The maximum allowed timestep
satisfies |
|
real, | public | :: | error_target | = | 0.1 |
Set the error threshold used to determine when the timestep should change if use_order_based_error is true. |
|
logical, | public | :: | include_apar | = | .true. |
Flag for testing. If false do not include apar contribution to nonlinear term. |
|
logical, | public | :: | include_bpar | = | .true. |
Flag for testing. If false do not include bpar contribution to nonlinear term. |
|
logical, | public | :: | include_phi | = | .true. |
Flag for testing. If false do not include phi contribution to nonlinear term. |
|
integer, | public | :: | istep_error_start | = | 30 |
Set the first timestep for which the order based error checks are made if use_order_based_error is true. |
|
logical, | public | :: | nl_forbid_force_zero | = | .true. |
If |
|
character(len=20), | public | :: | nonlinear_mode | = | 'default' |
Determines if the nonlinear terms should be calculated. Must be one of: |
|
logical, | public | :: | split_nonlinear | = | .false. |
Do we evolve the nonlinear term separately from the linear terms (true) or include the nonlinear term as a source in the standard algorithm (false). |
|
logical, | public | :: | use_2d_cfl | = | .true. |
If true then sum x and y cfl limiting velocities instead of taking the maximum. |
|
logical, | public | :: | use_cfl_limit | = | .true. |
If true then use the cfl limit to set the maximum timestep allowed. |
|
logical, | public | :: | use_order_based_error | = | .false. |
If true then use an error estimate from comparing the nonlinear source calculated using 2nd and 3rd order Adams-Bashforth schemes to control the timestep in use. This does not disable the CFL estimate. |
|
logical, | public | :: | zip | = | .false. |
Not currently used, should consider removing. Original
documentation was "Experts only (for secondary/tertiary
calculations)." which suggests a close relation to the
|
Get an estimate of the error on the NL source term by comparing 2nd and 3rd order calculations of the source term.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, :) | :: | g1 | ||
complex, | intent(in), | dimension(:, :, :) | :: | g2 | ||
complex, | intent(in), | dimension(:, :, :) | :: | g3 |
Given the max_vel_components array return the limiting max_vel
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension(3) | :: | components |
Gets the default name for this namelist
Gets the default requires index for this namelist
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | report_unit | |||
real, | intent(in) | :: | delt_adj |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | unit |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nonlinear_terms_config_type), | intent(in), | optional | :: | nonlinear_terms_config_in |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nonlinear_terms_config_type), | intent(in), | optional | :: | nonlinear_terms_config_in |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g2 | ||
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g3 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
integer, | intent(in) | :: | istep | |||
real, | intent(in) | :: | bd |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g2 | ||
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g3 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
integer, | intent(in) | :: | istep | |||
real, | intent(in) | :: | bd | |||
logical, | intent(in), | optional | :: | nl |
Takes input array evaluated at theta grid points and overwrites it with array evaluated at cell centers note that there is an extra factor of 2 in output array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | gtmp | ||
real, | intent(in) | :: | bd |
Calculates the current nonlinear source term by calling add_nl and the associated cfl limit.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (:,:,:) | :: | g_in | ||
complex, | intent(out), | dimension (:,:,:) | :: | g1 | ||
complex, | intent(in), | dimension (:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (:,:,:) | :: | bpar | ||
real, | intent(out) | :: | max_vel_local | |||
logical, | intent(in) | :: | need_to_adjust | |||
logical, | intent(in), | optional | :: | calculate_cfl_limit |
Calculate the nonlinear term and part of the corresponding CFL condition
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g_in | ||
complex, | intent(out), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
logical, | intent(in), | optional | :: | adjust |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar |
Calculate (d Chi /dx).(d g_wesson/dy) and store in bracket if is_first_term = .true. else calculate (d Chi /dy).(d g_wesson/dx) and subtract from bracket
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical | :: | is_first_term |
Finish nonblocking calculation of the maximum velocity and set the cfl limit.
Calculates the cfl limit from the module level max_vel value saves it using save_dt_cfl and then sets the reset flag based on checking if the current time step is too large.
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
Set the module level config type Will abort if the module has already been initialised to avoid inconsistencies.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nonlinear_terms_config_type), | intent(in), | optional | :: | nonlinear_terms_config_in |
Reads in the nonlinear_terms_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nonlinear_terms_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nonlinear_terms_config_type), | intent(in) | :: | self | |||
integer, | intent(in), | optional | :: | unit |
Resets the config object to the initial empty state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nonlinear_terms_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nonlinear_terms_config_type), | intent(inout) | :: | self |