Skip to content

Commit

Permalink
Merge pull request #73 from NCAR/fix-test
Browse files Browse the repository at this point in the history
Remove test code for debugging and formatted spacing
  • Loading branch information
boulderdaze authored Mar 18, 2024
2 parents 3362575 + 3417f1e commit 3866028
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
24 changes: 12 additions & 12 deletions fortran/micm_core.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module micm_core
function create_micm_c(config_path, error_code) bind(C, name="create_micm")
import c_ptr, c_int, c_char
character(kind=c_char), intent(in) :: config_path(*)
integer(kind=c_int), intent(out) :: error_code
type(c_ptr) :: create_micm_c
integer(kind=c_int), intent(out) :: error_code
type(c_ptr) :: create_micm_c
end function create_micm_c

subroutine delete_micm_c(micm) bind(C, name="delete_micm")
Expand All @@ -21,12 +21,12 @@ end subroutine delete_micm_c

subroutine micm_solve_c(micm, time_step, temperature, pressure, num_concentrations, concentrations) bind(C, name="micm_solve")
import c_ptr, c_double, c_int
type(c_ptr), value, intent(in) :: micm
type(c_ptr), value, intent(in) :: micm
real(kind=c_double), value, intent(in) :: time_step
real(kind=c_double), value, intent(in) :: temperature
real(kind=c_double), value, intent(in) :: pressure
integer(kind=c_int), value, intent(in) :: num_concentrations
real(kind=c_double), intent(inout) :: concentrations(num_concentrations)
real(kind=c_double), intent(inout) :: concentrations(num_concentrations)
end subroutine micm_solve_c
end interface

Expand All @@ -47,7 +47,7 @@ end subroutine micm_solve_c
contains

function constructor(config_path, errcode) result( this )
type(micm_t), pointer :: this
type(micm_t), pointer :: this
character(len=*), intent(in) :: config_path
integer, intent(out) :: errcode
character(len=1, kind=c_char) :: c_config_path(len_trim(config_path)+1)
Expand All @@ -69,17 +69,17 @@ function constructor(config_path, errcode) result( this )
end function constructor

subroutine solve(this, time_step, temperature, pressure, num_concentrations, concentrations)
class(micm_t) :: this
real(c_double), intent(in) :: time_step
real(c_double), intent(in) :: temperature
real(c_double), intent(in) :: pressure
integer(c_int), intent(in) :: num_concentrations
real(c_double), intent(inout) :: concentrations(*)
class(micm_t) :: this
real(c_double), intent(in) :: time_step
real(c_double), intent(in) :: temperature
real(c_double), intent(in) :: pressure
integer(c_int), intent(in) :: num_concentrations
real(c_double), intent(inout) :: concentrations(*)
call micm_solve_c(this%ptr, time_step, temperature, pressure, num_concentrations, concentrations)
end subroutine solve

subroutine finalize(this)
type(micm_t), intent(inout) :: this
type(micm_t), intent(inout) :: this
call delete_micm_c(this%ptr)
end subroutine finalize

Expand Down
2 changes: 1 addition & 1 deletion fortran/test/fetch_content_integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include(FetchContent)

FetchContent_Declare(musica-fortran
GIT_REPOSITORY https://github.com/NCAR/musica.git
GIT_TAG reorganize
GIT_TAG main
)

set(MUSICA_BUILD_C_CXX_INTERFACE OFF)
Expand Down
8 changes: 0 additions & 8 deletions fortran/test/fetch_content_integration/test_micm_fort_api.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ program test_micm_fort_api

write(*,*) "[test micm fort api] After solving, concentrations", concentrations

call micm%solve(time_step, temperature, pressure, num_concentrations, concentrations)

write(*,*) "[test micm fort api] After solving, concentrations222", concentrations

call micm%solve(time_step, temperature, pressure, num_concentrations, concentrations)

write(*,*) "[test micm fort api] After solving, concentrations333", concentrations

write(*,*) "[test micm fort api] Finished."

end program

0 comments on commit 3866028

Please sign in to comment.