diff --git a/.gitignore b/.gitignore index 244eae3..e373eec 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,4 @@ run_*/ *.mp4 # no nohup outputs -nohup.out +nohup.out \ No newline at end of file diff --git a/Manifest.toml b/Manifest.toml deleted file mode 100644 index e2f0fd1..0000000 --- a/Manifest.toml +++ /dev/null @@ -1,485 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.10.0" -manifest_format = "2.0" -project_hash = "8048eda655f99daf92d3e47aef48fc948a5ab92f" - -[[deps.Adapt]] -deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "cde29ddf7e5726c9fb511f340244ea3481267608" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.7.2" -weakdeps = ["StaticArrays"] - - [deps.Adapt.extensions] - AdaptStaticArraysExt = "StaticArrays" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.AxisAlgorithms]] -deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"] -git-tree-sha1 = "66771c8d21c8ff5e3a93379480a2307ac36863f7" -uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950" -version = "1.0.1" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.Blosc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "19b98ee7e3db3b4eff74c5c9c72bf32144e24f10" -uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" -version = "1.21.5+0" - -[[deps.Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+1" - -[[deps.ChainRulesCore]] -deps = ["Compat", "LinearAlgebra"] -git-tree-sha1 = "575cd02e080939a33b6df6c5853d14924c08e35b" -uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.23.0" -weakdeps = ["SparseArrays"] - - [deps.ChainRulesCore.extensions] - ChainRulesCoreSparseArraysExt = "SparseArrays" - -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "c955881e3c981181362ae4088b35995446298b80" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.14.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.5+1" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.DiskArrays]] -deps = ["LRUCache", "OffsetArrays"] -git-tree-sha1 = "ef25c513cad08d7ebbed158c91768ae32f308336" -uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" -version = "0.3.23" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.GMP_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" -version = "6.2.1+6" - -[[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.HDF5_jll]] -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.14.2+1" - -[[deps.Hwloc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "ca0f6bf568b4bfc807e7537f081c81e35ceca114" -uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.10.0+0" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.Interpolations]] -deps = ["Adapt", "AxisAlgorithms", "ChainRulesCore", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "Requires", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] -git-tree-sha1 = "721ec2cf720536ad005cb38f50dbba7b02419a15" -uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" -version = "0.14.7" - -[[deps.JLLWrappers]] -deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" - -[[deps.LLVMOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" -uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" -version = "15.0.7+0" - -[[deps.LRUCache]] -git-tree-sha1 = "b3cc6698599b10e652832c2f23db3cab99d51b59" -uuid = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637" -version = "1.6.1" -weakdeps = ["Serialization"] - - [deps.LRUCache.extensions] - SerializationExt = ["Serialization"] - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.4" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.4.0+0" - -[[deps.LibGit2]] -deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibGit2_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] -uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" -version = "1.6.4+0" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.11.0+1" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" -uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.17.0+0" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.Lz4_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" -uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" -version = "1.9.4+0" - -[[deps.MPICH_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "656036b9ed6f942d35e536e249600bc31d0f9df8" -uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4" -version = "4.2.0+0" - -[[deps.MPIPreferences]] -deps = ["Libdl", "Preferences"] -git-tree-sha1 = "8f6af051b9e8ec597fa09d8885ed79fd582f33c9" -uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" -version = "0.1.10" - -[[deps.MPItrampoline_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "77c3bd69fdb024d75af38713e883d0f249ce19c2" -uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" -version = "5.3.2+0" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+1" - -[[deps.MicrosoftMPI_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f12a29c4400ba812841c6ace3f4efbb6dbb3ba01" -uuid = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" -version = "10.1.4+2" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2023.1.10" - -[[deps.NetCDF]] -deps = ["DiskArrays", "NetCDF_jll"] -git-tree-sha1 = "c8ec10c6b72e35f7020b83330f8054908ba454eb" -uuid = "30363a11-5582-574a-97bb-aa9a979735b9" -version = "0.11.8" - -[[deps.NetCDF_jll]] -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.209+0" - -[[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" - -[[deps.OffsetArrays]] -git-tree-sha1 = "6a731f2b5c03157418a20c12195eb4b74c8f8621" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.13.0" -weakdeps = ["Adapt"] - - [deps.OffsetArrays.extensions] - OffsetArraysAdaptExt = "Adapt" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+2" - -[[deps.OpenMPI_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "PMIx_jll", "TOML", "Zlib_jll", "libevent_jll", "prrte_jll"] -git-tree-sha1 = "f46caf663e069027a06942d00dced37f1eb3d8ad" -uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" -version = "5.0.2+0" - -[[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3da7367955dcc5c54c1ba4d402ccdc09a1a3e046" -uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "3.0.13+1" - -[[deps.OrderedCollections]] -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.PMIx_jll]] -deps = ["Artifacts", "Hwloc_jll", "JLLWrappers", "Libdl", "Zlib_jll", "libevent_jll"] -git-tree-sha1 = "360f48126b5f2c2f0c833be960097f7c62705976" -uuid = "32165bc3-0280-59bc-8c0b-c33b6203efab" -version = "4.2.9+0" - -[[deps.Parameters]] -deps = ["OrderedCollections", "UnPack"] -git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" -uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" -version = "0.12.3" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.10.0" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.2.1" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.3" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.Ratios]] -deps = ["Requires"] -git-tree-sha1 = "1342a47bf3260ee108163042310d26f2be5ec90b" -uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439" -version = "0.4.5" - - [deps.Ratios.extensions] - RatiosFixedPointNumbersExt = "FixedPointNumbers" - - [deps.Ratios.weakdeps] - FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "bf074c045d3d5ffd956fa0a461da38a44685d6b2" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.3" - - [deps.StaticArrays.extensions] - StaticArraysChainRulesCoreExt = "ChainRulesCore" - StaticArraysStatisticsExt = "Statistics" - - [deps.StaticArrays.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[deps.StaticArraysCore]] -git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" -uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.2" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.0" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.WoodburyMatrices]] -deps = ["LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "5f24e158cf4cee437052371455fe361f526da062" -uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" -version = "0.5.6" - -[[deps.XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "532e22cf7be8462035d092ff21fada7527e2c488" -uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.12.6+0" - -[[deps.XZ_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "ac88fb95ae6447c8dda6a5503f3bafd496ae8632" -uuid = "ffd25f8a-64ca-5728-b0f7-c24cf3aae800" -version = "5.4.6+0" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+1" - -[[deps.Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" -uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.6+0" - -[[deps.libaec_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "46bf7be2917b59b761247be3f317ddf75e50e997" -uuid = "477f73a3-ac25-53e9-8cc3-50b2fa2566f0" -version = "1.1.2+0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+1" - -[[deps.libevent_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll"] -git-tree-sha1 = "f04ec6d9a186115fb38f858f05c0c4e1b7fc9dcb" -uuid = "1080aeaf-3a6a-583e-a51c-c537b09f60ec" -version = "2.1.13+1" - -[[deps.libzip_jll]] -deps = ["Artifacts", "Bzip2_jll", "GnuTLS_jll", "JLLWrappers", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "3282b7d16ae7ac3e57ec2f3fa8fafb564d8f9f7f" -uuid = "337d8026-41b4-5cde-a456-74a10e5b31d1" -version = "1.10.1+0" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.52.0+1" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+2" - -[[deps.prrte_jll]] -deps = ["Artifacts", "Hwloc_jll", "JLLWrappers", "Libdl", "PMIx_jll", "libevent_jll"] -git-tree-sha1 = "5adb2d7a18a30280feb66cad6f1a1dfdca2dc7b0" -uuid = "eb928a42-fffd-568d-ab9c-3f5d54fc65b9" -version = "3.0.2+0" diff --git a/src/chkpt_time_integration.jl b/src/chkpt_time_integration.jl deleted file mode 100644 index 33ce11b..0000000 --- a/src/chkpt_time_integration.jl +++ /dev/null @@ -1,350 +0,0 @@ -"""Integrate ShallowWaters forward AND checkpoints the integration. This is the -integration function needed if we want to use Enzyme on the model.""" -function checkpointed_integration(S, scheme) - - # setup - Diag = S.Diag - Prog = S.Prog - - @unpack u,v,η,sst = Prog - @unpack u0,v0,η0 = Diag.RungeKutta - @unpack u1,v1,η1 = Diag.RungeKutta - @unpack du,dv,dη = Diag.Tendencies - @unpack du_sum,dv_sum,dη_sum = Diag.Tendencies - @unpack du_comp,dv_comp,dη_comp = Diag.Tendencies - - @unpack um,vm = Diag.SemiLagrange - - @unpack dynamics,RKo,RKs,tracer_advection = S.parameters - @unpack time_scheme,compensated = S.parameters - @unpack RKaΔt,RKbΔt = S.constants - @unpack Δt_Δ,Δt_Δs = S.constants - - @unpack nt,dtint = S.grid - @unpack nstep_advcor,nstep_diff,nadvstep,nadvstep_half = S.grid - - # calculate layer thicknesses for initial conditions - ShallowWaters.thickness!(Diag.VolumeFluxes.h,η,S.forcing.H) - ShallowWaters.Ix!(Diag.VolumeFluxes.h_u,Diag.VolumeFluxes.h) - ShallowWaters.Iy!(Diag.VolumeFluxes.h_v,Diag.VolumeFluxes.h) - ShallowWaters.Ixy!(Diag.Vorticity.h_q,Diag.VolumeFluxes.h) - - # calculate PV terms for initial conditions - urhs = convert(Diag.PrognosticVarsRHS.u,u) - vrhs = convert(Diag.PrognosticVarsRHS.v,v) - ηrhs = convert(Diag.PrognosticVarsRHS.η,η) - - ShallowWaters.advection_coriolis!(urhs,vrhs,ηrhs,Diag,S) - ShallowWaters.PVadvection!(Diag,S) - - # propagate initial conditions - copyto!(u0,u) - copyto!(v0,v) - copyto!(η0,η) - - # store initial conditions of sst for relaxation - copyto!(Diag.SemiLagrange.sst_ref,sst) - - t = 0 # model time - # run integration loop with checkpointing - loop(S, scheme) - - # end - - # separately defined J - return S.parameters.J - - # final state cost function - # return S.Prog.η[24,24] - - # spatially averaged energy cost function - # temp = ShallowWaters.PrognosticVars{Float32}(ShallowWaters.remove_halo(u,v,η,sst,S)...) - # S.parameters.J = (sum(temp.u.^2) + sum(temp.v.^2)) / (S.grid.nx * S.grid.ny) - # return S.parameters.J - -end - -function loop(S,scheme) - - @checkpoint_struct scheme S for S.parameters.i = 1:S.grid.nt - - Diag = S.Diag - Prog = S.Prog - - @unpack u,v,η,sst = Prog - @unpack u0,v0,η0 = Diag.RungeKutta - @unpack u1,v1,η1 = Diag.RungeKutta - @unpack du,dv,dη = Diag.Tendencies - @unpack du_sum,dv_sum,dη_sum = Diag.Tendencies - @unpack du_comp,dv_comp,dη_comp = Diag.Tendencies - - @unpack um,vm = Diag.SemiLagrange - - @unpack dynamics,RKo,RKs,tracer_advection = S.parameters - @unpack time_scheme,compensated = S.parameters - @unpack RKaΔt,RKbΔt = S.constants - @unpack Δt_Δ,Δt_Δs = S.constants - - @unpack nt,dtint = S.grid - @unpack nstep_advcor,nstep_diff,nadvstep,nadvstep_half = S.grid - t = S.t - i = S.parameters.i - - # ghost point copy for boundary conditions - ShallowWaters.ghost_points!(u,v,η,S) - copyto!(u1,u) - copyto!(v1,v) - copyto!(η1,η) - - if time_scheme == "RK" # classic RK4,3 or 2 - - if compensated - fill!(du_sum,zero(Tprog)) - fill!(dv_sum,zero(Tprog)) - fill!(dη_sum,zero(Tprog)) - end - - for rki = 1:RKo - if rki > 1 - ShallowWaters.ghost_points!(u1,v1,η1,S) - end - - # type conversion for mixed precision - u1rhs = convert(Diag.PrognosticVarsRHS.u,u1) - v1rhs = convert(Diag.PrognosticVarsRHS.v,v1) - η1rhs = convert(Diag.PrognosticVarsRHS.η,η1) - - ShallowWaters.rhs!(u1rhs,v1rhs,η1rhs,Diag,S,t) # momentum only - ShallowWaters.continuity!(u1rhs,v1rhs,η1rhs,Diag,S,t) # continuity equation - - if rki < RKo - ShallowWaters.caxb!(u1,u,RKbΔt[rki],du) #u1 .= u .+ RKb[rki]*Δt*du - ShallowWaters.caxb!(v1,v,RKbΔt[rki],dv) #v1 .= v .+ RKb[rki]*Δt*dv - ShallowWaters.caxb!(η1,η,RKbΔt[rki],dη) #η1 .= η .+ RKb[rki]*Δt*dη - end - - if compensated # accumulate tendencies - ShallowWaters.axb!(du_sum,RKaΔt[rki],du) - ShallowWaters.axb!(dv_sum,RKaΔt[rki],dv) - ShallowWaters.axb!(dη_sum,RKaΔt[rki],dη) - else # sum RK-substeps on the go - ShallowWaters.axb!(u0,RKaΔt[rki],du) #u0 .+= RKa[rki]*Δt*du - ShallowWaters.axb!(v0,RKaΔt[rki],dv) #v0 .+= RKa[rki]*Δt*dv - ShallowWaters.axb!(η0,RKaΔt[rki],dη) #η0 .+= RKa[rki]*Δt*dη - end - end - - if compensated - # add compensation term to total tendency - ShallowWaters.axb!(du_sum,-1,du_comp) - ShallowWaters.axb!(dv_sum,-1,dv_comp) - ShallowWaters.axb!(dη_sum,-1,dη_comp) - - ShallowWaters.axb!(u0,1,du_sum) # update prognostic variable with total tendency - ShallowWaters.axb!(v0,1,dv_sum) - ShallowWaters.axb!(η0,1,dη_sum) - - ShallowWaters.dambmc!(du_comp,u0,u,du_sum) # compute new compensation - ShallowWaters.dambmc!(dv_comp,v0,v,dv_sum) - ShallowWaters.dambmc!(dη_comp,η0,η,dη_sum) - end - - elseif time_scheme == "SSPRK2" # s-stage 2nd order SSPRK - - for rki = 1:RKs - if rki > 1 - ShallowWaters.ghost_points_η!(η1,S) - end - - # type conversion for mixed precision - u1rhs = convert(Diag.PrognosticVarsRHS.u,u1) - v1rhs = convert(Diag.PrognosticVarsRHS.v,v1) - η1rhs = convert(Diag.PrognosticVarsRHS.η,η1) - - ShallowWaters.rhs!(u1rhs,v1rhs,η1rhs,Diag,S,t) # momentum only - - # the update step - ShallowWaters.axb!(u1,Δt_Δs,du) # u1 = u1 + Δt/(s-1)*RHS(u1) - ShallowWaters.axb!(v1,Δt_Δs,dv) - - # semi-implicit for continuity equation, use new u1,v1 to calcualte dη - ShallowWaters.ghost_points_uv!(u1,v1,S) - u1rhs = convert(Diag.PrognosticVarsRHS.u,u1) - v1rhs = convert(Diag.PrognosticVarsRHS.v,v1) - ShallowWaters.continuity!(u1rhs,v1rhs,η1rhs,Diag,S,t) - ShallowWaters.axb!(η1,Δt_Δs,dη) # η1 = η1 + Δt/(s-1)*RHS(u1) - end - - a = 1/RKs - b = (RKs-1)/RKs - ShallowWaters.cxayb!(u0,a,u,b,u1) - ShallowWaters.cxayb!(v0,a,v,b,v1) - ShallowWaters.cxayb!(η0,a,η,b,η1) - - elseif time_scheme == "SSPRK3" # s-stage 3rd order SSPRK - - @unpack s,kn,mn,kna,knb,Δt_Δnc,Δt_Δn = S.constants.SSPRK3c - - # if compensated - # fill!(du_sum,zero(Tprog)) - # fill!(dv_sum,zero(Tprog)) - # fill!(dη_sum,zero(Tprog)) - # end - - for rki = 2:s+1 # number of stages (from 2:s+1 to match Ketcheson et al 2014) - if rki > 2 - ShallowWaters.ghost_points_η!(η1,S) - end - - # type conversion for mixed precision - u1rhs = convert(Diag.PrognosticVarsRHS.u,u1) - v1rhs = convert(Diag.PrognosticVarsRHS.v,v1) - η1rhs = convert(Diag.PrognosticVarsRHS.η,η1) - - rhs!(u1rhs,v1rhs,η1rhs,Diag,S,t) - - if rki == kn # special case combining more previous stages - ShallowWaters.dxaybzc!(u1,kna,u1,knb,u0,Δt_Δnc,du) - ShallowWaters.dxaybzc!(v1,kna,v1,knb,v0,Δt_Δnc,dv) - else # normal update case - ShallowWaters.axb!(u1,Δt_Δn,du) - ShallowWaters.axb!(v1,Δt_Δn,dv) - - # if compensated - # axb!(du_sum,Δt_Δn,du) - # axb!(dv_sum,Δt_Δn,dv) - # end - end - - # semi-implicit for continuity equation, use new u1,v1 to calcualte dη - ShallowWaters.ghost_points_uv!(u1,v1,S) - u1rhs = convert(Diag.PrognosticVarsRHS.u,u1) - v1rhs = convert(Diag.PrognosticVarsRHS.v,v1) - ShallowWaters.continuity!(u1rhs,v1rhs,η1rhs,Diag,S,t) - - if rki == kn - ShallowWaters.dxaybzc!(η1,kna,η1,knb,η0,Δt_Δnc,dη) - else - ShallowWaters.axb!(η1,Δt_Δn,dη) - # if compensated - # axb!(dη_sum,Δt_Δn,dη) - # end - end - - # special stage that is needed later for the kn-th stage, store in u0,v0,η0 therefore - # or for the last step, as u0,v0,η0 is used as the last step's result of any RK scheme. - if rki == mn || rki == s+1 - copyto!(u0,u1) - copyto!(v0,v1) - ShallowWaters.ghost_points_η!(η1,S) - copyto!(η0,η1) - end - end - - elseif time_scheme == "4SSPRK3" # 4-stage SSPRK3 - - for rki = 1:4 - if rki > 1 - ShallowWaters.ghost_points!(u1,v1,η1,S) - end - - # type conversion for mixed precision - u1rhs = convert(Diag.PrognosticVarsRHS.u,u1) - v1rhs = convert(Diag.PrognosticVarsRHS.v,v1) - η1rhs = convert(Diag.PrognosticVarsRHS.η,η1) - - ShallowWaters.rhs!(u1rhs,v1rhs,η1rhs,Diag,S,t) - - ShallowWaters.caxb!(u0,u1,Δt_Δ,du) # store Euler update into u0,v0 - ShallowWaters.caxb!(v0,v1,Δt_Δ,dv) - ShallowWaters.cxab!(u1,1/2,u1,u0) # average u0,u1 and store in u1 - ShallowWaters.cxab!(v1,1/2,v1,v0) # same - - # semi-implicit for continuity equation, use u1,v1 to calcualte dη - ShallowWaters.ghost_points_uv!(u1,v1,S) - u1rhs = convert(Diag.PrognosticVarsRHS.u,u1) - v1rhs = convert(Diag.PrognosticVarsRHS.v,v1) - ShallowWaters.continuity!(u1rhs,v1rhs,η1rhs,Diag,S,t) - - ShallowWaters.caxb!(η0,η1,Δt_Δ,dη) # store Euler update into η0 - ShallowWaters.cxab!(η1,1/2,η1,η0) # average η0,η1 and store in η1 - - if rki == 3 - ShallowWaters.cxayb!(u1,2/3,u,1/3,u1) - ShallowWaters.cxayb!(v1,2/3,v,1/3,v1) - ShallowWaters.cxayb!(η1,2/3,η,1/3,η1) - elseif rki == 4 - copyto!(u0,u1) - copyto!(v0,v1) - copyto!(η0,η1) - end - end - end - - ShallowWaters.ghost_points!(u0,v0,η0,S) - - # type conversion for mixed precision - u0rhs = convert(Diag.PrognosticVarsRHS.u,u0) - v0rhs = convert(Diag.PrognosticVarsRHS.v,v0) - η0rhs = convert(Diag.PrognosticVarsRHS.η,η0) - - # ADVECTION and CORIOLIS TERMS - # although included in the tendency of every RK substep, - # only update every nstep_advcor steps if nstep_advcor > 0 - if dynamics == "nonlinear" && nstep_advcor > 0 && (i % nstep_advcor) == 0 - ShallowWaters.UVfluxes!(u0rhs,v0rhs,η0rhs,Diag,S) - ShallowWaters.advection_coriolis!(u0rhs,v0rhs,η0rhs,Diag,S) - end - - # DIFFUSIVE TERMS - SEMI-IMPLICIT EULER - # use u0 = u^(n+1) to evaluate tendencies, add to u0 = u^n + rhs - # evaluate only every nstep_diff time steps - if (S.parameters.i % nstep_diff) == 0 - ShallowWaters.bottom_drag!(u0rhs,v0rhs,η0rhs,Diag,S) - ShallowWaters.diffusion!(u0rhs,v0rhs,Diag,S) - ShallowWaters.add_drag_diff_tendencies!(u0,v0,Diag,S) - ShallowWaters.ghost_points_uv!(u0,v0,S) - end - - t += dtint - - # TRACER ADVECTION - u0rhs = convert(Diag.PrognosticVarsRHS.u,u0) # copy back as add_drag_diff_tendencies changed u0,v0 - v0rhs = convert(Diag.PrognosticVarsRHS.v,v0) - ShallowWaters.tracer!(i,u0rhs,v0rhs,Prog,Diag,S) - - # feedback and output - # feedback.i = i - # feedback!(Prog,feedback,S) - # ShallowWaters.output_nc!(S.parameters.i,netCDFfiles,Prog,Diag,S) # uses u0,v0,η0 - - # if feedback.nans_detected - # break - # end - - #### cost function evaluation (if extra calculations needed) - - if S.parameters.i in S.parameters.data_steps - - temp = ShallowWaters.PrognosticVars{Float32}(ShallowWaters.remove_halo(u,v,η,sst,S)...) - energy_lr = (sum(temp.u.^2) + sum(temp.v.^2)) / (S.grid.nx * S.grid.ny) - - # spacially averaged energy objective function - S.parameters.J += (energy_lr - S.parameters.data[S.parameters.j])^2 - - S.parameters.j += 1 - - end - - ############################################################# - - # Copy back from substeps - copyto!(u,u0) - copyto!(v,v0) - copyto!(η,η0) - - end - - return nothing - -end diff --git a/src/ghost_points.jl b/src/ghost_points.jl index bc9aede..11c38ff 100644 --- a/src/ghost_points.jl +++ b/src/ghost_points.jl @@ -1,3 +1,37 @@ +""" Extends the matrices u,v,η,sst with a halo of ghost points for boundary conditions.""" +function add_halo( u::Array{T,2}, + v::Array{T,2}, + η::Array{T,2}, + sst::Array{T,2}, + S::ModelSetup) where {T<:AbstractFloat} + + @unpack nx,ny,nux,nuy,nvx,nvy = S.grid + @unpack halo,haloη,halosstx,halossty = S.grid + + # Add zeros to satisfy kinematic boundary conditions + u = cat(zeros(T,halo,nuy),u,zeros(T,halo,nuy),dims=1) + u = cat(zeros(T,nux+2*halo,halo),u,zeros(T,nux+2*halo,halo),dims=2) + + v = cat(zeros(T,halo,nvy),v,zeros(T,halo,nvy),dims=1) + v = cat(zeros(T,nvx+2*halo,halo),v,zeros(T,nvx+2*halo,halo),dims=2) + + η = cat(zeros(T,haloη,ny),η,zeros(T,haloη,ny),dims=1) + η = cat(zeros(T,nx+2*haloη,haloη),η,zeros(T,nx+2*haloη,haloη),dims=2) + + sst = cat(zeros(T,halosstx,ny),sst,zeros(T,halosstx,ny),dims=1) + sst = cat(zeros(T,nx+2*halosstx,halossty),sst,zeros(T,nx+2*halosstx,halossty),dims=2) + + # SCALING + @unpack scale,scale_sst = S.constants + u *= scale + v *= scale + sst *= scale_sst + + ghost_points!(u,v,η,S) + ghost_points_sst!(sst,S) + return u,v,η,sst +end + """ Extends the matrices u,v,η,sst with a halo of ghost points for boundary conditions.""" function add_halo( u::Array{T,2}, v::Array{T,2}, @@ -34,6 +68,25 @@ function add_halo( u::Array{T,2}, return u,v,η,sst end +"""Cut off the halo from the prognostic variables.""" +function remove_halo( u::Array{T,2}, + v::Array{T,2}, + η::Array{T,2}, + sst::Array{T,2}, + S::ModelSetup) where {T<:AbstractFloat} + + @unpack halo,haloη,halosstx,halossty = S.grid + @unpack scale_inv,scale_sst = S.constants + + # undo scaling as well + @views ucut = scale_inv*u[halo+1:end-halo,halo+1:end-halo] + @views vcut = scale_inv*v[halo+1:end-halo,halo+1:end-halo] + @views ηcut = η[haloη+1:end-haloη,haloη+1:end-haloη] + @views sstcut = sst[halosstx+1:end-halosstx,halossty+1:end-halossty]/scale_sst + + return ucut,vcut,ηcut,sstcut +end + """Cut off the halo from the prognostic variables.""" function remove_halo( u::Array{T,2}, v::Array{T,2},