[Dart-dev] [4268] DART/trunk/observations/MADIS: Minor update to allow the converters to read files without

nancy at ucar.edu nancy at ucar.edu
Tue Feb 9 14:24:04 MST 2010


Revision: 4268
Author:   nancy
Date:     2010-02-09 14:24:04 -0700 (Tue, 09 Feb 2010)
Log Message:
-----------
Minor update to allow the converters to read files without
Data QC values.  To enable that, edit the source and set
'input_has_qc' to .false. and recompile.

Modified Paths:
--------------
    DART/trunk/observations/MADIS/convert_madis_acars.f90
    DART/trunk/observations/MADIS/convert_madis_marine.f90
    DART/trunk/observations/MADIS/convert_madis_rawin.f90
    DART/trunk/observations/MADIS/convert_madis_surface.f90

-------------- next part --------------
Modified: DART/trunk/observations/MADIS/convert_madis_acars.f90
===================================================================
--- DART/trunk/observations/MADIS/convert_madis_acars.f90	2010-02-08 19:13:26 UTC (rev 4267)
+++ DART/trunk/observations/MADIS/convert_madis_acars.f90	2010-02-09 21:24:04 UTC (rev 4268)
@@ -47,12 +47,14 @@
 character(len=14),  parameter :: acars_netcdf_file = 'acars_input.nc'
 character(len=129), parameter :: acars_out_file    = 'obs_seq.acars'
 
-! the following logical parameters control which water-vapor variables appear in the output file
-! and whether to use the NCEP error or Lin and Hubbard (2004) moisture error model
+! the following logical parameters control which water-vapor variables appear in the output file, 
+! whether to use the NCEP error or Lin and Hubbard (2004) moisture error model, and 
+! whether the input data file has QC values.
 logical, parameter :: LH_err                    = .false.
 logical, parameter :: include_specific_humidity = .true.
 logical, parameter :: include_relative_humidity = .false.
 logical, parameter :: include_dewpoint          = .false.
+logical, parameter :: input_has_qc              = .true.
 
 integer, parameter ::   num_copies = 1,   &   ! number of copies in sequence
                         num_qc     = 1        ! number of QC entries
@@ -155,24 +157,31 @@
 call check( nf90_get_var(ncid, varid, tobs) )
 
 ! read the QC check for each variable
-call check( nf90_inq_varid(ncid, "altitudeQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_palt) )
+if (input_has_qc) then
+   call check( nf90_inq_varid(ncid, "altitudeQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_palt) )
+   
+   call check( nf90_inq_varid(ncid, "temperatureQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_tair) )
+   
+   call check( nf90_inq_varid(ncid, "downlinkedRHQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_relh) )
+   
+   call check( nf90_inq_varid(ncid, "dewpointQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_tdew) )
+   
+   call check( nf90_inq_varid(ncid, "windDirQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_wdir) )
+   
+   call check( nf90_inq_varid(ncid, "windSpeedQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_wspd) )
+else
+   ! if input contains no QCs, assume all are ok.
+   qc_palt = 0;  qc_relh = 0
+   qc_tair = 0;  qc_tdew = 0
+   qc_wdir = 0;  qc_wspd = 0
+endif
 
-call check( nf90_inq_varid(ncid, "temperatureQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_tair) )
-
-call check( nf90_inq_varid(ncid, "downlinkedRHQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_relh) )
-
-call check( nf90_inq_varid(ncid, "dewpointQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_tdew) )
-
-call check( nf90_inq_varid(ncid, "windDirQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_wdir) )
-
-call check( nf90_inq_varid(ncid, "windSpeedQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_wspd) )
-
 call check( nf90_close(ncid) )
 
 !  either read existing obs_seq or create a new one

Modified: DART/trunk/observations/MADIS/convert_madis_marine.f90
===================================================================
--- DART/trunk/observations/MADIS/convert_madis_marine.f90	2010-02-08 19:13:26 UTC (rev 4267)
+++ DART/trunk/observations/MADIS/convert_madis_marine.f90	2010-02-09 21:24:04 UTC (rev 4268)
@@ -55,12 +55,14 @@
 character(len=15),  parameter :: marine_netcdf_file = 'marine_input.nc'
 character(len=129), parameter :: marine_out_file    = 'obs_seq.marine_sfc'
 
-! the following logical parameters control which water-vapor variables appear in the output file
-! and whether to use the NCEP error or Lin and Hubbard (2004) moisture error model
+! the following logical parameters control which water-vapor variables appear in the output file,
+! whether to use the NCEP error or Lin and Hubbard (2004) moisture error model, and
+! whether the input data file has QC values.
 logical, parameter :: LH_err                    = .false.
 logical, parameter :: include_specific_humidity = .true.
 logical, parameter :: include_relative_humidity = .false.
 logical, parameter :: include_dewpoint          = .false.
+logical, parameter :: input_has_qc              = .true.
 
 integer, parameter   :: dsecobs = 2700,   &   ! observation window
                         num_copies = 1,   &   ! number of copies in sequence
@@ -174,24 +176,31 @@
 call check( nf90_get_var(ncid, varid, tobs) )
 
 ! read the QC check for each variable
-call check( nf90_inq_varid(ncid, "stationPressQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_sfcp) )
+if (input_has_qc) then
+   call check( nf90_inq_varid(ncid, "stationPressQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_sfcp) )
+   
+   call check( nf90_inq_varid(ncid, "seaLevelPressQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_slp) )
+   
+   call check( nf90_inq_varid(ncid, "temperatureQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_tair) )
+   
+   call check( nf90_inq_varid(ncid, "dewpointQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_tdew) )
+   
+   call check( nf90_inq_varid(ncid, "windDirQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_wdir) )
+   
+   call check( nf90_inq_varid(ncid, "windSpeedQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_wspd) )
+else
+   ! if input contains no QCs, assume all are ok.
+   qc_sfcp = 0;  qc_slp  = 0
+   qc_tair = 0;  qc_tdew = 0
+   qc_wdir = 0;  qc_wspd = 0
+endif
 
-call check( nf90_inq_varid(ncid, "seaLevelPressQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_slp) )
-
-call check( nf90_inq_varid(ncid, "temperatureQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_tair) )
-
-call check( nf90_inq_varid(ncid, "dewpointQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_tdew) )
-
-call check( nf90_inq_varid(ncid, "windDirQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_wdir) )
-
-call check( nf90_inq_varid(ncid, "windSpeedQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_wspd) )
-
 call check( nf90_close(ncid) )
 
 !  either read existing obs_seq or create a new one

Modified: DART/trunk/observations/MADIS/convert_madis_rawin.f90
===================================================================
--- DART/trunk/observations/MADIS/convert_madis_rawin.f90	2010-02-08 19:13:26 UTC (rev 4267)
+++ DART/trunk/observations/MADIS/convert_madis_rawin.f90	2010-02-09 21:24:04 UTC (rev 4268)
@@ -55,11 +55,13 @@
 character(len=129), parameter :: rawin_out_file = 'obs_seq.rawin'
 
 ! the following logical parameters control which water-vapor variables appear in the output file
-! and whether to use the NCEP error or Lin and Hubbard (2004) moisture error model
+! whether to use the NCEP error or Lin and Hubbard (2004) moisture error model, and
+! whether the input data file has QC values.
 logical, parameter :: LH_err                    = .false.
 logical, parameter :: include_specific_humidity = .true.
 logical, parameter :: include_relative_humidity = .false.
 logical, parameter :: include_dewpoint          = .false.
+logical, parameter :: input_has_qc              = .true.
 
 integer, parameter ::   num_copies = 1,   &   ! number of copies in sequence
                         num_qc     = 1        ! number of QC entries
@@ -221,16 +223,23 @@
   call check( nf90_inq_varid(fid, 'wsMan', var_id) )
   call check( nf90_get_var(fid,var_id,wspd,start=(/ 1, n /),count=(/ nman, 1 /)) )
   call check( nf90_get_att(fid, var_id, '_FillValue', wspd_miss) )
-  call check( nf90_inq_varid(fid, "prManQCR", var_id) )
-  call check( nf90_get_var(fid, var_id, qc_pres,start=(/ 1, n /),count=(/ nman, 1 /)) )
-  call check( nf90_inq_varid(fid, "tpManQCR", var_id) )
-  call check( nf90_get_var(fid, var_id, qc_tair,start=(/ 1, n /),count=(/ nman, 1 /)) )
-  call check( nf90_inq_varid(fid, "tdManQCR", var_id) )
-  call check( nf90_get_var(fid, var_id, qc_tdew,start=(/ 1, n /),count=(/ nman, 1 /)) )
-  call check( nf90_inq_varid(fid, "wdManQCR", var_id) )
-  call check( nf90_get_var(fid, var_id, qc_wdir,start=(/ 1, n /),count=(/ nman, 1 /)) )
-  call check( nf90_inq_varid(fid, "wsManQCR", var_id) )
-  call check( nf90_get_var(fid, var_id, qc_wspd,start=(/ 1, n /),count=(/ nman, 1 /)) )
+  if (input_has_qc) then
+     call check( nf90_inq_varid(fid, "prManQCR", var_id) )
+     call check( nf90_get_var(fid, var_id, qc_pres,start=(/ 1, n /),count=(/ nman, 1 /)) )
+     call check( nf90_inq_varid(fid, "tpManQCR", var_id) )
+     call check( nf90_get_var(fid, var_id, qc_tair,start=(/ 1, n /),count=(/ nman, 1 /)) )
+     call check( nf90_inq_varid(fid, "tdManQCR", var_id) )
+     call check( nf90_get_var(fid, var_id, qc_tdew,start=(/ 1, n /),count=(/ nman, 1 /)) )
+     call check( nf90_inq_varid(fid, "wdManQCR", var_id) )
+     call check( nf90_get_var(fid, var_id, qc_wdir,start=(/ 1, n /),count=(/ nman, 1 /)) )
+     call check( nf90_inq_varid(fid, "wsManQCR", var_id) )
+     call check( nf90_get_var(fid, var_id, qc_wspd,start=(/ 1, n /),count=(/ nman, 1 /)) )
+  else
+     ! if input contains no QCs, assume all are ok.
+     qc_pres = 0
+     qc_tair = 0 ;  qc_tdew = 0
+     qc_wdir = 0 ;  qc_wspd = 0
+  endif
 
   if ( pres(1) /= pres_miss .and. qc_pres(1) == 0 ) then
 

Modified: DART/trunk/observations/MADIS/convert_madis_surface.f90
===================================================================
--- DART/trunk/observations/MADIS/convert_madis_surface.f90	2010-02-08 19:13:26 UTC (rev 4267)
+++ DART/trunk/observations/MADIS/convert_madis_surface.f90	2010-02-09 21:24:04 UTC (rev 4268)
@@ -56,12 +56,14 @@
 character(len=129), parameter :: surface_out_file    = 'obs_seq.land_sfc'
 logical,            parameter :: exclude_special     = .true.
 
-! the following logical parameters control which water-vapor variables appear in the output file
-! and whether to use the NCEP error or Lin and Hubbard (2004) moisture error model
+! the following logical parameters control which water-vapor variables appear in the output file,
+! whether to use the NCEP error or Lin and Hubbard (2004) moisture error model, and
+! whether the input data file has QC values.
 logical, parameter :: LH_err                    = .false.
 logical, parameter :: include_specific_humidity = .true.
 logical, parameter :: include_relative_humidity = .false.
 logical, parameter :: include_dewpoint          = .false.
+logical, parameter :: input_has_qc              = .true.
 
 integer, parameter   :: dsecobs    = 420, &   ! observation window
                         num_copies = 1,   &   ! number of copies in sequence
@@ -163,21 +165,28 @@
 call check( nf90_get_var(ncid, varid, tobs) )
 
 ! read the QC check for each variable
-call check( nf90_inq_varid(ncid, "altimeterQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_alti) )
+if (input_has_qc) then
+   call check( nf90_inq_varid(ncid, "altimeterQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_alti) )
+   
+   call check( nf90_inq_varid(ncid, "temperatureQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_tair) )
+   
+   call check( nf90_inq_varid(ncid, "dewpointQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_tdew) )
+   
+   call check( nf90_inq_varid(ncid, "windDirQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_wdir) )
+   
+   call check( nf90_inq_varid(ncid, "windSpeedQCR", varid) )
+   call check( nf90_get_var(ncid, varid, qc_wspd) )
+else
+   ! if input contains no QCs, assume all are ok.
+   qc_alti = 0
+   qc_tair = 0 ;  qc_tdew = 0
+   qc_wdir = 0 ;  qc_wspd = 0
+endif
 
-call check( nf90_inq_varid(ncid, "temperatureQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_tair) )
-
-call check( nf90_inq_varid(ncid, "dewpointQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_tdew) )
-
-call check( nf90_inq_varid(ncid, "windDirQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_wdir) )
-
-call check( nf90_inq_varid(ncid, "windSpeedQCR", varid) )
-call check( nf90_get_var(ncid, varid, qc_wspd) )
-
 !  either read existing obs_seq or create a new one
 call static_init_obs_sequence()
 call init_obs(obs, num_copies, num_qc)


More information about the Dart-dev mailing list