Skip to content
Tammas Loughran edited this page Apr 15, 2015 · 7 revisions

Tests

This is a place for testers to put the results of their tests.

Test #4

Name: Sensible_bounds_temp

Current Status: Fail

Type: SyC

Description: Check error message appears if temperature is greater than 100decC or less than -100degC and is not missing but calculation continues.

Indices tested: fd, fd2, fdm2, fdm20, id, su, tr, gsl, txx, tnn, tnx, txn, dtr, wsdi, wsdin, csdi, csdin, tx50p, tx95t, tx10p, tx90p, tn10p, tn90p, tm5a, tm5b, tm10a, tm10b, su30, su35, hdheat, cddcold, gddgrow ntxntn, ntxbntnb, hw.

Input data: AWAP tmax and tmin 1950-2000 at 0.5deg resolution. Values greater than 100degC were added to tmax and values less than -100degC were added to tmin. The regions with insane data do not perfectly align. There are no values of tmax <-100 and no values of tmin >100. See python script:

from netCDF4 import Dataset

# AWAP_plus100.nc and AWAP_minus120.nc are initially just AWAP temp data 1950-2000.
tmaxnc = Dataset('/srv/ccrc/data35/z5032520/AWAP/daily/tmax/AWAP_plus100.nc', 'a')
lat = tmaxnc.variables['lat'][:]
lon = tmaxnc.variables['lon'][:]
latdex = (lat<=-24.)&(lat>=-32.)
lat1 = latdex.nonzero()[0][0]
lat2 = latdex.nonzero()[0][-1]+1
londex = (lon>=140.)&(lon<=150.)
lon1 = londex.nonzero()[0][0]
lon2 = londex.nonzero()[0][-1]+1
tmaxnc.variables['tmax'][:,lat1:lat2,lon1:lon2] += 100
tmaxnc.close()

tminnc = Dataset('/srv/ccrc/data35/z5032520/AWAP/daily/tmin/AWAP_minus120.nc', 'a')
londex = (lon>=137.)&(lon<=147.)
lon1 = londex.nonzero()[0][0]
lon2 = londex.nonzero()[0][-1]+1
tminnc.variables['tmin'][:,lat1:lat2,lon1:lon2] -= 120
tminnc.close()

Issues:

Issue #5 No error message were returned for most indices despite values <-100degC and >100degC. Calculation continued without any missing values.

Issue #6 hdheat, cddcold, gddgrow returned errors.

Test #7

Name: Correct_units

Current status: Fail

Description: Tests units are appropriate for the variables specified, possibly do conversions if are of incorrect but common type

Type: SyC

Indices tested: all

Output:

/srv/ccrc/data01/shared/climpact2/test7/

#!/bin/bash
# Get units data from netcdf files.
for FILE in `ls *.nc`
do
    ncdump -h $FILE | grep units >> data.txt
done
declare -a index=("fd" "fd2" "fdm2" "fdm20" "id" "su" "tr" "gsl" "txx" "tnn" "tnx" "txn" "dtr" "wsdi" "wsdin" "csdi" "csdin" "tx50p" "tx95t" "tx10p" "tx90p" "tn10p" "tn90p" "tm5a" "tm5b" "tm10a" "tm10b" "su30" "su35" "hddheat" "cddcold" "gddgrow" "ntxntn" "ntxbntnb" "hw" "r20mm" "cdd" "cwd" "r10mm" "r20mm" "rx1day" "rx5day" "prcptot" "sdii" "r95ptot" "r99ptot" "rxnday" "rnnmm" "HWM" "HWA" "HWN" "HWD" "HWF")
for i in "${index[@]}"
do
    more data.txt | grep $i:units >> units.txt
done
rm data.txt
diff compare_units.txt units.txt
rm units.txt

Isues: Issue #8 Incorrect units

Clone this wiki locally