#!/bin/csh set Manhattan = /Users/thoar/git/DART_Manhattan/models/lorenz_96 set Test = /Users/thoar/git/DART_development/models/lorenz_96 sed -e "s/obs_type_definitions/obs_kind_definitions/" \ $Test/work/obs_seq.out.inf_test >! $Manhattan/work/obs_seq.out.inf_test foreach REPO ( $Manhattan $Test ) echo "==============================================================================" echo "Testing inflation for $REPO" cd $REPO/work # Make sure we are starting from the same states ncgen -o filter_input.nc filter_input.cdl # Make sure we are starting from current code # Should make sure that the mkmf.template has same compiler settings, etc. if (! -e filter ) then ./quickbuild.csh endif # Test all possible combinarions of inflation - even impossible ones # Note ... obs_inflation (1) should gracefully die. # Note ... prior RTPS (4) should gracefully die. # Note ... inflation (6) does not exist, should gracefully die. foreach PRIOR ( 0 1 2 3 4 5 ) foreach POSTERIOR ( 0 1 2 3 4 5 6) set CASE = "inf_${PRIOR}_${POSTERIOR}" echo "------------------------------------------------------------------------------" echo "Testing inflation case $CASE" mkdir $CASE cd $CASE \rm -f input.nml filter_log.txt dart_log.* cp ../obs_seq.out.inf_test . cp ../filter_input.nc . echo "filter_input.nc" >! filter_input_list.txt echo "filter_output.nc" >! filter_output_list.txt sed -e "s/obs_sequence_in_name .*/obs_sequence_in_name = 'obs_seq.out.inf_test'/g" \ -e "s/inf_flavor .*/inf_flavor = ${PRIOR}, ${POSTERIOR}/" \ -e "s/inf_initial .*/inf_initial = 1.1, 1.2/" \ -e "s/inf_lower_bound .*/inf_lower_bound = 0.0, 0.0/" \ -e "s/inf_upper_bound .*/inf_upper_bound = 1000000.0, 1000000.0/" \ -e "s/inf_damping .*/inf_damping = 0.9, 0.9/" \ -e "s/inf_sd_initial .*/inf_sd_initial = 0.6, 0.6/" \ -e "s/inf_sd_lower_bound .*/inf_sd_lower_bound = 0.5, 0.5/" \ -e "s/inf_sd_max_change .*/inf_sd_max_change = 1.05, 1.05/" \ -e "s/cutoff .*/cutoff = 0.02/" \ -e "s/forcing .*/forcing = 9.0/" \ ../input.nml >! input.nml || exit 1 ../filter |& tee filter_log.txt cd .. end end end echo "==============================================================================" echo "Comparing observation-space results" foreach OUTPUT ( $Test/work/inf_?_?/obs_seq.final ) set GOLD = `echo $OUTPUT | sed -e "s#$Test#$Manhattan#"` echo "Comparing " echo $OUTPUT echo $GOLD echo end