Skip to content

Commit 2a58f41

Browse files
authored
Merge pull request #367 from mabruzzo/calcTbugfix
address a bug calc_temp_cloudy_g.F
2 parents adcbfd6 + 684837e commit 2a58f41

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ commands:
200200
gold-standard-tag:
201201
description: "The gold-standard to use for generating the answers"
202202
type: string
203-
default: "gold-standard-v3"
203+
default: "gold-standard-v4"
204204
steps:
205205
- run:
206206
name: "Build Pygrackle from Gold-Standard Commit (<< parameters.gold-standard-tag >>)"

src/clib/calc_temp_cloudy_g.F

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ subroutine calc_temp_cloudy_g(d, e, metal, temperature,
147147
do i = is+1, ie+1
148148
itmask(i) = .true.
149149

150-
rhoH(i) = fh * d(i,j,k)
150+
if (imetal .eq. 1) then
151+
rhoH(i) = fh * (d(i,j,k) - metal(i,j,k))
152+
else
153+
rhoH(i) = fh * d(i,j,k)
154+
endif
155+
151156
enddo
152157

153158
! Calculate temperature and mean molecular weight

src/python/tests/test_get_grackle_version.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@ def _run(args):
3232
return _rslt.stdout.decode().rstrip()
3333

3434
# get the name of the most recent tag preceeding this commit:
35-
most_recent_tag = _run(["git", "describe", "--abbrev=0", "--tags"])
36-
if most_recent_tag.startswith("grackle-"):
37-
latest_tagged_version = most_recent_tag[8:]
38-
elif most_recent_tag.startswith("gold-standard-v"):
39-
latest_tagged_version = most_recent_tag[15:]
40-
else:
41-
raise RuntimeError(
42-
"expected the most recent git-tag to start with "
43-
"'grackle-' or 'gold-standard-v'"
44-
)
35+
prefix = "grackle-"
36+
descr_args = ["git", "describe", "--abbrev=0", "--tags", "--match", (prefix + "*")]
37+
try:
38+
most_recent_tag = _run(descr_args)
39+
except subprocess.CalledProcessError:
40+
pytest.skip("could not find git-tag that starts with {prefix!r}")
41+
latest_tagged_version = most_recent_tag[len(prefix) :]
4542

4643
# get the actual revision when most_recent tag was introduced
4744
revision_of_tag = _run(["git", "rev-parse", "-n", "1", most_recent_tag])

0 commit comments

Comments
 (0)