Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

30 forcing pertubation bugfix #68

Merged
merged 2 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libforcing/src/forcing_config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ subroutine forcing_config_parse_field(self, field_jv_ptr, field_ptr, &
character(kind=CK, len=:), allocatable :: dimension_type
character(kind=CK, len=:), allocatable :: perturbation_calendar

integer :: perturbation_constant_value
real :: perturbation_constant_value
logical :: found, domain_found
integer :: num_perturbations, num_fields
integer :: i, j
Expand Down
2 changes: 1 addition & 1 deletion libforcing/src/forcing_perturbation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module forcing_perturbation_mod
integer :: serperable_id
character(len=64) :: name
character(len=1024) :: filename_template
integer :: constant_value
real :: constant_value
type(ncvar_type) :: ncvar
logical :: initialised
logical :: valid
Expand Down
4 changes: 2 additions & 2 deletions libforcing/test/test_forcing_perturbations.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def run_simple_test(self, ptype, pdimension, pvalue, pcalendar):
perturb_array = f.variables[FORCING_FIELDNAME][tidx, :]
else:
assert pdimension == 'constant'
perturb_array = int(pvalue)
perturb_array = float(pvalue)

# Do the perturbation in Python code and check that it is as expected
if ptype == 'scaling':
Expand All @@ -141,7 +141,7 @@ def test_constant(self, perturb_type, calendar):
Test constant scaling and offset
"""

perturb_value = random.randint(0, 100)
perturb_value = random.random()
self.run_simple_test(perturb_type, 'constant', perturb_value, calendar)


Expand Down