Skip to content

Commit

Permalink
change test value issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Oct 27, 2023
1 parent 514677a commit c5be9b2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/test_forcing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using Downloads: download
# generate reference data:
# * apply patch d_ecmwf2roms.m.patch
# * run matlab d_ecmwf2roms.m script to generate gom_*_era.nc files

# * be aware that units have changed for swflux

datadir = joinpath(dirname(@__FILE__),"..","data")

Expand All @@ -29,6 +29,17 @@ if !isdir(datadir)
datadir = joinpath(temporarydir,"ROMS-test-data")
end

# change units in swflux issue #10
# https://www.myroms.org/projects/src/ticket/870
NCDataset(joinpath(datadir,"gom_swflux_era.nc"),"a") do ds
@assert ds["swflux"].attrib["units"] in ("centimeter day-1","m s-1")

if ds["swflux"].attrib["units"] == "centimeter day-1"
ds["swflux"][:,:,:] = ds["swflux"][:,:,:] * 0.01 / (24*60*60)
ds["swflux"].attrib["units"] = "m s-1" # was centimeter day-1
end
end

@show datadir
atmo_fname = joinpath(datadir,"ecmwf_sample_data.nc")
filename_prefix = joinpath(datadir,"liguriansea_")
Expand Down

0 comments on commit c5be9b2

Please sign in to comment.