FV3 Bundle
gsidiag_conv_bin2nc4.f90
Go to the documentation of this file.
2 
3  use ncd_kinds
4  use m_diag_conv
5 
6  integer nargs, iargc, n
7  character*256, allocatable :: arg(:)
8 
9  logical ncep, append_suffix
10 
11  type(diag_conv_header) :: hdr
12  type(diag_conv_mass),dimension(:),allocatable :: mass
13  type(diag_conv_wind),dimension(:),allocatable :: wind
14  integer(i_kind) :: nobs_mass, nobs_wind
15  character(120) :: fn
16 
17  nargs = iargc()
18  if( nargs.eq.0 ) then
19  call usage
20  else
21  ncep = .false.
22  append_suffix = .false.
23 
24  allocate(arg(nargs))
25  do n=1,nargs
26  call getarg(n,arg(n))
27  enddo
28  do n=1,nargs
29  if (trim(arg(n)).eq.'-ncep' ) ncep=.true.
30  if (trim(arg(n)).eq.'-append_suffix') append_suffix=.true.
31  enddo
32  endif
33 
34 
35  fn = arg(nargs)
36  call open_conv_diag(fn, hdr, ncep)
37  call read_conv_diag(fn, hdr, mass, wind, nobs_mass, nobs_wind, ncep)
38 
39  print *,hdr%ObsType
40  call write_split_conv_diag_nc(fn, hdr, mass, wind, append_suffix)
41 
42 
43 end
44 
45 subroutine usage
46  write(6,100)
47 100 format( "Usage: ",/,/ &
48  " convert_and_split_conv_diag.x <options> <filename>",/,/ &
49  "where options:",/ &
50  " -ncep : Read NCEP (or MERRA2) diag file (default: read GMAO w/ ioff)",/ &
51  " -append_suffix : add '.type.nc4' suffix instead of conforming to GMAO filename standard",/ &
52  "",/ &
53  " Example:",/ &
54  " convert_and_split_conv_diag.x nc_4emily_nc4.diag_conv_ges.20161202_06z.nc4",/ &
55  " Output files:",/ &
56  " nc_4emily_nc4.diag_conv_uv_ges.20161202_06z.nc4",/ &
57  " nc_4emily_nc4.diag_conv_t_ges.20161202_06z.nc4",/ &
58  " nc_4emily_nc4.diag_conv_q_ges.20161202_06z.nc4",/ &
59  " nc_4emily_nc4.diag_conv_ps_ges.20161202_06z.nc4",/ &
60  )
61  stop
62 end subroutine usage
63 
subroutine usage
program convert_and_split_conv_diag
subroutine, public open_conv_diag(fn, conv_header, ncep)
subroutine, public read_conv_diag(fn, conv_header, conv_mass, conv_wind, nobs_mass, nobs_wind, ncep)
Definition: m_diag_conv.f90:97
subroutine, public write_split_conv_diag_nc(infn, conv_header, conv_mass, conv_wind, append_suffix)