17 integer,
allocatable :: channels(:)
21 real(kind_real),
allocatable :: errors(:)
43 character(len=*),
intent(in) :: filename
55 error = nf90_open(trim(filename), nf90_nowrite, lun)
56 if (error /= 0)
call abor1_ftn(
"error in opening file")
59 error = nf90_inq_varid(lun,
"wmo_id", varid)
60 error = nf90_get_var(lun, varid, self % wmo_id)
61 if (error /= 0)
call abor1_ftn(
"error in reading the WMO ID")
64 error = nf90_inq_varid(lun,
"r_type", varid)
65 error = nf90_get_var(lun, varid, self % rtype)
66 if (error /= 0)
call abor1_ftn(
"error in reading the rmatrix type")
69 error = nf90_inq_dimid(lun,
"nchans", dimid)
70 error = nf90_inquire_dimension(lun, dimid, len=self % nchans)
71 if (error /= 0)
call abor1_ftn(
"error in reading the dimensions from numchans")
74 allocate(self % channels(self % nchans))
75 allocate(self % errors(self % nchans))
78 error = nf90_inq_varid(lun,
"channels", varid)
79 error = nf90_get_var(lun, varid, self % channels)
80 if (error /= 0)
call abor1_ftn(
"error in reading the rmatrix channels")
83 error = nf90_inq_varid(lun,
"obs_error", varid)
84 error = nf90_get_var(lun, varid, self % errors)
85 if (error /= 0)
call abor1_ftn(
"error in reading the rmatrix errors")
88 error = nf90_close(lun)
89 if (error /= 0)
call abor1_ftn(
"error in closing the rmatrix")
91 write(*,*)
"Successfully opened, read and closed r matrix netcdf file"
107 if (
allocated(self % channels))
deallocate(self % channels)
108 if (
allocated(self % errors))
deallocate(self % errors)
124 write(*,*)
"wmo_id = ", self % wmo_id
125 write(*,*)
"rtype = ", self % rtype
126 write(*,*)
"channels = ", self % channels(:)
127 write(*,*)
"errors = ", self % errors(:)
Fortran derived type to hold data for the observation covariance.
subroutine rmatrix_print(self)
Print method for the full r_matrix.
subroutine rmatrix_setup(self, filename)
Setup for the full r_matrix.
subroutine rmatrix_delete(self)
Delete method for the full r_matrix.