Skip to content

Commit

Permalink
Merge branch 'main' into develop-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfillmore committed Apr 3, 2024
2 parents 57077b2 + 82cf0aa commit 682dd2b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 21 deletions.
66 changes: 66 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
cff-version: 1.2.0
message: "This Citation File Format (CFF) record describes a software paper."
authors:
- family-names: Pfister
given-names: Gabriele G.
- family-names: Eastham
given-names: Sebastian D.
- family-names: Arellano
given-names: Avelino F.
- family-names: Aumont
given-names: Bernard
- family-names: Barsanti
given-names: Kelley C.
- family-names: Barth
given-names: Mary C.
- family-names: Conley
given-names: Andrew
- family-names: Davis
given-names: Nicholas A.
- family-names: Emmons
given-names: Louisa K.
- family-names: Fast
given-names: Jerome D.
- family-names: Fiore
given-names: Arlene M.
- family-names: Gaubert
given-names: Benjamin
- family-names: Goldhaber
given-names: Steve
- family-names: Granier
given-names: Claire
- family-names: Grell
given-names: Georg A.
- family-names: Guevara
given-names: Marc
- family-names: Henze
given-names: Daven K.
- family-names: Hodzic
given-names: Alma
- family-names: Liu
given-names: Xiaohong
- family-names: Marsh
given-names: Daniel R.
- family-names: Orlando
given-names: John J.
- family-names: Plane
given-names: John M. C.
- family-names: Polvani
given-names: Lorenzo M.
- family-names: Rosenlof
given-names: Karen H.
- family-names: Steiner
given-names: Allison L.
- family-names: Jacob
given-names: Daniel J.
- family-names: Brasseur
given-names: Guy P.
title: "The Multi-Scale Infrastructure for Chemistry and Aerosols (MUSICA)"
journal: "Bulletin of the American Meteorological Society"
year: 2020
publisher: "American Meteorological Society"
volume: 101
number: 10
page: "E1743 - E1760"
doi: "10.1175/BAMS-D-19-0331.1"
url: "https://journals.ametsoc.org/view/journals/bams/101/10/bamsD190331.xml"
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 682dd2b

Please sign in to comment.