Skip to content

Commit

Permalink
addressed code review
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Feb 7, 2024
1 parent 4ae1a07 commit 3d8bbb0
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: build Docker image
Expand Down
7 changes: 0 additions & 7 deletions .gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions cmake/atmosphericphysicsConfig.cmake.in

This file was deleted.

37 changes: 0 additions & 37 deletions cmake/cmake_uninstall.cmake.in

This file was deleted.

4 changes: 2 additions & 2 deletions musica/micm/micm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ subroutine micm_init(config_path, iulog, errcode, errmsg)
errcode = micm_obj%create_solver()

if (errcode /= 0) then
errmsg = "[fatal] [micm] Failed to creat MICM solver. Parsing configuration failed. &
Please look over at the other file for further information."
errmsg = "[fatal] [micm] Failed to create MICM solver. Parsing configuration failed. &
Please look over at MICM log file for further information."
write(iulog,*) trim(errmsg)
return
endif
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions CMakeLists.txt → test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ option(ENABLE_MICM_TEST "Build the micm test" OFF)

if (ENABLE_MICM_TEST)
set(MUSICA_VERSION $ENV{MUSICA_VERSION})
set(MICM_SRC_PATH ${CMAKE_SOURCE_DIR}/musica/micm)
set(MICM_SRC_PATH ${CMAKE_SOURCE_DIR}/../musica/micm)
set(CCPP_SRC_PATH ${CMAKE_SOURCE_DIR}/$ENV{CCPP_SRC_PATH})
set(CCPP_TEST_SRC_PATH ${CMAKE_SOURCE_DIR}/test/include)
set(CCPP_TEST_SRC_PATH ${CMAKE_SOURCE_DIR}/include)

add_subdirectory(test/musica/micm)
add_subdirectory(musica/micm)

enable_testing()
endif()
File renamed without changes.
11 changes: 6 additions & 5 deletions docker/Dockerfile.musica → test/docker/Dockerfile.musica
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ RUN cd musica \
-D USE_MUSICA=ON \
-D USE_MUSICA_FORTRAN=OFF \
-D MAKE_MUSICA_FORTRAN_INSTALLABLE=ON \
-D ENABLE_MICM=ON \
-D ENABLE_TESTS=OFF \
-D ENABLE_TUVX=OFF \
&& cd build \
Expand All @@ -54,19 +55,19 @@ ENV MUSICA_VERSION="0.5.0"

COPY . atmospheric_physics

RUN cd atmospheric_physics \
RUN cd atmospheric_physics/test \
&& mkdir lib \
&& cd lib \
&& git clone -b add_const_interface --depth 1 https://github.com/peverwhee/ccpp-framework.git
&& git clone -b CPF_0.2.051 --depth 1 https://github.com/peverwhee/ccpp-framework.git
ENV CCPP_SRC_PATH="lib/ccpp-framework/src"

RUN cd atmospheric_physics \
RUN cd atmospheric_physics/test \
&& cmake -S. \
-B build \
-D ENABLE_MICM_TEST=ON \
&& cmake --build ./build

RUN cd atmospheric_physics \
&& cp -r test/musica/micm/configs/chapman ./build/chapman
&& cp -r test/musica/micm/configs/chapman ./test/build/chapman

WORKDIR atmospheric_physics/build
WORKDIR atmospheric_physics/test/build
3 changes: 2 additions & 1 deletion test/musica/micm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ target_link_libraries(test_micm_api

set_target_properties(test_micm_api
PROPERTIES
LINKER_LANGUAGE Fortran)
LINKER_LANGUAGE Fortran
)

include(CTest)

Expand Down
21 changes: 15 additions & 6 deletions test/musica/micm/test_micm_api.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,33 @@ subroutine test_micm_ccpp_api()

call micm_init("chapman", iulog, errcode, errmsg)

if (errcode /= 0) then
write(*,*) " -- Failed to create solver"
stop 3
endif

write(*,*) " -- Initial time_step", time_step
write(*,*) " -- Initial temp", temperature
write(*,*) " -- Initial pressure", pressure
write(*,*) " -- Initial concentrations", constituents

if (errcode == 0) then
call micm_run(time_step, temperature, pressure, dry_air_density, constituent_props_ptr, &
call micm_run(time_step, temperature, pressure, dry_air_density, constituent_props_ptr, &
constituents, iulog, errcode, errmsg)

write(*,*) " -- After solving, conentrations", constituents
else
write(*,*) " -- Exiting due to the error in creating solver"
if (errcode /= 0) then
write(*,*) " -- Solver failed to converge"
stop 3
endif

write(*,*) " -- Completed solving"
write(*,*) " -- Completed solving. After solving, conentrations", constituents

call micm_final(iulog, errcode, errmsg)

if (errcode /= 0) then
write(*,*) " -- Failed to finalize micm"
stop 3
endif

end subroutine test_micm_ccpp_api

program run_test_micm_ccpp
Expand Down
2 changes: 1 addition & 1 deletion utilities/state_converters.meta
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = in
[ rho ]
standard_name = density_of_dry_air
standard_name = dry_air_density
long_name = dry air density
units = kg m-3
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
Expand Down

0 comments on commit 3d8bbb0

Please sign in to comment.