From a2a64a4dec29ea7b1be18894f84c23869465f93b Mon Sep 17 00:00:00 2001 From: sriharshakandala Date: Thu, 10 Oct 2024 15:47:36 -0700 Subject: [PATCH] Rename tests. Rename: rfmip_clear_sky => clear_sky all_sky => cloudy_sky all_sky_with_aerosols => all_sky_with_aerosols (no change) --- perf/benchmark.jl | 16 ++++++++-------- test/clear_sky_dyamond_gpu_benchmark.jl | 4 ++-- test/clear_sky_utils.jl | 4 ++-- test/{all_sky.jl => cloudy_sky.jl} | 6 +++--- ...rk.jl => cloudy_sky_dyamond_gpu_benchmark.jl} | 4 ++-- test/{all_sky_utils.jl => cloudy_sky_utils.jl} | 6 +++--- ...read_rfmip_clear_sky.jl => read_clear_sky.jl} | 2 +- test/{read_all_sky.jl => read_cloudy_sky.jl} | 2 +- test/runtests.jl | 6 +++--- 9 files changed, 25 insertions(+), 25 deletions(-) rename test/{all_sky.jl => cloudy_sky.jl} (94%) rename test/{all_sky_dyamond_gpu_benchmark.jl => cloudy_sky_dyamond_gpu_benchmark.jl} (98%) rename test/{all_sky_utils.jl => cloudy_sky_utils.jl} (98%) rename test/{read_rfmip_clear_sky.jl => read_clear_sky.jl} (99%) rename test/{read_all_sky.jl => read_cloudy_sky.jl} (99%) diff --git a/perf/benchmark.jl b/perf/benchmark.jl index 3552f3e77..fd104073c 100644 --- a/perf/benchmark.jl +++ b/perf/benchmark.jl @@ -91,15 +91,15 @@ end show(stdout, MIME("text/plain"), trial) println() -@info "------------------------------------------------- Benchmark: all_sky" +@info "------------------------------------------------- Benchmark: cloudy_sky" # @suppress_out begin -include(joinpath(root_dir, "test", "all_sky_utils.jl")) +include(joinpath(root_dir, "test", "cloudy_sky_utils.jl")) toler_lw_noscat = Dict(Float64 => Float64(1e-5), Float32 => Float32(0.05)) toler_lw_2stream = Dict(Float64 => Float64(5), Float32 => Float32(5)) toler_sw = Dict(Float64 => Float64(1e-5), Float32 => Float32(0.06)) -all_sky( +cloudy_sky( ClimaComms.context(), TwoStreamLWRTE, TwoStreamSWRTE, @@ -117,7 +117,7 @@ all_sky( solve_sw!(slv_sw, as, lookup_sw, lookup_sw_cld) # compile first solve_lw!(slv_lw, as, lookup_lw, lookup_lw_cld) # compile first -@info "all_sky, lw, use_lut=true" +@info "cloudy_sky, lw, use_lut=true" device = ClimaComms.device(ClimaComms.context()) trial = if device isa ClimaComms.CUDADevice using CUDA @@ -127,7 +127,7 @@ else end show(stdout, MIME("text/plain"), trial) println() -@info "all_sky, sw, use_lut=true" +@info "cloudy_sky, sw, use_lut=true" device = ClimaComms.device(ClimaComms.context()) trial = if device isa ClimaComms.CUDADevice using CUDA @@ -140,7 +140,7 @@ println() #= # @suppress_out begin -all_sky( +cloudy_sky( ClimaComms.context(), TwoStream, TwoStream, @@ -158,7 +158,7 @@ all_sky( solve_sw!(slv_sw, as, lookup_sw, lookup_sw_cld) # compile first solve_lw!(slv_lw, as, lookup_lw, lookup_lw_cld) # compile first -@info "all_sky, lw, use_lut=false" +@info "cloudy_sky, lw, use_lut=false" device = ClimaComms.device(ClimaComms.context()) trial = if device isa ClimaComms.CUDADevice using CUDA @@ -168,7 +168,7 @@ else end show(stdout, MIME("text/plain"), trial) println() -@info "all_sky, sw, use_lut=false" +@info "cloudy_sky, sw, use_lut=false" device = ClimaComms.device(ClimaComms.context()) trial = if device isa ClimaComms.CUDADevice using CUDA diff --git a/test/clear_sky_dyamond_gpu_benchmark.jl b/test/clear_sky_dyamond_gpu_benchmark.jl index 56365403b..cb022a1b4 100644 --- a/test/clear_sky_dyamond_gpu_benchmark.jl +++ b/test/clear_sky_dyamond_gpu_benchmark.jl @@ -25,7 +25,7 @@ using RRTMGP.ArtifactPaths # overriding some parameters to match with RRTMGP FORTRAN code include("reference_files.jl") -include("read_rfmip_clear_sky.jl") +include("read_clear_sky.jl") function benchmark_clear_sky( context, @@ -62,7 +62,7 @@ function benchmark_clear_sky( input_file = get_input_filename(:gas, :lw) # all-sky atmos state ds_lw_in = Dataset(input_file, "r") (as, sfc_emis, sfc_alb_direct, cos_zenith, toa_flux, bot_at_1) = - setup_rfmip_as(context, ds_lw_in, idx_gases, expt_no, lookup_lw, ncol, FT, VMR, param_set) + setup_clear_sky_as(context, ds_lw_in, idx_gases, expt_no, lookup_lw, ncol, FT, VMR, param_set) close(ds_lw_in) nlay, _ = AtmosphericStates.get_dims(as) diff --git a/test/clear_sky_utils.jl b/test/clear_sky_utils.jl index 5faae94ff..0a11de530 100644 --- a/test/clear_sky_utils.jl +++ b/test/clear_sky_utils.jl @@ -25,7 +25,7 @@ using RRTMGP.ArtifactPaths # overriding some parameters to match with RRTMGP FORTRAN code include("reference_files.jl") -include("read_rfmip_clear_sky.jl") +include("read_clear_sky.jl") #--------------------------------------------------------------- function clear_sky( context, @@ -63,7 +63,7 @@ function clear_sky( # reading rfmip data to atmospheric state ds_lw_in = Dataset(input_file, "r") (as, sfc_emis, sfc_alb_direct, cos_zenith, toa_flux, bot_at_1) = - setup_rfmip_as(context, ds_lw_in, idx_gases, expt_no, lookup_lw, ncol, FT, VMR, param_set) + setup_clear_sky_as(context, ds_lw_in, idx_gases, expt_no, lookup_lw, ncol, FT, VMR, param_set) close(ds_lw_in) nlay, _ = AtmosphericStates.get_dims(as) diff --git a/test/all_sky.jl b/test/cloudy_sky.jl similarity index 94% rename from test/all_sky.jl rename to test/cloudy_sky.jl index abdc2ff73..55bdebcbc 100644 --- a/test/all_sky.jl +++ b/test/cloudy_sky.jl @@ -1,5 +1,5 @@ FT = get(ARGS, 1, Float64) == "Float32" ? Float32 : Float64 -include("all_sky_utils.jl") +include("cloudy_sky_utils.jl") context = ClimaComms.context() @@ -8,7 +8,7 @@ toler_lw_2stream = Dict(Float64 => Float64(5), Float32 => Float32(5)) toler_sw = Dict(Float64 => Float64(1e-5), Float32 => Float32(0.06)) @testset "Cloudy-sky (gas + clouds) calculations using lookup table method, with non-scattering LW and TwoStream SW solvers" begin - @time all_sky( + @time cloudy_sky( context, NoScatLWRTE, TwoStreamSWRTE, @@ -22,7 +22,7 @@ toler_sw = Dict(Float64 => Float64(1e-5), Float32 => Float32(0.06)) end @testset "Cloudy-sky (gas + clouds) Two-stream calculations using lookup table method" begin - @time all_sky( + @time cloudy_sky( context, TwoStreamLWRTE, TwoStreamSWRTE, diff --git a/test/all_sky_dyamond_gpu_benchmark.jl b/test/cloudy_sky_dyamond_gpu_benchmark.jl similarity index 98% rename from test/all_sky_dyamond_gpu_benchmark.jl rename to test/cloudy_sky_dyamond_gpu_benchmark.jl index 3e0b7f0ca..f15071a8f 100644 --- a/test/all_sky_dyamond_gpu_benchmark.jl +++ b/test/cloudy_sky_dyamond_gpu_benchmark.jl @@ -25,7 +25,7 @@ using RRTMGP.ArtifactPaths # overriding some parameters to match with RRTMGP FORTRAN code include("reference_files.jl") -include("read_all_sky.jl") +include("read_cloudy_sky.jl") function benchmark_all_sky( context, @@ -70,7 +70,7 @@ function benchmark_all_sky( close(ds_sw_cld) # reading input file ds_in = Dataset(input_file, "r") - as, sfc_emis, sfc_alb_direct, sfc_alb_diffuse, cos_zenith, toa_flux, bot_at_1 = setup_allsky_as( + as, sfc_emis, sfc_alb_direct, sfc_alb_diffuse, cos_zenith, toa_flux, bot_at_1 = setup_cloudy_sky_as( context, ds_in, idx_gases, diff --git a/test/all_sky_utils.jl b/test/cloudy_sky_utils.jl similarity index 98% rename from test/all_sky_utils.jl rename to test/cloudy_sky_utils.jl index 5c3cb931a..cbb7d9bf4 100644 --- a/test/all_sky_utils.jl +++ b/test/cloudy_sky_utils.jl @@ -24,9 +24,9 @@ using RRTMGP.ArtifactPaths # overriding some parameters to match with RRTMGP FORTRAN code include("reference_files.jl") -include("read_all_sky.jl") +include("read_cloudy_sky.jl") -function all_sky( +function cloudy_sky( context, ::Type{SLVLW}, ::Type{SLVSW}, @@ -70,7 +70,7 @@ function all_sky( close(ds_sw_cld) # reading input file ds_in = Dataset(input_file, "r") - as, sfc_emis, sfc_alb_direct, sfc_alb_diffuse, cos_zenith, toa_flux, bot_at_1 = setup_allsky_as( + as, sfc_emis, sfc_alb_direct, sfc_alb_diffuse, cos_zenith, toa_flux, bot_at_1 = setup_cloudy_sky_as( context, ds_in, idx_gases, diff --git a/test/read_rfmip_clear_sky.jl b/test/read_clear_sky.jl similarity index 99% rename from test/read_rfmip_clear_sky.jl rename to test/read_clear_sky.jl index eb2cc214e..0f67b4566 100644 --- a/test/read_rfmip_clear_sky.jl +++ b/test/read_clear_sky.jl @@ -4,7 +4,7 @@ function ncol_ds_clear_sky() return size(Array(ds_comp["rlu"]), 2) end -function setup_rfmip_as( +function setup_clear_sky_as( context, ds_lw_in, idx_gases, diff --git a/test/read_all_sky.jl b/test/read_cloudy_sky.jl similarity index 99% rename from test/read_all_sky.jl rename to test/read_cloudy_sky.jl index 877232db7..7ad535c69 100644 --- a/test/read_all_sky.jl +++ b/test/read_cloudy_sky.jl @@ -4,7 +4,7 @@ function ncol_ds_all_sky(use_lut) return size(Array(ds_comp["lw_flux_up"]), 1) end -function setup_allsky_as( +function setup_cloudy_sky_as( context, ds_in, idx_gases, diff --git a/test/runtests.jl b/test/runtests.jl index dff12678e..456847f60 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,9 +35,9 @@ printstyled("=================================\n\n", color = color1) toler_lw_2stream = Dict(Float64 => Float64(5), Float32 => Float32(5)) toler_sw = Dict(Float64 => Float64(1e-5), Float32 => Float32(0.06)) - include("all_sky_utils.jl") + include("cloudy_sky_utils.jl") for FT in (Float32, Float64) - all_sky( + cloudy_sky( context, NoScatLWRTE, TwoStreamSWRTE, @@ -48,7 +48,7 @@ printstyled("=================================\n\n", color = color1) use_lut = true, cldfrac = FT(1), ) - all_sky( + cloudy_sky( context, TwoStreamLWRTE, TwoStreamSWRTE,