diff --git a/pfunit/GNUmakefile b/pfunit/GNUmakefile deleted file mode 100644 index a0cb6118802077b9ee9838ee333bbf3cdba5bee9..0000000000000000000000000000000000000000 --- a/pfunit/GNUmakefile +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2013-2024 MPI-M, Luis Kornblueh, Rahul Sinha and DWD, Florian Prill. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -.PHONY: clean tests all - -# Individual stuff (Christian) -F90=gfortran -PFUNIT=/informatik/home/zoller/scratch/lib/pfunit-serial -LIB_DIR=/informatik/home/zoller/scratch/lib - -TOP_DIR := $(shell pwd) -TEST_DIR=$(TOP_DIR)/tests -SRC_DIR=$(TOP_DIR)/../src -INCL_DIR=$(TOP_DIR)/../include - -VPATH = . $(SRC_DIR) $(TEST_DIR) - -# Decide the file extensions. -include $(PFUNIT)/include/extensions.mk - -EXE = tests - -PFUNIT_LIBS = -L$(PFUNIT)/lib -lpfunit -PFUNIT_INCL = -I$(PFUNIT)/mod -I$(PFUNIT)/include -PFUNIT_DRV = $(PFUNIT)/include/driver.F90 - -SRC_OBJS = $(SRC_DIR)/*$(OBJ_EXT) -TEST_INCL = -I$(TEST_DIR) -TEST_OBJS = $(TEST_DIR)/*$(OBJ_EXT) - -FFLAGS += -I$(INCL_DIR) $(PFUNIT_INCL) $(TEST_INCL) $(PFUNIT_LIBS) - -all: clean $(EXE) # Kein Plan, weshalb das clean nötig ist - ./$(EXE) - -$(EXE): testSuites.inc from_example_test.pf tests - $(F90) -o $@ $(PFUNIT_DRV) $(TEST_OBJS) $(SRC_OBJS) $(FFLAGS) - -clean: - make -C $(TEST_DIR) clean - rm -f $(EXE) *$(OBJ_EXT) - -tests: - make -C $(TEST_DIR) tests - -export SRC_DIR -export F90 -export FFLAGS -export PFUNIT - -#PFUNITROOT =/informatik/home/zoller/scratch/lib/pfunit-serial -#PFUNIT_INCLUDE = -I$(PFUNITROOT)/mod -I$(PFUNITROOT)/include -#PFUNIT_LIB = -L$(PFUNIT)/lib -lpfunit -# -#VPATH = ../src tests -# -#SRC_DIR = ../src -# -#INCLUDE = -I../include -#LIBS = $(PFUNIT_LIB) -# -#F90 = gfortran -#FFLAGS = $(INCLUDE) -Wall -# -#%.f90: %.pf -# $(CHECKROOT)/bin/checkmk $< > $@ -# -#all: example_test -# ./example_test -# -#example_test: example_test.o -# $(CC) $(CFLAGS) -o $@ $< $(SRC_DIR)/mtime_*.o $(LIBS) -# -#example_test.o: example_test.c -# -#example_test.c: example_test.check -# -# -#clean: -# rm -f example_test *.o *.c diff --git a/pfunit/README b/pfunit/README deleted file mode 100644 index 974a88ca8dd2132828763189f78dcd2eeecd8127..0000000000000000000000000000000000000000 --- a/pfunit/README +++ /dev/null @@ -1,8 +0,0 @@ -Unit Tests for mtime with pFUnit -================================ - -pFUnit: http://pfunit.sourceforge.net/ - -For installation see http://pfunit.sourceforge.net/page_Installation.html - -Works only with gfortran 4.8.1 and above. Only pFUnit version 2.1.0 branch worked for me. diff --git a/pfunit/tests/GNUmakefile b/pfunit/tests/GNUmakefile deleted file mode 100644 index fb0f108858e7bcf61c5df92063397411b8f3144d..0000000000000000000000000000000000000000 --- a/pfunit/tests/GNUmakefile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2013-2024 MPI-M, Luis Kornblueh, Rahul Sinha and DWD, Florian Prill. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -.PHONY: clean tests - -SRCS = $(wildcard *.pf) -OBJS = $(SRCS:.pf=$(OBJ_EXT)) - -tests: $(OBJS) - -testSuites.inc: $(SRCS) - -FFLAGS += -I$(SRC_DIR) -I$(PFUNIT)/mod - -%.F90: %.pf - $(PFUNIT)/bin/pFUnitParser.py $< $@ - -%$(OBJ_EXT): %.F90 - $(F90) -c $(FFLAGS) $< - -clean: - $(RM) *.o *.mod diff --git a/pfunit/tests/from_example_test.pf b/pfunit/tests/from_example_test.pf deleted file mode 100644 index 42c5f25a0e8c4ac99a2f8c311c45488da988bf71..0000000000000000000000000000000000000000 --- a/pfunit/tests/from_example_test.pf +++ /dev/null @@ -1,140 +0,0 @@ -!! Copyright (c) 2013-2024 MPI-M, Luis Kornblueh, Rahul Sinha and DWD, Florian Prill. All rights reserved. -!! -!! SPDX-License-Identifier: BSD-3-Clause -!! - -MODULE from_example_test - -USE pFUnit_mod -USE mtime - -IMPLICIT NONE - -CONTAINS - -@before -SUBROUTINE setup() - - call setCalendar(year_of_365_days) ! proleptic_gregorian/year_of_365_days/year_of_360_days. - -END SUBROUTINE setup - -@test() -SUBROUTINE test_calendar_setup() - - character(len=max_calendar_str_len) :: calendar_in_use - - call calendarToString(calendar_in_use) - @assertEqual('Year of 365 days', TRIM(calendar_in_use)) - @assertEqual(2, calendarType()) - -END SUBROUTINE test_calendar_setup - -@test() -SUBROUTINE test_date_interface() - - type(date), pointer :: test_date - character(len=max_date_str_len) :: test_date_string - - test_date => newdate(2020,01,30) - @assertTrue(associated(test_date)) - - call dateToString(test_date, test_date_string) - @assertEqual('2020-01-30', TRIM(test_date_string)) - - call deallocateDate(test_date) - @assertFalse(associated(test_date)) - -END SUBROUTINE test_date_interface - - - -@test() -SUBROUTINE test_datetime_and_timeddelta_interface() - - type(datetime), pointer :: start_date - type(datetime), pointer :: start_date_tmp - type(datetime), pointer :: start_date_test - type(datetime), pointer :: stop_date - - type(timedelta), pointer :: time_step - - type(datetime), pointer :: current_date - - character(len=max_date_str_len) :: start_date_string - character(len=max_date_str_len) :: stop_date_string - character(len=max_date_str_len) :: time_step_string - character(len=max_date_str_len) :: current_date_string - character(len=32) :: fmtstr = '%x' - - integer :: step_count - - - start_date_tmp => newDatetime('2012-09-01T02:10:00.000') - start_date => newDatetime(start_date_tmp) - @assertTrue(associated(start_date)) - call datetimetoString(start_date, start_date_string) - @assertEqual('2012-09-01T02:10:00.000Z', TRIM(start_date_string)) - - start_date_tmp => newDatetime(2012,09,01,02,10,0,0) - start_date => newDatetime(start_date_tmp) - @assertTrue(associated(start_date)) - call datetimetoString(start_date, start_date_string) - @assertEqual('2012-09-01T02:10:00.000Z', TRIM(start_date_string)) - - - stop_date => newDateTime("2012-09-10T14:00:00.000"); - call datetimeToPosixString(stop_date, stop_date_string, fmtstr) - @assertEqual('09/10/12', TRIM(stop_date_string)) - - - time_step => newTimedelta('PT12H') - call timedeltaToString(time_step, time_step_string) - @assertEqual('PT12H', TRIM(time_step_string)) - - - ! copy operator - overload newDatetime using construct and copy! - current_date => newDatetime('2012-09-01T02:10:00.000') - call datetimeToString(current_date, current_date_string) - @assertEqual('2012-09-01T02:10:00.000Z', TRIM(current_date_string)) - - current_date = start_date - call datetimeToString(current_date, current_date_string) - @assertEqual('2012-09-01T02:10:00.000Z', TRIM(current_date_string)) - - - step_count = 0 - time_integration: do - current_date = current_date + time_step - step_count = step_count + 1 - call datetimeToString(current_date, current_date_string) - @assertTrue(step_count /= 1 .OR. TRIM(current_date_string) == '2012-09-01T14:10:00.000Z') - @assertTrue(step_count /= 2 .OR. TRIM(current_date_string) == '2012-09-02T02:10:00.000Z') - @assertTrue(step_count /= 5 .OR. TRIM(current_date_string) == '2012-09-03T14:10:00.000Z') - @assertTrue(step_count /= 18 .OR. TRIM(current_date_string) == '2012-09-10T02:10:00.000Z') - if (current_date >= stop_date) exit time_integration - enddo time_integration - @assertEqual(19, step_count) - @assertEqual('2012-09-10T14:10:00.000Z', current_date_string) - - - call deallocateDatetime(start_date) - call deallocateDatetime(stop_date) - call deallocateDatetime(current_date) - call deallocateTimeDelta(time_step) - - @assertFalse(associated(start_date)) - @assertFalse(associated(stop_date)) - @assertFalse(associated(current_date)) - @assertFalse(associated(time_step)) - -END SUBROUTINE test_datetime_and_timeddelta_interface - -@after -SUBROUTINE teardown() - - call resetCalendar() - -END SUBROUTINE teardown - -END MODULE from_example_test diff --git a/pfunit/tests/testSuites.inc b/pfunit/tests/testSuites.inc deleted file mode 100644 index 21960199c3a31a8341b233809e39a40fa8bd3e24..0000000000000000000000000000000000000000 --- a/pfunit/tests/testSuites.inc +++ /dev/null @@ -1,5 +0,0 @@ -!! Copyright (c) 2013-2024 MPI-M, Luis Kornblueh, Rahul Sinha and DWD, Florian Prill. All rights reserved. -!! -!! SPDX-License-Identifier: BSD-3-Clause -!! -ADD_TEST_SUITE(from_example_test_suite)