-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate MICM into build and start chem process structure #114
base: develop
Are you sure you want to change the base?
Changes from 9 commits
19a414d
d09805d
46b5303
fd1ea3c
ee3ba6c
eac63f2
d3d3f53
75ae399
0f78027
817b760
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
zmoon marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module CCPr_Chem_mod | ||
implicit none | ||
|
||
private | ||
public :: get_micm_version | ||
|
||
contains | ||
|
||
function get_micm_version() result(res) | ||
use musica_util, only: string_t | ||
use musica_micm, only: get_micm_version_ => get_micm_version | ||
character(len=256) :: res | ||
|
||
type(string_t) :: micm_version_ | ||
|
||
micm_version_ = get_micm_version_() | ||
res = micm_version_%get_char_array() | ||
|
||
end function get_micm_version | ||
|
||
end module CCPr_Chem_mod |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(_lib CATChem_process_chem) | ||
|
||
set(_srcs CCPr_Chem_Mod.F90) | ||
|
||
add_library(${_lib} ${_srcs}) | ||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only cmake related comment I can think of is that it's recommended to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @K20shores , I can update the whole project to use that in a separate PR. |
||
target_link_libraries(${_lib} PUBLIC CATChem_core) | ||
target_link_libraries(${_lib} PRIVATE musica::musica-fortran) | ||
set_target_properties( | ||
${_lib} | ||
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
program test_chem | ||
use CATChem, only: cc_get_micm_version | ||
use testing_mod, only: assert | ||
implicit none | ||
|
||
character(len=:), allocatable :: micm_version | ||
character(len=*), parameter :: expected_micm_version = "3.7.0" | ||
|
||
micm_version = adjustl(trim(cc_get_micm_version())) | ||
zmoon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
print "('MICM version:', 1x, '''', a, '''')", micm_version | ||
call assert(micm_version == expected_micm_version, & | ||
"MICM version should be "//expected_micm_version) | ||
|
||
end program test_chem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nothing that, without adding these, was getting this error:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note, it seems like really it's only necessary to add CXX to get a successful build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@K20shores do you know if there's a way to get MUSICA to build without changing this, by specifying something elsewhere instead? Just curious, as our project code is all Fortran really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zmoon I think this is required. If not, I don't think the linker will be properly configured. I could be wrong though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zmoon I was able to build your fork
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @K20shores , that's good to hear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, if you want to only enable these languages only when musica is built, somewhere you can do something like this