forked from NCAR/musica
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NCAR#177 from NCAR/fortran_uniform_spacing
Uniformize the indentation for Fortran code base
- Loading branch information
Showing
8 changed files
with
1,468 additions
and
1,468 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
fortran/test/fetch_content_integration/test_get_micm_version.F90
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
program demo | ||
use musica_util, only: string_t | ||
use musica_micm, only: get_micm_version | ||
implicit none | ||
type(string_t) :: micm_version | ||
micm_version = get_micm_version() | ||
print *, "MICM version ", micm_version%get_char_array() | ||
use musica_util, only: string_t | ||
use musica_micm, only: get_micm_version | ||
implicit none | ||
type(string_t) :: micm_version | ||
micm_version = get_micm_version() | ||
print *, "MICM version ", micm_version%get_char_array() | ||
end program demo |
96 changes: 48 additions & 48 deletions
96
fortran/test/fetch_content_integration/test_micm_box_model.F90
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 |
---|---|---|
@@ -1,74 +1,74 @@ | ||
program test_micm_box_model | ||
|
||
use, intrinsic :: iso_c_binding | ||
use, intrinsic :: ieee_arithmetic | ||
use, intrinsic :: iso_c_binding | ||
use, intrinsic :: ieee_arithmetic | ||
|
||
use musica_util, only: error_t, string_t, mapping_t | ||
use musica_micm, only: micm_t, solver_stats_t | ||
use musica_micm, only: Rosenbrock, RosenbrockStandardOrder | ||
use musica_util, only: error_t, string_t, mapping_t | ||
use musica_micm, only: micm_t, solver_stats_t | ||
use musica_micm, only: Rosenbrock, RosenbrockStandardOrder | ||
|
||
implicit none | ||
implicit none | ||
|
||
call box_model() | ||
call box_model() | ||
|
||
contains | ||
|
||
subroutine box_model() | ||
subroutine box_model() | ||
|
||
character(len=256) :: config_path | ||
integer(c_int) :: solver_type | ||
integer(c_int) :: num_grid_cells | ||
character(len=256) :: config_path | ||
integer(c_int) :: solver_type | ||
integer(c_int) :: num_grid_cells | ||
|
||
real(c_double), parameter :: GAS_CONSTANT = 8.31446261815324_c_double ! J mol-1 K-1 | ||
real(c_double), parameter :: GAS_CONSTANT = 8.31446261815324_c_double ! J mol-1 K-1 | ||
|
||
real(c_double) :: time_step | ||
real(c_double) :: temperature | ||
real(c_double) :: pressure | ||
real(c_double) :: air_density | ||
real(c_double) :: time_step | ||
real(c_double) :: temperature | ||
real(c_double) :: pressure | ||
real(c_double) :: air_density | ||
|
||
integer(c_int) :: num_concentrations = 3 | ||
real(c_double), dimension(3) :: concentrations | ||
integer(c_int) :: num_concentrations = 3 | ||
real(c_double), dimension(3) :: concentrations | ||
|
||
integer(c_int) :: num_user_defined_reaction_rates = 0 | ||
real(c_double), dimension(:), allocatable :: user_defined_reaction_rates | ||
integer(c_int) :: num_user_defined_reaction_rates = 0 | ||
real(c_double), dimension(:), allocatable :: user_defined_reaction_rates | ||
|
||
type(string_t) :: solver_state | ||
type(solver_stats_t) :: solver_stats | ||
type(error_t) :: error | ||
type(string_t) :: solver_state | ||
type(solver_stats_t) :: solver_stats | ||
type(error_t) :: error | ||
|
||
type(micm_t), pointer :: micm | ||
type(micm_t), pointer :: micm | ||
|
||
integer :: i | ||
integer :: i | ||
|
||
config_path = "configs/analytical" | ||
solver_type = RosenbrockStandardOrder | ||
num_grid_cells = 1 | ||
config_path = "configs/analytical" | ||
solver_type = RosenbrockStandardOrder | ||
num_grid_cells = 1 | ||
|
||
time_step = 200 | ||
temperature = 273.0 | ||
pressure = 1.0e5 | ||
air_density = pressure / (GAS_CONSTANT * temperature) | ||
time_step = 200 | ||
temperature = 273.0 | ||
pressure = 1.0e5 | ||
air_density = pressure / (GAS_CONSTANT * temperature) | ||
|
||
concentrations = (/ 1.0, 1.0, 1.0 /) | ||
concentrations = (/ 1.0, 1.0, 1.0 /) | ||
|
||
write(*,*) "Creating MICM solver..." | ||
micm => micm_t(config_path, solver_type, num_grid_cells, error) | ||
write(*,*) "Creating MICM solver..." | ||
micm => micm_t(config_path, solver_type, num_grid_cells, error) | ||
|
||
do i = 1, size( micm%species_ordering ) | ||
associate(the_mapping => micm%species_ordering(i)) | ||
print *, "Species Name:", the_mapping%name(), ", Index:", the_mapping%index() | ||
end associate | ||
end do | ||
do i = 1, size( micm%species_ordering ) | ||
associate(the_mapping => micm%species_ordering(i)) | ||
print *, "Species Name:", the_mapping%name(), ", Index:", the_mapping%index() | ||
end associate | ||
end do | ||
|
||
write(*,*) "Solving starts..." | ||
! call micm%solve(time_step, temperature, pressure, num_concentrations, concentrations, & | ||
! num_user_defined_reaction_rates, user_defined_reaction_rates, error) | ||
call micm%solve(time_step, temperature, pressure, air_density, num_concentrations, concentrations, & | ||
num_user_defined_reaction_rates, user_defined_reaction_rates, solver_state, solver_stats, error) | ||
write(*,*) "After solving, concentrations", concentrations | ||
write(*,*) "Solving starts..." | ||
! call micm%solve(time_step, temperature, pressure, num_concentrations, concentrations, & | ||
! num_user_defined_reaction_rates, user_defined_reaction_rates, error) | ||
call micm%solve(time_step, temperature, pressure, air_density, num_concentrations, concentrations, & | ||
num_user_defined_reaction_rates, user_defined_reaction_rates, solver_state, solver_stats, error) | ||
write(*,*) "After solving, concentrations", concentrations | ||
|
||
deallocate( micm ) | ||
deallocate( micm ) | ||
|
||
end subroutine box_model | ||
end subroutine box_model | ||
|
||
end program test_micm_box_model |
Oops, something went wrong.