diff --git a/.buildkite/Manifest-v1.11.toml b/.buildkite/Manifest-v1.11.toml index a0498c0a30..fadd7612ac 100644 --- a/.buildkite/Manifest-v1.11.toml +++ b/.buildkite/Manifest-v1.11.toml @@ -2,7 +2,7 @@ julia_version = "1.11.1" manifest_format = "2.0" -project_hash = "3917c95a044eadd49961b2c47f19f05160833ba5" +project_hash = "bf1216ed2bc76713a01437d07332219f6bcd0c54" [[deps.ADTypes]] git-tree-sha1 = "eea5d80188827b35333801ef97a40c2ed653b081" @@ -244,6 +244,12 @@ weakdeps = ["BandedMatrices"] [deps.BlockArrays.extensions] BlockArraysBandedMatricesExt = "BandedMatrices" +[[deps.Blosc_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "ef12cdd1c7fb7e1dfd6fa8fd60d4db6bc61d2f23" +uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" +version = "1.21.6+0" + [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "8873e196c2eb87962a2048b3b8e08946535864a1" @@ -821,10 +827,10 @@ uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" version = "0.4.2" [[deps.FFMPEG_jll]] -deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Pkg", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] -git-tree-sha1 = "74faea50c1d007c85837327f6775bea60b5492dd" +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] +git-tree-sha1 = "466d45dc38e15794ec7d5d63ec03d776a9aff36e" uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" -version = "4.4.2+2" +version = "4.4.4+1" [[deps.FFTW]] deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] @@ -995,9 +1001,9 @@ version = "2.13.2+0" [[deps.FreeTypeAbstraction]] deps = ["ColorVectorSpace", "Colors", "FreeType", "GeometryBasics"] -git-tree-sha1 = "2493cdfd0740015955a8e46de4ef28f49460d8bc" +git-tree-sha1 = "84dfe824bd6fdf2a5d73bb187ff31b5549b2a79c" uuid = "663a7486-cb36-511b-a19d-713bb74d65c9" -version = "0.10.3" +version = "0.10.4" [[deps.FriBidi_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -1033,6 +1039,11 @@ git-tree-sha1 = "532f9126ad901533af1d4f5c198867227a7bb077" uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" version = "3.4.0+1" +[[deps.GMP_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" +version = "6.3.0+0" + [[deps.GPUArrays]] deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"] git-tree-sha1 = "62ee71528cca49be797076a76bdc654a170a523e" @@ -1052,16 +1063,16 @@ uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" version = "0.27.8" [[deps.GR]] -deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"] -git-tree-sha1 = "ddda044ca260ee324c5fc07edb6d7cf3f0b9c350" +deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Qt6Wayland_jll", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"] +git-tree-sha1 = "ee28ddcd5517d54e417182fec3886e7412d3926f" uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" -version = "0.73.5" +version = "0.73.8" [[deps.GR_jll]] deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "FreeType2_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt6Base_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "278e5e0f820178e8a26df3184fcb2280717c79b1" +git-tree-sha1 = "f31929b9e67066bee48eec8b03c0df47d31a74b3" uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" -version = "0.73.5+0" +version = "0.73.8+0" [[deps.GaussQuadrature]] deps = ["SpecialFunctions"] @@ -1151,6 +1162,12 @@ git-tree-sha1 = "674ff0db93fffcd11a3573986e550d66cd4fd71f" uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" version = "2.80.5+0" +[[deps.GnuTLS_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Nettle_jll", "P11Kit_jll", "Zlib_jll"] +git-tree-sha1 = "383db7d3f900f4c1f47a8a04115b053c095e48d3" +uuid = "0951126a-58fd-58f1-b5b3-b08c7c4a876d" +version = "3.8.4+0" + [[deps.Graphics]] deps = ["Colors", "LinearAlgebra", "NaNMath"] git-tree-sha1 = "d61890399bc535850c4bf08e4e0d3a7ad0f21cbd" @@ -1185,10 +1202,10 @@ weakdeps = ["MPI"] MPIExt = "MPI" [[deps.HDF5_jll]] -deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "4cc2bb72df6ff40b055295fdef6d92955f9dede8" +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "OpenSSL_jll", "TOML", "Zlib_jll", "libaec_jll"] +git-tree-sha1 = "38c8874692d48d5440d5752d6c74b0c6b0b60739" uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" -version = "1.12.2+2" +version = "1.14.2+1" [[deps.HTTP]] deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] @@ -1468,10 +1485,10 @@ uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d" version = "3.100.2+0" [[deps.LERC_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "36bdbc52f13a7d1dcb0f3cd694e01677a515655b" uuid = "88015f11-f218-50d7-93a8-a6af411a945d" -version = "3.0.0+1" +version = "4.0.0+0" [[deps.LLVM]] deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Preferences", "Printf", "Unicode"] @@ -1619,9 +1636,9 @@ version = "2.40.1+0" [[deps.Libtiff_jll]] deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "2da088d113af58221c52828a80378e16be7d037a" +git-tree-sha1 = "b404131d06f7886402758c9ce2214b636eb4d54a" uuid = "89763e89-9b03-5906-acba-b20f662cd828" -version = "4.5.1+1" +version = "4.7.0+0" [[deps.Libuuid_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -1656,6 +1673,12 @@ version = "2.9.0" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" LDLFactorizations = "40e66cde-538c-5869-a4ad-c39174c6795b" +[[deps.LittleCMS_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll"] +git-tree-sha1 = "fa7fd067dca76cadd880f1ca937b4f387975a9f5" +uuid = "d3a379c0-f9a3-5b72-a4c0-6bf4d2e8af0f" +version = "2.16.0+0" + [[deps.LogExpFunctions]] deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" @@ -1682,6 +1705,12 @@ git-tree-sha1 = "f02b56007b064fbfddb4c9cd60161b6dd0f40df3" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" version = "1.1.0" +[[deps.Lz4_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "abf88ff67f4fd89839efcae2f4c39cbc4ecd0846" +uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" +version = "1.10.0+1" + [[deps.MKL_jll]] deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "oneTBB_jll"] git-tree-sha1 = "f046ccd0c6db2832a9f639e2c669c6fe867e5f4f" @@ -1949,10 +1978,10 @@ uuid = "436b0209-26ab-4e65-94a9-6526d86fea76" version = "0.1.0" [[deps.NetCDF_jll]] -deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Pkg", "XML2_jll", "Zlib_jll"] -git-tree-sha1 = "072f8371f74c3b9e1b26679de7fbf059d45ea221" +deps = ["Artifacts", "Blosc_jll", "Bzip2_jll", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenMPI_jll", "XML2_jll", "Zlib_jll", "Zstd_jll", "libzip_jll"] +git-tree-sha1 = "a8af1798e4eb9ff768ce7fdefc0e957097793f15" uuid = "7243133f-43d8-5620-bbf4-c2c921802cf3" -version = "400.902.5+1" +version = "400.902.209+0" [[deps.Netpbm]] deps = ["FileIO", "ImageCore", "ImageMetadata"] @@ -1960,6 +1989,12 @@ git-tree-sha1 = "d92b107dbb887293622df7697a2223f9f8176fcd" uuid = "f09324ee-3d7c-5217-9330-fc30815ba969" version = "1.1.1" +[[deps.Nettle_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "eca63e3847dad608cfa6a3329b95ef674c7160b4" +uuid = "4c82536e-c426-54e4-b420-14f461c4ed8b" +version = "3.7.2+0" + [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" @@ -2007,6 +2042,12 @@ git-tree-sha1 = "8292dd5c8a38257111ada2174000a33745b06d4e" uuid = "18a262bb-aa17-5467-a713-aee519bc75cb" version = "3.2.4+0" +[[deps.OpenJpeg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libtiff_jll", "LittleCMS_jll", "libpng_jll"] +git-tree-sha1 = "f4cb457ffac5f5cf695699f82c537073958a6a6c" +uuid = "643b3616-a352-519d-856d-80112ee9badc" +version = "2.5.2+0" + [[deps.OpenLibm_jll]] deps = ["Artifacts", "Libdl"] uuid = "05823500-19ac-5b8b-9628-191a04bc5112" @@ -2026,9 +2067,9 @@ version = "1.4.3" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "ad31332567b189f508a3ea8957a2640b1147ab00" +git-tree-sha1 = "7493f61f55a6cce7325f197443aa80d32554ba10" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.23+1" +version = "3.0.15+1" [[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -2053,6 +2094,12 @@ git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" version = "1.6.3" +[[deps.P11Kit_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "2cd396108e178f3ae8dedbd8e938a18726ab2fbf" +uuid = "c2071276-7c44-58a7-b746-946036e04d0a" +version = "0.24.1+0" + [[deps.PCRE2_jll]] deps = ["Artifacts", "Libdl"] uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15" @@ -2140,9 +2187,9 @@ version = "0.3.3" [[deps.PlotThemes]] deps = ["PlotUtils", "Statistics"] -git-tree-sha1 = "6e55c6841ce3411ccb3457ee52fc48cb698d6fb0" +git-tree-sha1 = "41031ef3a1be6f5bbbf3e8073f210556daeae5ca" uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" -version = "3.2.0" +version = "3.3.0" [[deps.PlotUtils]] deps = ["ColorSchemes", "Colors", "Dates", "PrecompileTools", "Printf", "Random", "Reexport", "StableRNGs", "Statistics"] @@ -2193,6 +2240,12 @@ git-tree-sha1 = "36d8b4b899628fb92c2749eb488d884a926614d3" uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" version = "1.4.3" +[[deps.Poppler_jll]] +deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "JpegTurbo_jll", "LibCURL_jll", "Libdl", "Libtiff_jll", "OpenJpeg_jll", "libpng_jll"] +git-tree-sha1 = "7dbfb7f61c3aa5def7b7dad3fa344c1c2858a83b" +uuid = "9c32591e-4766-534b-9725-b71a8799265b" +version = "24.6.0+0" + [[deps.PreallocationTools]] deps = ["Adapt", "ArrayInterface", "ForwardDiff"] git-tree-sha1 = "6c62ce45f268f3f958821a1e5192cf91c75ae89c" @@ -2274,9 +2327,27 @@ version = "1.0.0" [[deps.Qt6Base_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Vulkan_Loader_jll", "Xorg_libSM_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_cursor_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "libinput_jll", "xkbcommon_jll"] -git-tree-sha1 = "7c29f0e8c575428bd84dc3c72ece5178caa67336" +git-tree-sha1 = "492601870742dcd38f233b23c3ec629628c1d724" uuid = "c0090381-4147-56d7-9ebc-da0b1113ec56" -version = "6.5.2+2" +version = "6.7.1+1" + +[[deps.Qt6Declarative_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Qt6Base_jll", "Qt6ShaderTools_jll"] +git-tree-sha1 = "e5dd466bf2569fe08c91a2cc29c1003f4797ac3b" +uuid = "629bc702-f1f5-5709-abd5-49b8460ea067" +version = "6.7.1+2" + +[[deps.Qt6ShaderTools_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Qt6Base_jll"] +git-tree-sha1 = "1a180aeced866700d4bebc3120ea1451201f16bc" +uuid = "ce943373-25bb-56aa-8eca-768745ed7b5a" +version = "6.7.1+1" + +[[deps.Qt6Wayland_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Qt6Base_jll", "Qt6Declarative_jll"] +git-tree-sha1 = "729927532d48cf79f49070341e1d918a65aba6b0" +uuid = "e99dba38-086e-5de3-a5b1-6e4c66e897c3" +version = "6.7.1+1" [[deps.QuadGK]] deps = ["DataStructures", "LinearAlgebra"] @@ -2734,9 +2805,9 @@ weakdeps = ["ClimaParams"] [[deps.SymbolicIndexingInterface]] deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] -git-tree-sha1 = "4bc96df5d71515b1cb86dd626915f06f4c0d46f5" +git-tree-sha1 = "20cf607cafb31f922bce84d60379203e7a126911" uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" -version = "0.3.33" +version = "0.3.34" [[deps.TOML]] deps = ["Dates"] @@ -3179,6 +3250,12 @@ git-tree-sha1 = "51b5eeb3f98367157a7a12a1fb0aa5328946c03c" uuid = "9a68df92-36a6-505f-a73e-abb412b6bfb4" version = "0.2.3+0" +[[deps.libaec_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "46bf7be2917b59b761247be3f317ddf75e50e997" +uuid = "477f73a3-ac25-53e9-8cc3-50b2fa2566f0" +version = "1.1.2+0" + [[deps.libaom_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "1827acba325fdcdf1d2647fc8d5301dd9ba43a9d" @@ -3238,6 +3315,12 @@ git-tree-sha1 = "490376214c4721cdaca654041f635213c6165cb3" uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" version = "1.3.7+2" +[[deps.libzip_jll]] +deps = ["Artifacts", "Bzip2_jll", "GnuTLS_jll", "JLLWrappers", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "668ac0297e6bd8f4d53dfdcd3ace71f2e00f4a35" +uuid = "337d8026-41b4-5cde-a456-74a10e5b31d1" +version = "1.11.1+0" + [[deps.mtdev_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "814e154bdb7be91d78b6802843f76b6ece642f11" diff --git a/.buildkite/Project.toml b/.buildkite/Project.toml index a53e331c9e..7f298bb8a0 100644 --- a/.buildkite/Project.toml +++ b/.buildkite/Project.toml @@ -29,6 +29,7 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab" NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +Poppler_jll = "9c32591e-4766-534b-9725-b71a8799265b" ProfileCanvas = "efd6af41-a80b-495e-886c-e51b0c7d77a3" RootSolvers = "7181ea78-2dcb-4de3-ab41-2b8ab5a31e74" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" diff --git a/.buildkite/longruns_gpu/pipeline.yml b/.buildkite/longruns_gpu/pipeline.yml index d3a5ec5283..b7f72b565c 100644 --- a/.buildkite/longruns_gpu/pipeline.yml +++ b/.buildkite/longruns_gpu/pipeline.yml @@ -34,7 +34,7 @@ steps: - label: ":seedling: Soil-Canopy" command: - julia --color=yes --project=.buildkite experiments/long_runs/land.jl - artifact_paths: "land_longrun_gpu/*png" + artifact_paths: "land_longrun_gpu/*pdf" agents: slurm_gpus: 1 slurm_time: 03:00:00 @@ -44,7 +44,7 @@ steps: - label: ":sun: California regional simulation" command: - julia --color=yes --project=.buildkite experiments/long_runs/land_region.jl - artifact_paths: "california_longrun_gpu/*png" + artifact_paths: "california_longrun_gpu/*pdf" agents: slurm_gpus: 1 slurm_time: 00:30:00 @@ -54,7 +54,7 @@ steps: - label: "Soil" command: - julia --color=yes --project=.buildkite experiments/long_runs/soil.jl - artifact_paths: "soil_longrun_gpu/*png" + artifact_paths: "soil_longrun_gpu/*pdf" agents: slurm_gpus: 1 slurm_time: 01:30:00 @@ -64,7 +64,7 @@ steps: - label: "Global bucket simulation" command: - julia --color=yes --project=.buildkite experiments/long_runs/bucket.jl - artifact_paths: "bucket_longrun_gpu/*png" + artifact_paths: "bucket_longrun_gpu/*pdf" agents: slurm_gpus: 1 slurm_time: 00:30:00 diff --git a/experiments/long_runs/bucket.jl b/experiments/long_runs/bucket.jl index 1a6351c221..40539b2621 100644 --- a/experiments/long_runs/bucket.jl +++ b/experiments/long_runs/bucket.jl @@ -1,7 +1,7 @@ # # Global bucket run # The code sets up and runs the bucket model on a spherical domain, -# using ERA5 data. +# using ERA5 data. # Simulation Setup # Number of spatial elements: 101 in horizontal, 5 in vertical @@ -38,6 +38,8 @@ using CairoMakie using Dates import NCDatasets +using Poppler_jll: pdfunite + const FT = Float64; time_interpolation_method = LinearInterpolation(PeriodicCalendar()) regridder_type = :InterpolationsRegridder @@ -169,23 +171,28 @@ setup_and_solve_problem(; greet = true); # read in diagnostics and make some plots! #### ClimaAnalysis #### simdir = ClimaAnalysis.SimDir(outdir) -short_names = - ["swa", "rn", "tsfc", "qsfc", "lhf", "shf", "wsoil", "wsfc", "ssfc"] -for short_name in short_names - var = get(simdir; short_name) - times = ClimaAnalysis.times(var) - for t in times +short_names = ["tsfc", "lhf", "shf", "wsoil"] +mktempdir(root_path) do tmpdir + for short_name in short_names var = get(simdir; short_name) - fig = CairoMakie.Figure(size = (800, 600)) - kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() - viz.heatmap2D_on_globe!( - fig, - ClimaAnalysis.slice(var, time = t; kwargs...), - mask = viz.oceanmask(), - more_kwargs = Dict( - :mask => ClimaAnalysis.Utils.kwargs(color = :white), - ), - ) - CairoMakie.save(joinpath(root_path, "$(short_name)_$t.png"), fig) + times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]] + for t in times + var = get(simdir; short_name) + fig = CairoMakie.Figure(size = (600, 400)) + kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() + viz.heatmap2D_on_globe!( + fig, + ClimaAnalysis.slice(var, time = t; kwargs...), + mask = viz.oceanmask(), + more_kwargs = Dict( + :mask => ClimaAnalysis.Utils.kwargs(color = :white), + ), + ) + CairoMakie.save(joinpath(tmpdir, "$(short_name)_$t.pdf"), fig) + end + end + figures = readdir(tmpdir, join = true) + pdfunite() do unite + run(Cmd([unite, figures..., joinpath(root_path, "figures.pdf")])) end end diff --git a/experiments/long_runs/land.jl b/experiments/long_runs/land.jl index d2afce92e3..61efce0d6e 100644 --- a/experiments/long_runs/land.jl +++ b/experiments/long_runs/land.jl @@ -46,6 +46,8 @@ import GeoMakie using Dates import NCDatasets +using Poppler_jll: pdfunite + const FT = Float64; time_interpolation_method = LinearInterpolation(PeriodicCalendar()) regridder_type = :InterpolationsRegridder @@ -598,22 +600,27 @@ setup_and_solve_problem(; greet = true); # read in diagnostics and make some plots! #### ClimaAnalysis #### simdir = ClimaAnalysis.SimDir(outdir) -short_names = - ["gpp", "ct", "lai", "swc", "si", "swa", "lwu", "et", "er", "sr", "sif"] -for short_name in short_names - var = get(simdir; short_name) - times = ClimaAnalysis.times(var) - for t in times - fig = CairoMakie.Figure(size = (800, 600)) - kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() - viz.heatmap2D_on_globe!( - fig, - ClimaAnalysis.slice(var, time = t; kwargs...), - mask = viz.oceanmask(), - more_kwargs = Dict( - :mask => ClimaAnalysis.Utils.kwargs(color = :white), - ), - ) - CairoMakie.save(joinpath(root_path, "$(short_name)_$t.png"), fig) +short_names = ["gpp", "swc", "et", "ct"] +mktempdir(root_path) do tmpdir + for short_name in short_names + var = get(simdir; short_name) + times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]] + for t in times + fig = CairoMakie.Figure(size = (600, 400)) + kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() + viz.heatmap2D_on_globe!( + fig, + ClimaAnalysis.slice(var, time = t; kwargs...), + mask = viz.oceanmask(), + more_kwargs = Dict( + :mask => ClimaAnalysis.Utils.kwargs(color = :white), + ), + ) + CairoMakie.save(joinpath(tmpdir, "$(short_name)_$t.pdf"), fig) + end + end + figures = readdir(tmpdir, join = true) + pdfunite() do unite + run(Cmd([unite, figures..., joinpath(root_path, "figures.pdf")])) end end diff --git a/experiments/long_runs/land_region.jl b/experiments/long_runs/land_region.jl index 8307b8a0da..f4f37221b0 100644 --- a/experiments/long_runs/land_region.jl +++ b/experiments/long_runs/land_region.jl @@ -45,6 +45,8 @@ using CairoMakie using Dates import NCDatasets +using Poppler_jll: pdfunite + const FT = Float64; time_interpolation_method = LinearInterpolation(PeriodicCalendar()) regridder_type = :InterpolationsRegridder @@ -603,16 +605,22 @@ setup_and_solve_problem(; greet = true); #### ClimaAnalysis #### simdir = ClimaAnalysis.SimDir(outdir) short_names = ["gpp", "ct", "swc", "si"] -for short_name in short_names - var = get(simdir; short_name) - times = ClimaAnalysis.times(var) - for t in times - fig = CairoMakie.Figure(size = (800, 600)) - kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() - tmp = ClimaAnalysis.slice(var, time = t; kwargs...) - if !all(isnan.(tmp.data)) - viz.heatmap2D!(fig, tmp) - CairoMakie.save(joinpath(root_path, "$(short_name)_$t.png"), fig) +mktempdir(root_path) do tmpdir + for short_name in short_names + var = get(simdir; short_name) + times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]] + for t in times + fig = CairoMakie.Figure(size = (600, 400)) + kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() + tmp = ClimaAnalysis.slice(var, time = t; kwargs...) + if !all(isnan.(tmp.data)) + viz.heatmap2D!(fig, tmp) + CairoMakie.save(joinpath(tmpdir, "$(short_name)_$t.pdf"), fig) + end end end + figures = readdir(tmpdir, join = true) + pdfunite() do unite + run(Cmd([unite, figures..., joinpath(root_path, "figures.pdf")])) + end end diff --git a/experiments/long_runs/soil.jl b/experiments/long_runs/soil.jl index ce667e0d81..fff4011dc2 100644 --- a/experiments/long_runs/soil.jl +++ b/experiments/long_runs/soil.jl @@ -44,6 +44,8 @@ using CairoMakie using Dates import NCDatasets +using Poppler_jll: pdfunite + const FT = Float64; time_interpolation_method = LinearInterpolation(PeriodicCalendar()) regridder_type = :InterpolationsRegridder @@ -369,21 +371,27 @@ setup_and_solve_problem(; greet = true); #### ClimaAnalysis #### simdir = ClimaAnalysis.SimDir(outdir) short_names = ["swc", "si", "sie"] -for short_name in short_names - var = get(simdir; short_name) - times = ClimaAnalysis.times(var) - for t in times +mktempdir(root_path) do tmpdir + for short_name in short_names var = get(simdir; short_name) - fig = CairoMakie.Figure(size = (800, 600)) - kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() - viz.heatmap2D_on_globe!( - fig, - ClimaAnalysis.slice(var, time = t; kwargs...), - mask = viz.oceanmask(), - more_kwargs = Dict( - :mask => ClimaAnalysis.Utils.kwargs(color = :white), - ), - ) - CairoMakie.save(joinpath(root_path, "$(short_name)_$t.png"), fig) + times = [ClimaAnalysis.times(var)[1], ClimaAnalysis.times(var)[end]] + for t in times + var = get(simdir; short_name) + fig = CairoMakie.Figure(size = (600, 400)) + kwargs = ClimaAnalysis.has_altitude(var) ? Dict(:z => 1) : Dict() + viz.heatmap2D_on_globe!( + fig, + ClimaAnalysis.slice(var, time = t; kwargs...), + mask = viz.oceanmask(), + more_kwargs = Dict( + :mask => ClimaAnalysis.Utils.kwargs(color = :white), + ), + ) + CairoMakie.save(joinpath(tmpdir, "$(short_name)_$t.pdf"), fig) + end + end + figures = readdir(tmpdir, join = true) + pdfunite() do unite + run(Cmd([unite, figures..., joinpath(root_path, "figures.pdf")])) end end diff --git a/test/diagnostics/diagnostics_tests.jl b/test/diagnostics/diagnostics_tests.jl index 7d9f6b49c4..6b3b0a319e 100644 --- a/test/diagnostics/diagnostics_tests.jl +++ b/test/diagnostics/diagnostics_tests.jl @@ -1,14 +1,17 @@ using Test using ClimaLand using ClimaLand.Diagnostics: @with_error +import ClimaComms +ClimaComms.@import_required_backends +import ClimaParams +import SciMLBase +import ClimaTimeSteppers +import ClimaDiagnostics +using Dates +using Statistics @test isdefined(ClimaLand.Diagnostics, :compute_sw_albedo!) -@test !hasmethod( - ClimaLand.Diagnostics.compute_sw_albedo!, - (Any, Any, Any, Any, Any), -) - # Define some diagnostics for a DummyModel @test ClimaLand.Diagnostics.ALL_DIAGNOSTICS isa Dict @@ -30,17 +33,91 @@ ClimaLand.Diagnostics.add_diagnostic_variable!( @test length(ClimaLand.Diagnostics.ALL_DIAGNOSTICS) == 1 -ClimaLand.Diagnostics.define_diagnostics!(DummyModel()) +# First, run a simulation for 1 hour +FT = Float32 +seconds = 1.0; +minutes = 60seconds; +hours = 60minutes; +t0 = 0.0 +Δt = 1minutes +tf = 2hours +bucket_domain = ClimaLand.SphericalShell(; + radius = FT(100), + depth = FT(3.5), + nelements = (1, 10), + npolynomial = 1, +) + +bucket_atmos, bucket_rad = ClimaLand.prescribed_analytic_forcing(FT) +τc = FT(1.0) +α_bareground_func = (coordinate_point) -> 0.2 +α_snow = FT(0.8) +z_0m = FT(1e-2) +z_0b = FT(1e-3) +albedo = ClimaLand.Bucket.PrescribedBaregroundAlbedo{FT}( + α_snow, + α_bareground_func, + bucket_domain.space.surface, +) +bucket_parameters = + ClimaLand.Bucket.BucketModelParameters(FT; albedo, z_0m, z_0b, τc) + +model = ClimaLand.Bucket.BucketModel( + parameters = bucket_parameters, + domain = bucket_domain, + atmosphere = bucket_atmos, + radiation = bucket_rad, +) + +Y, p, coords = ClimaLand.initialize(model) +Y.bucket.T .= 280.0 +Y.bucket.W .= 0.5 # no moisture +Y.bucket.Ws .= 0.5 # no runoff +Y.bucket.σS .= 0.0 -# Just to trigger the error -out = Y = p = t = land_model = nothing +exp_tendency! = ClimaLand.make_exp_tendency(model) +set_initial_cache! = ClimaLand.make_set_initial_cache(model) +set_initial_cache!(p, Y, t0) -@test_throws ErrorException("Cannot compute albedo with model = Nothing") ClimaLand.Diagnostics.compute_albedo!( - out, +prob = SciMLBase.ODEProblem( + ClimaTimeSteppers.ClimaODEFunction((T_exp!) = exp_tendency!), Y, + (t0, tf), p, - t, - land_model, ) -@test_throws ErrorException ClimaLand.Diagnostics.get_diagnostic_variable("Foo") +# ClimaDiagnostics + +ClimaLand.Diagnostics.define_diagnostics!(model) +diags = ["rn", "lhf"] + +tmpdir = mktempdir(".") +nc_writer = + ClimaDiagnostics.Writers.NetCDFWriter(bucket_domain.space.surface, tmpdir) + +out = ClimaLand.Diagnostics.hourly_averages( + FT, + diags...; + output_writer = nc_writer, + reference_date = DateTime(2005), +) + +diagnostic_handler = ClimaDiagnostics.DiagnosticsHandler(out, Y, p, t0; dt = Δt) + +diag_cb = ClimaDiagnostics.DiagnosticsCallback(diagnostic_handler) + +updateat = collect(t0:Δt:tf); +drivers = ClimaLand.get_drivers(model) +updatefunc = ClimaLand.make_update_drivers(drivers) +driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc) +cb = SciMLBase.CallbackSet(driver_cb, diag_cb) +timestepper = ClimaTimeSteppers.RK4() +ode_algo = ClimaTimeSteppers.ExplicitAlgorithm(timestepper) +SciMLBase.solve(prob, ode_algo; dt = Δt, callback = cb) + +using ClimaAnalysis +simdir = ClimaAnalysis.SimDir(tmpdir) +rn = get(simdir; short_name = "rn") +@test readdir(tmpdir) == ["lhf_1h_average.nc", "rn_1h_average.nc"] +@test length(rn.dims) == 3 +@test mean(rn.data) != 0.0 diff --git a/test/runtests.jl b/test/runtests.jl index 46f331e71c..ffa3412de1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -111,3 +111,8 @@ end @safetestset "Integrated soil and snow" begin include("integrated/soil_snow.jl") end + +# Diagnostics +@safetestset "Diagnostics" begin + include("diagnostics/diagnostics_tests.jl") +end