Skip to content

Commit

Permalink
check for species in test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattldawson committed May 23, 2024
1 parent 5abf5a7 commit 6fb36e8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/musica/test_musica_api.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ subroutine test_musica_ccpp_api()
type(ccpp_constituent_properties_t), allocatable, target :: constituent_props(:)
type(ccpp_constituent_properties_t), pointer :: const_prop
integer :: i
character(len=512) :: tmp_string
logical :: tmp_bool

time_step = 60._kind_phys

Expand All @@ -48,6 +50,22 @@ subroutine test_musica_ccpp_api()

call musica_register(constituent_props, errcode, errmsg)
ASSERT(allocated(constituent_props))
ASSERT(size(constituent_props) == 5)
do i = 1, size(constituent_props)
ASSERT(constituent_props(i)%is_instantiated(errcode, errmsg))
ASSERT(errcode == 0)
call constituent_props(i)%standard_name(tmp_string, errcode, errmsg)
ASSERT(errcode == 0)
tmp_bool = trim(tmp_string) == "M" .or. &
trim(tmp_string) == "O2" .or. &
trim(tmp_string) == "O" .or. &
trim(tmp_string) == "O1D" .or. &
trim(tmp_string) == "O3"
ASSERT(tmp_bool)
call constituent_props(i)%units(tmp_string, errcode, errmsg)
ASSERT(errcode == 0)
ASSERT(trim(tmp_string) == 'kg kg-1')
end do
if (errcode /= 0) then
write(*,*) errcode, trim(errmsg)
stop 3
Expand Down

0 comments on commit 6fb36e8

Please sign in to comment.