1 subroutine da_read_errfac(ob_name, f1, f2, f3, f4, f5)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 character (len=5), intent(in) :: ob_name
10 real, intent(out) :: f1
11 real, intent(out) :: f2
12 real, intent(out) :: f3
13 real, intent(out) :: f4
14 real, intent(out) :: f5
16 character (len=5) :: ob_name1
17 character (len=21) :: string1
18 character (len=91) :: string2
20 real :: d1, d2, d3, d4, d5
28 if (trace_use_dull) call da_trace_entry("da_read_errfac")
30 call da_get_unit(fac_unit)
31 open(unit=fac_unit, status='old', file = 'errfac.dat', iostat=ierr)
35 read(unit=fac_unit,fmt='(1x,a5,a21,a91)')ob_name1, string1, string2
37 if (ob_name == ob_name1 .and. string1 == ' obs, Error Factor = ') then
38 read(unit=string2(17:31),fmt=*)d1
39 read(unit=string2(32:46),fmt=*)d2
40 read(unit=string2(47:61),fmt=*)d3
41 read(unit=string2(62:76),fmt=*)d4
42 read(unit=string2(77:91),fmt=*)d5
50 else if (ob_name1 == 'Total') then
51 write(unit=message(1),fmt='(a,a)') ' No Tuning Error factors for ', ob_name
52 write(unit=message(2),fmt='(a)') ' So setting to 1.0 i.e. default errors.'
53 call da_warning(__FILE__,__LINE__,message(1:2))
58 call da_warning(__FILE__,__LINE__, (/"Problem reading errfac.dat - Not tuning ob errors"/))
62 call da_free_unit(fac_unit)
64 if (trace_use_dull) call da_trace_exit("da_read_errfac")
66 end subroutine da_read_errfac