From c5be9b2cfab5c4148e2c3a6f6cd3c6c54a24dd41 Mon Sep 17 00:00:00 2001 From: Alexander Barth Date: Fri, 27 Oct 2023 10:12:40 +0200 Subject: [PATCH] change test value issue #10 --- test/test_forcing.jl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/test_forcing.jl b/test/test_forcing.jl index 8995ff5..c573423 100644 --- a/test/test_forcing.jl +++ b/test/test_forcing.jl @@ -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") @@ -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_")