Skip to content

Commit

Permalink
add tuvx wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Aug 9, 2024
1 parent 3b793e9 commit a64505d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
12 changes: 5 additions & 7 deletions musica/musica_ccpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end subroutine musica_ccpp_init
!> \section arg_table_musica_ccpp_run Argument Table
!! \htmlinclude musica_ccpp_run.html
subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, constituent_props, &
constituents, errmsg, errcode)
constituents, height, photolysis_rate_constants, errmsg, errcode)
use ccpp_kinds, only: kind_phys
use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t

Expand All @@ -43,17 +43,15 @@ subroutine musica_ccpp_run(time_step, temperature, pressure, dry_air_density, co
real(kind_phys), intent(in) :: dry_air_density(:,:) ! kg m-3
type(ccpp_constituent_prop_ptr_t), intent(in) :: constituent_props(:)
real(kind_phys), intent(inout) :: constituents(:,:,:) ! kg kg-1
real(kind=dk), intent(in) :: height(:,:)
real(kind=dk), intent(in) :: air_density(:,:)
real(kind=dk), intent(in) :: temperature(:,:)
real(kind=dk), intent(out) :: photolysis_rate_constants(:,:,:)
real(kind_phys), intent(in) :: height(:,:)
real(kind_phys), intent(out) :: photolysis_rate_constants(:,:,:)
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errcode

call micm_run(time_step, temperature, pressure, dry_air_density, constituent_props, &
constituents, errmsg, errcode)
call tuvx_run( height, air_density, temperature, photolysis_rate_constants &
photolysis_rate_constants, errmsg, errcode )
call tuvx_run(height, temperature, dry_air_density, photolysis_rate_constants, &
errmsg, errcode)
end subroutine musica_ccpp_run

!> \section arg_table_musica_ccpp_final Argument Table
Expand Down
2 changes: 1 addition & 1 deletion musica/musica_ccpp.meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ccpp-table-properties]
name = musica_ccpp
type = scheme
dependencies = micm/musica_ccpp_micm.F90,musica_ccpp_util.F90
dependencies = micm/musica_ccpp_micm.F90,micm/musica_ccpp_tuvx.F90,musica_ccpp_util.F90
dynamic_constituent_routine = musica_ccpp_register

[ccpp-arg-table]
Expand Down
13 changes: 13 additions & 0 deletions musica/musica_ccpp_namelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,18 @@
<value>UNSET_PATH</value>
</values>
</entry>
<entry id="filename_of_tuvx_configuration">
<type>char*512</type>
<category>musica_ccpp</category>
<group>musica_ccpp</group>
<standard_name>filename_of_tuvx_configuration</standard_name>
<units>none</units>
<desc>
A configuration file for the TUVX photolysis rate calculator
</desc>
<values>
<value>UNSET_PATH</value>
</values>
</entry>

</entry_id_pg>
4 changes: 3 additions & 1 deletion test/docker/Dockerfile.musica
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ubuntu:22.04

ARG MUSICA_GIT_TAG=92b3365

RUN apt update \
&& apt install -y sudo \
&& adduser test_user \
Expand Down Expand Up @@ -45,7 +47,7 @@ ENV FFLAGS="-I/usr/include/"
RUN git clone https://github.com/NCAR/musica.git
RUN cd musica \
&& git fetch \
&& git checkout 2a5eeaac982a3eb80b96d1e2087b91b301d1e748 \
&& git checkout ${MUSICA_GIT_TAG} \
&& cmake \
-S . \
-B build \
Expand Down
1 change: 1 addition & 0 deletions test/musica/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ add_executable(test_musica_api test_musica_api.F90 musica_ccpp_namelist.F90)
target_sources(test_musica_api
PUBLIC
${MUSICA_SRC_PATH}/micm/musica_ccpp_micm.F90
${MUSICA_SRC_PATH}/tuvx/musica_ccpp_tuvx.F90
${MUSICA_SRC_PATH}/musica_ccpp.F90
${MUSICA_SRC_PATH}/musica_ccpp_util.F90
${CCPP_SRC_PATH}/ccpp_constituent_prop_mod.F90
Expand Down

0 comments on commit a64505d

Please sign in to comment.