Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LenkaNovak committed Jan 30, 2024
1 parent 51f3018 commit 398b0c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BCReader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function update_midmonth_data!(date, bcf_info::BCFileInfo{FT}) where {FT}
# case 4: date crosses to the next month
elseif (date - all_dates[Int(midmonth_idx)]).value >= 0
@warn "On $date updating monthly data files: mid-month dates = [ $(all_dates[Int(midmonth_idx)]) , $(all_dates[Int(midmonth_idx+1)]) ]"
bcf_info.segment_length .= (all_dates[Int(midmonth_idx + 1)] - all_dates[Int(midmonth_idx)]).value # milliseconds!
bcf_info.segment_length .= (all_dates[Int(midmonth_idx + 1)] - all_dates[Int(midmonth_idx)]).value
bcf_info.monthly_fields[1] .= scaling_function(
Regridder.read_from_hdf5(bcfile_dir, hd_outfile_root, all_dates[Int(midmonth_idx)], varname, comms_ctx),
bcf_info,
Expand Down
4 changes: 2 additions & 2 deletions test/bcreader_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ for FT in (Float32, Float64)
@test bcf_info.monthly_fields[2] == bcf_info.monthly_fields[1]
@test bcf_info.segment_length[1] == Int(0)

# case 3: date - all_dates[segment_idx + 1] > 2 days
# case 3: date - all_dates[segment_idx + 1] >= 0
reset_bcf_info(bcf_info)
bcf_info.segment_idx[1] = bcf_info.segment_idx0[1]
date = DateTime(bcf_info.all_dates[bcf_info.segment_idx0[1] + 1] + Dates.Day(3))
Expand All @@ -281,7 +281,7 @@ for FT in (Float32, Float64)

@test bcf_info.segment_idx[1] == bcf_info.segment_idx0[1] == nearest_idx

# case 4: Dates.days(date - all_dates[Int(midmonth_idx)]) > 0
# case 4: Dates.days(date - all_dates[segment_idx]) >= 0
reset_bcf_info(bcf_info)
bcf_info.segment_idx[1] = bcf_info.segment_idx0[1]
date = DateTime(bcf_info.all_dates[bcf_info.segment_idx0[1]] + Dates.Day(3))
Expand Down
4 changes: 2 additions & 2 deletions test/mpi_tests/bcreader_mpi_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ end
@test bcf_info.monthly_fields[2] == bcf_info.monthly_fields[1]
@test bcf_info.segment_length[1] == Int(0)

# case 3: date - all_dates[segment_idx + 1] > 2 days
# case 3: date - all_dates[segment_idx + 1] >= 0
reset_bcf_info(bcf_info)
bcf_info.segment_idx[1] = bcf_info.segment_idx0[1]
date = DateTime(bcf_info.all_dates[bcf_info.segment_idx0[1] + 1] + Dates.Day(3))
Expand All @@ -233,7 +233,7 @@ end
ClimaComms.barrier(comms_ctx)
@test bcf_info.segment_idx[1] == bcf_info.segment_idx0[1] == nearest_idx

# case 4: Dates.days(date - all_dates[Int(midmonth_idx)]) > 0
# case 4: Dates.days(date - all_dates[segment_idx]) >= 0
reset_bcf_info(bcf_info)
bcf_info.segment_idx[1] = bcf_info.segment_idx0[1]
date = DateTime(bcf_info.all_dates[bcf_info.segment_idx0[1]] + Dates.Day(3))
Expand Down

0 comments on commit 398b0c6

Please sign in to comment.