Skip to content

Commit 1dff6fe

Browse files
authored
Merge pull request #31 from geoschem/release/8.0.2
Merge release 8.0.2 into main
2 parents f8a2b7f + ced42e4 commit 1dff6fe

File tree

11 files changed

+2269
-49
lines changed

11 files changed

+2269
-49
lines changed

.github/workflows/mac.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
gnu:
1616
runs-on: macos-latest
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
gcc_version: [12, 13, 14]
2021
build_type: [Debug, Release]
@@ -32,3 +33,7 @@ jobs:
3233

3334
- name: Build
3435
run: cmake --build build --verbose
36+
37+
- name: Run tests
38+
run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose
39+
working-directory: build

.github/workflows/ubuntu.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
name: Ubuntu
22

3-
on: [pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
49

510
concurrency:
611
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
712
cancel-in-progress: true
813

914
jobs:
1015
gnu:
11-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1217
strategy:
18+
fail-fast: false
1319
matrix:
20+
gcc_version: [12, 13, 14]
1421
build_type: [Debug, Release]
1522
env:
16-
FC: gfortran
23+
FC: gfortran-${{ matrix.gcc_version }}
1724

1825
steps:
1926
- name: Checkout code
@@ -29,3 +36,7 @@ jobs:
2936

3037
- name: Build
3138
run: cmake --build build --verbose
39+
40+
- name: Run tests
41+
run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose
42+
working-directory: build

.github/workflows/windows.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
gnu:
16+
runs-on: windows-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
build_type: [Debug, Release]
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup MSYS2
27+
uses: msys2/setup-msys2@v2
28+
with:
29+
update: true
30+
install: >-
31+
base-devel
32+
mingw-w64-x86_64-toolchain
33+
mingw-w64-x86_64-gcc
34+
mingw-w64-x86_64-gcc-fortran
35+
mingw-w64-x86_64-cmake
36+
mingw-w64-x86_64-netcdf
37+
mingw-w64-x86_64-netcdf-fortran
38+
msystem: MINGW64
39+
40+
- name: Add MSYS2 mingw64 to PATH
41+
shell: msys2 {0}
42+
run: echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH
43+
44+
- name: Configure with CMake
45+
shell: msys2 {0}
46+
run: cmake -G "MinGW Makefiles" -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
47+
48+
- name: Build the project
49+
shell: msys2 {0}
50+
run: cmake --build build --verbose
51+
52+
- name: Run tests
53+
shell: msys2 {0}
54+
run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose
55+
working-directory: build

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ This file documents all notable changes to the Cloud-J repository since the init
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [8.0.2] - 2015-03-25
8+
### Added
9+
- Added Github actions workflow to build on Windows
10+
- Added tests which compare the output of Cloud-J to some saved reference output
11+
- Added four optional output arguments to CLOUD_JX and made them required in PHOTO_JX to retrieve direct and diffuse fluxes
12+
- Added version and license badges to README
13+
714
## [8.0.1] - 2024-09-30
815
### Added
916
- Added error handling to exit the model if JVN_ is less than number of entries in FJX_j2j.dat

CMakeLists.txt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Cloud-J/CMakeLists.txt
22

33
cmake_minimum_required(VERSION 3.5)
4-
project(CLOUDJ VERSION 8.0.1 LANGUAGES Fortran)
4+
project(CLOUDJ VERSION 8.0.2 LANGUAGES Fortran)
55

66
#-----------------------------------------------------------------------------
77
# Add CMakeScripts/ to the module path
@@ -18,6 +18,11 @@ message("Cloud-J ${PROJECT_VERSION}")
1818
message("Current status: ${CLDJ_REPO_VERSION}")
1919
message("=================================================================")
2020

21+
#-----------------------------------------------------------------------------
22+
# options
23+
#-----------------------------------------------------------------------------
24+
option(CLOUDJ_ENABLE_TESTS "Build the tests" ON)
25+
2126
#-----------------------------------------------------------------------------
2227
# Set policies
2328
#-----------------------------------------------------------------------------
@@ -326,9 +331,9 @@ file(WRITE ${CMAKE_BINARY_DIR}/CloudJBuildProperties.txt
326331
"CloudJBuildProperties::INTERFACE_INCLUDE_DIRECTORIES:${BT_INCLUDES}\n"
327332
)
328333

329-
#-----------------------------------------------------------------------------
334+
# -----------------------------------------------------------------------------
330335
# Try to compile a simple program that uses NetCDF-Fortran and OpenMP
331-
#-----------------------------------------------------------------------------
336+
# -----------------------------------------------------------------------------
332337
if(NOT CLOUDJ_EXTERNAL_CONFIG AND NOT CLOUDJ_TRY_RUN_PASSED)
333338

334339
# Format definitions with -D prefix
@@ -410,3 +415,19 @@ endif()
410415
# Add source code directory
411416
#-----------------------------------------------------------------------------
412417
add_subdirectory(src)
418+
419+
#-----------------------------------------------------------------------------
420+
# Add test directory
421+
#-----------------------------------------------------------------------------
422+
if (CLOUDJ_ENABLE_TESTS)
423+
enable_testing()
424+
425+
add_subdirectory(test)
426+
427+
#-----------------------------------------------------------------------------
428+
# The executable needs the data tables, copy them into the bin directory if tests are enabled
429+
#-----------------------------------------------------------------------------
430+
431+
add_custom_target(copy_table_data ALL ${CMAKE_COMMAND} -E copy_directory
432+
${PROJECT_SOURCE_DIR}/tables ${PROJECT_BINARY_DIR}/bin/tables)
433+
endif()

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# Cloud-J
22

3-
[![Ubuntu](https://github.com/geoschem/Cloud-J/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/geoschem/Cloud-J/actions/workflows/ubuntu.yml)
4-
[![Mac](https://github.com/geoschem/Cloud-J/actions/workflows/mac.yml/badge.svg)](https://github.com/geoschem/Cloud-J/actions/workflows/mac.yml)
5-
[![License](https://img.shields.io/badge/license-GPLv3-blue)](https://github.com/geoschem/Cloud-J/blob/main/LICENSE)
3+
<p>
4+
<a href="https://github.com/geoschem/hemco/cloud-j"><img src="https://img.shields.io/github/v/release/geoschem/cloud-j?include_prereleases&label=Latest%20Pre-Release"></a>
5+
<a href="https://github.com/geoschem/cloud-j/releases"><img src="https://img.shields.io/github/v/release/geoschem/cloud-j?label=Latest%20Stable%20Release"></a>
6+
<a href="https://github.com/geoschem/cloud-j/releases/"><img src="https://img.shields.io/github/release-date/geoschem/cloud-j"></a>
7+
<br />
8+
<a href="https://doi.org/10.5281/zenodo.13862693"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.13862693.svg" alt="DOI"></a>
9+
<a href="https://github.com/geoschem/Cloud-J/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-GPLv3-blue.svg"></a>
10+
<a href="https://github.com/geoschem/Cloud-J/actions/workflows/ubuntu.yml"><img src="https://github.com/geoschem/Cloud-J/actions/workflows/ubuntu.yml/badge.svg" alt="Ubuntu"></a>
11+
<a href="https://github.com/geoschem/Cloud-J/actions/workflows/mac.yml"><img src="https://github.com/geoschem/Cloud-J/actions/workflows/mac.yml/badge.svg" alt="Mac"></a>
12+
<a href="https://github.com/geoschem/Cloud-J/actions/workflows/windows.yml"><img src="https://github.com/geoschem/Cloud-J/actions/workflows/windows.yml/badge.svg" alt="Windows"></a>
13+
</p>
14+
15+
## Description
616

717
Cloud-J is a multi-scattering eight-stream radiative transfer model for solar radiation based on Fast-J. It was originally developed by Michael J. Prather (UCI). For information about the origins and history of Cloud-J and its predecessor Fast-J please see the [history document](https://github.com/geoschem/cloud-j/blob/main/docs/History_of_Fast-J_photolysis_code.md) in the docs subdirectory of this repository.
818

@@ -82,6 +92,21 @@ cd cloudj_rundir
8292
./cloudj_standalone | tee cloudj.log 2>&1
8393
```
8494

95+
96+
## How to run the tests
97+
Cloud-J ensures correctness by testing all changes against known output. This means that anytime that input data
98+
or an algorithm changes the [reference output](test/expected_output/reference_output.txt) will need to be updated.
99+
100+
To run the tests, compile Cloud-J and then run `make test` or `ctest` from within the build directory.
101+
102+
```
103+
make test
104+
```
105+
106+
```
107+
ctest
108+
```
109+
85110
## Debugging
86111

87112
If you wish to build Cloud-J with compiler debug flags on simply run the following command in your build folder prior to the <tt>make</tt> command.

src/Core/cldj_fjx_sub_mod.F90

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ MODULE CLDJ_FJX_SUB_MOD
119119
!-----------------------------------------------------------------------
120120
subroutine PHOTO_JX (U0,SZA,RFL,SOLF, LPRTJ, PPP,ZZZ,TTT,HHH, &
121121
DDD,RRR,OOO, CCC, LWP,IWP,REFFL,REFFI,AERSP, &
122-
NDXAER, L1U,ANU,NJXU, VALJXX,SKPERD,SWMSQ,OD18, LDARK,RC)
122+
NDXAER, L1U,ANU,NJXU, VALJXX,SKPERD,SWMSQ,OD18, &
123+
LDARK,FSBOT,FJBOT,FLXD,FJFLX,RC)
123124
! PHOTO_JX is the gateway to single column fast-JX calculations:
124125
! calc J's for a single column atmosphere (aka Indep Colm Atmos or ICA)
125126
! needs P, T, O3, clds, aersls, SZA (not lat or long), albedos, ...
@@ -149,12 +150,16 @@ subroutine PHOTO_JX (U0,SZA,RFL,SOLF, LPRTJ, PPP,ZZZ,TTT,HHH, &
149150
integer, intent(in) :: L1U ! cloud-j input
150151
integer, intent(in) :: NJXU ! cloud-j input
151152
! reports out the JX J-values, upper level program converts to CTM chemistry J's
152-
real*8,intent(out), dimension(L1U-1,NJXU):: VALJXX ! cloud-j output
153-
real*8,intent(out), dimension(S_+2,L1U) :: SKPERD ! cloud-j output
154-
real*8, intent(out), dimension(6) :: SWMSQ ! cloud-j output
155-
real*8, intent(out), dimension(L1U) :: OD18 ! cloud-j output
156-
logical, intent(out) :: LDARK ! cloud-j output
157-
integer, intent(inout) :: RC ! cloud-j output
153+
real*8, intent(out), dimension(L1U-1,NJXU) :: VALJXX
154+
real*8, intent(out), dimension(S_+2,L1U) :: SKPERD
155+
real*8, intent(out), dimension(6) :: SWMSQ
156+
real*8, intent(out), dimension(L1U) :: OD18
157+
logical, intent(out) :: LDARK
158+
real*8, intent(out), dimension(W_+W_r) :: FSBOT
159+
real*8, intent(out), dimension(W_+W_r) :: FJBOT
160+
real*8, intent(out), dimension(L1U,W_+W_r) :: FLXD
161+
real*8, intent(out), dimension(L1U,W_+W_r) :: FJFLX
162+
integer, intent(inout) :: RC
158163

159164
!-----------------------------------------------------------------------
160165
character(len=255) :: thisloc, errmsg
@@ -164,10 +169,10 @@ subroutine PHOTO_JX (U0,SZA,RFL,SOLF, LPRTJ, PPP,ZZZ,TTT,HHH, &
164169
real*8, dimension(L1_) :: TTJ,HHJ,DDJ,RRJ,OOJ,CCJ
165170
integer,dimension(L1_) :: JXTRA
166171
!
167-
real*8, dimension(W_+W_r) :: FJTOP,FJBOT,FSBOT,FLXD0
172+
real*8, dimension(W_+W_r) :: FJTOP, FLXD0
168173
real*8, dimension(5,W_+W_r) :: FIBOT
169-
real*8, dimension(L1_,W_+W_r) :: AVGF, FJFLX
170-
real*8, dimension(L1_,W_+W_r) :: DTAUX, FLXD
174+
real*8, dimension(L1_,W_+W_r) :: AVGF
175+
real*8, dimension(L1_,W_+W_r) :: DTAUX
171176
real*8, dimension(8,L1_,W_+W_r) :: POMEGAX
172177
!
173178
real*8, dimension(L1_) :: DTAU600

0 commit comments

Comments
 (0)