From a2af77aac78f74ab1ecbe8aae77045b87b7bc428 Mon Sep 17 00:00:00 2001 From: Nick Wogan Date: Mon, 8 Apr 2024 13:34:38 -0700 Subject: [PATCH] fypp depndency and memtest for autodiff --- pyproject.toml | 2 +- tests/memtest.f90 | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0cd05c9..a9c09fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools>=42", "wheel", "scikit-build", "cmake>=3.12", "ninja", "numpy", "cython"] +requires = ["setuptools>=42", "wheel", "scikit-build", "cmake>=3.12", "ninja", "numpy", "cython","fypp"] diff --git a/tests/memtest.f90 b/tests/memtest.f90 index 2a870d5..046d856 100644 --- a/tests/memtest.f90 +++ b/tests/memtest.f90 @@ -20,6 +20,7 @@ program memtest call test_custom_binary_diffusion(pcs) call test_update_vertical_grid(pcs) call test_press_temp_edd(pcs) + call test_autodiff(pcs) contains @@ -308,5 +309,34 @@ subroutine test_press_temp_edd(pc) endif end subroutine + + subroutine test_autodiff(pc) + type(Atmosphere), intent(inout) :: pc + + character(:), allocatable :: err + real(dp) :: tn + + pc%var%autodiff = .true. + pc%var%atol = 1.0e-20_dp + + call pc%initialize_stepper(pc%var%usol_init, err) + if (allocated(err)) then + print*,trim(err) + stop 1 + endif + + tn = pc%step(err) + if (allocated(err)) then + print*,trim(err) + stop 1 + endif + + call pc%destroy_stepper(err) + if (allocated(err)) then + print*,trim(err) + stop 1 + endif + + end subroutine end program \ No newline at end of file