FV3 Bundle
ut_ncrad.F90
Go to the documentation of this file.
1 program ut_ncrad
2 
3 use ncd_kinds, only : i_kind
4 use read_diag, only: set_radiag,&
10 use read_diag, only: read_radiag_data,&
15 
16 implicit none
17 character(len=*), parameter :: myname='ut_NCrad'
18 
19 integer(i_kind) :: iversion = 30303
20 integer(i_kind) :: npred = 7 ! number of predictors in file
21 integer(i_kind) :: luin = 10 ! file unit - needs to be unwired
22 logical :: retrieval = .false. ! true when dealing with SST retrievals
23 logical :: lverbose = .true. ! control verbose
24 logical :: ncftype = .true. ! file type NC4
25 
26 integer(i_kind) iarg, argc, iargc
27 integer(i_kind) ier,icnt
28 character(len=255) :: ncfname
29 
30 type(diag_header_fix_list ) :: header_fix
31 type(diag_header_chan_list),allocatable :: header_chan(:)
32 type(diag_data_name_list) :: header_name
33 
34 type(diag_data_fix_list) :: datafix
35 type(diag_data_chan_list) ,allocatable :: datachan(:)
36 type(diag_data_extra_list) ,allocatable :: dataextra(:,:)
37 
38 argc = iargc()
39 if ( argc < 1 ) then
40 endif
41 
42 iarg = 1
43 call getarg ( iarg, ncfname )
44 
45 print *, myname, ': Input file: ', trim(ncfname)
46 
47 call set_netcdf_read(.true.)
48 call nc_diag_read_init(ncfname, luin)
49 call set_radiag("version",iversion,ier)
50 
51 call read_radiag_header(luin,npred,retrieval,header_fix,header_chan,header_name,ier,lverbose)
52 
53 icnt=0
54 do while (ier .ge. 0)
55  call read_radiag_data ( luin, header_fix, .false., datafix, datachan, &
56  dataextra, ier )
57 
58  if (ier .lt. 0) cycle
59  icnt = icnt + 1
60 enddo
61 print*, myname, ': Found this many records: ', icnt
62 print*, myname, ': Found this many channels: ', header_fix%nchan
63 print*, myname, ': Observation type in file: ', header_fix%obstype
64 print*, myname, ': Date of input file: ', header_fix%idate
65 call nc_diag_read_close(filename=ncfname)
66 
67 close(luin)
68 end program ut_ncrad
subroutine, public read_radiag_header(ftin, npred_radiag, retrieval, header_fix, header_chan, data_name, iflag, lverbose)
Definition: read_diag.f90:321
integer, parameter, public i_kind
Definition: ncd_kinds.F90:71
program ut_ncrad
Definition: ut_ncmass.F90:1
subroutine, public set_netcdf_read(use_netcdf)
Definition: read_diag.f90:224
subroutine, public read_radiag_data(ftin, header_fix, retrieval, data_fix, data_chan, data_extra, iflag)
Definition: read_diag.f90:729
subroutine nc_diag_read_close(filename, file_ncdr_id, from_pop)
subroutine nc_diag_read_init(filename, file_ncdr_id, from_push)