source: palm/trunk/UTIL/inifor/tests/test-input-files.f90 @ 3182

Last change on this file since 3182 was 3182, checked in by suehring, 3 years ago

New Inifor features: grid stretching, improved command-interface, support start dates in different formats in both YYYYMMDD and YYYYMMDDHH, Ability to manually control input file prefixes (--radiation-prefix, --soil-preifx, --flow-prefix, --soilmoisture-prefix) for compatiblity with DWD forcast naming scheme; GNU-style short and long option; Prepared output of large-scale forcing profiles (no computation yet); Added preprocessor flag netcdf4 to switch output format between netCDF 3 and 4; Updated netCDF variable names and attributes to comply with PIDS v1.9; Inifor bugfixes: Improved compatibility with older Intel Intel compilers by avoiding implicit array allocation; Added origin_lon/_lat values and correct reference time in dynamic driver global attributes; corresponding PALM changes: adjustments to revised Inifor; variables names in dynamic driver adjusted; enable geostrophic forcing also in offline nested mode; variable names in LES-LES and COSMO offline nesting changed; lateral boundary flags for nesting, in- and outflow conditions renamed

  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1!> @file tests/test-input-files.f90
2!------------------------------------------------------------------------------!
3! This file is part of the PALM model system.
4!
5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 2017-2018 Leibniz Universitaet Hannover
18! Copyright 2017-2018 Deutscher Wetterdienst Offenbach
19!------------------------------------------------------------------------------!
20!
21! Current revisions:
22! -----------------
23! New test for negative start_hour and greater-than-one step_hour
24!
25!
26! Former revisions:
27! -----------------
28! $Id: test-input-files.f90 3182 2018-07-27 13:36:03Z suehring $
29! Initial revision
30!
31!
32!
33! Authors:
34! --------
35! @author Eckhard Kadasch
36!
37! Description:
38! ------------
39!> This program tests INIFOR's timestamping used for generating input file
40!> names.
41!------------------------------------------------------------------------------!
42 PROGRAM test_input_files
43
44    USE defs,                                                                  &
45        ONLY :  PATH
46    USE grid,                                                                  & 
47        ONLY :  get_input_file_list
48    USE test_utils
49   
50    IMPLICIT NONE
51
52    CHARACTER(LEN=60)                              ::  title
53    CHARACTER(LEN=PATH), ALLOCATABLE, DIMENSION(:) ::  file_list, ref_list
54    LOGICAL                                        ::  res
55    INTEGER                                        ::  i
56
57    title = "input files - daylight saving to standard time"
58    CALL begin_test(title, res)
59
60    ! Arange
61    ! ...a date range that inlcudes a shift from daylight saving time to
62    ! standard time (29.10.2017). Since all time stamps in COSMO-DE input files
63    ! are in UTC, this should not the naming cadence.
64    ALLOCATE( ref_list(6) )
65    ref_list(1)  = './laf2017102823-test.nc'
66    ref_list(2)  = './laf2017102900-test.nc'
67    ref_list(3)  = './laf2017102901-test.nc'
68    ref_list(4)  = './laf2017102902-test.nc'
69    ref_list(5)  = './laf2017102903-test.nc'
70    ref_list(6)  = './laf2017102904-test.nc'
71
72    ! Act
73    CALL get_input_file_list(start_date_string='2017102823',                   &
74                             start_hour=0, end_hour=5, step_hour=1,            &
75                             path='./', prefix="laf", suffix='-test',          &
76                             file_list=file_list)
77
78    ! Assert
79    DO i = 1, 6
80       res = res .AND. (TRIM(ref_list(i)) .EQ. TRIM(file_list(i)))
81    END DO
82
83    DEALLOCATE( ref_list, file_list )
84    CALL end_test(title, res)
85
86
87    title = "input files - leap day"
88    CALL begin_test(title, res)
89
90    ! Arange
91    ! ...a date range that inlcudes a leap day (29. Feb. 2016) which should be
92    ! inlcuded in UTC time stamps.
93    ALLOCATE( ref_list(2) )
94    ref_list(1)  = './laf2016022823-test.nc'
95    ref_list(2)  = './laf2016022900-test.nc'
96
97    ! Act
98    CALL get_input_file_list(start_date_string='2016022823',                   &
99                             start_hour=0, end_hour=1, step_hour=1,            &
100                             path='./', prefix="laf", suffix='-test',          &
101                             file_list=file_list)
102
103    ! Assert
104    DO i = 1, 2
105       res = res .AND. (TRIM(ref_list(i)) .EQ. TRIM(file_list(i)))
106    END DO
107
108    DEALLOCATE( ref_list, file_list )
109    CALL end_test(title, res)
110
111
112
113    title = "input files - negative start_hour and step_hour > 1 hour"
114    CALL begin_test(title, res)
115
116    ! Arange
117    ! ...a date range that inlcudes a leap day (29. Feb. 2016) which should be
118    ! inlcuded in UTC time stamps.
119    ALLOCATE( ref_list(4) )
120    ref_list(1)  = './laf2017102823-test.nc'
121    ref_list(2)  = './laf2017102901-test.nc'
122    ref_list(3)  = './laf2017102903-test.nc'
123    ref_list(4)  = './laf2017102904-test.nc'
124
125    ! Act
126    CALL get_input_file_list(start_date_string='2017102901',                   &
127                             start_hour=-2, end_hour=3, step_hour=2,           &
128                             path='./', prefix="laf", suffix='-test',          &
129                             file_list=file_list)
130
131    PRINT *, file_list
132
133    ! Assert
134    DO i = 1, 2
135       res = res .AND. (TRIM(ref_list(i)) .EQ. TRIM(file_list(i)))
136    END DO
137
138    DEALLOCATE( ref_list, file_list )
139    CALL end_test(title, res)
140
141 END PROGRAM test_input_files
Note: See TracBrowser for help on using the repository browser.