[Dart-dev] [3884] DART/trunk/observations/quikscat: Working on bristle.ucar. edu - uses the DIRTH winds with QC flag==0.

nancy at ucar.edu nancy at ucar.edu
Fri May 22 13:39:41 MDT 2009


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090522/36bd480c/attachment.html 
-------------- next part --------------
Modified: DART/trunk/observations/quikscat/quikscat_JPL_mod.f90
===================================================================
--- DART/trunk/observations/quikscat/quikscat_JPL_mod.f90	2009-05-22 19:27:01 UTC (rev 3883)
+++ DART/trunk/observations/quikscat/quikscat_JPL_mod.f90	2009-05-22 19:39:40 UTC (rev 3884)
@@ -158,7 +158,10 @@
 type(obs_def_type)      :: obs_def
 type(obs_type)          :: obs, prev_obs
 
-integer :: i, irow, iwvc, iamb, num_copies, num_qc
+integer :: i, irow, iwvc, iamb
+integer, PARAMETER :: num_copies = 1
+!integer, PARAMETER :: num_qc = 3
+integer, PARAMETER :: num_qc = 1
 integer :: days, seconds
 integer :: obs_num
 integer :: which_vert, uobstype, vobstype
@@ -166,7 +169,7 @@
 real(r4) :: speed, dir
 real(r8) :: lon, lat, vloc
 real(r8) :: u_obs, v_obs, u_var, v_var
-real(r8) :: aqc
+real(r8) :: aqc(num_qc)
 real(r8) :: sintheta, costheta, dirvar, speedvar
 
 type(time_type) :: time, pre_time
@@ -175,9 +178,6 @@
 
 if ( .not. module_initialized ) call initialize_module
 
-num_copies  = 1
-num_qc      = 1
-
 ! Initialize an obs_sequence 
 call init_obs_sequence(real_obs_sequence, num_copies, num_qc, max_num)
 
@@ -187,10 +187,9 @@
    call set_copy_meta_data(real_obs_sequence, i, meta_data)
 end do
 
-do i = 1, num_qc
-   meta_data = 'QC index - wvc_quality_flag'
-   call set_qc_meta_data(real_obs_sequence, i, meta_data)
-end do
+call set_qc_meta_data(real_obs_sequence, 1, 'QC flag - wvc_quality_flag')
+!call set_qc_meta_data(real_obs_sequence, 2, 'IMUDH - mp_rain_probability')
+!call set_qc_meta_data(real_obs_sequence, 3, 'NOF Index - nof_rain_index')
 
 ! Initialize the obs variables
 call init_obs(     obs, num_copies, num_qc)
@@ -223,11 +222,14 @@
 
       if (orbit%num_ambigs(iwvc,irow) < 1) cycle wvcloop
 
-      ! only use data flagged as 'best'
-      ! this should be namelist controlled at some point
+    !   only use data flagged as 'best'
+    !   this should be namelist controlled at some point
+    !
+      if ( orbit%wvc_quality_flag(iwvc,irow) /= 0 ) cycle wvcloop
 
-      aqc = orbit%wvc_quality_flag(iwvc,irow)
-      if ( aqc /= 0 ) cycle wvcloop
+      aqc(1) = orbit%wvc_quality_flag(   iwvc,irow)
+!     aqc(2) = orbit%mp_rain_probability(iwvc,irow)
+!     aqc(3) = orbit%nof_rain_index(     iwvc,irow)
 
       lat  = orbit%wvc_lat(iwvc,irow) ! valid range [-90.00,  90.00]
       lon  = orbit%wvc_lon(iwvc,irow) ! valid range [  0.00, 359.99]
@@ -247,13 +249,18 @@
       ! 0.0 is TOWARD the north - in direct contradiction to 
       ! atmospheric convention. Convert by adding 180 modulo 360 
    
+      iamb  = orbit%wvc_selection(     iwvc,irow)
+
       ! using the 'selected wind' ... aka highest-ranked ambiguity,
-      ! Not DIRTH nor NWP ... should also be namelist selected
 
-      iamb  = orbit%wvc_selection(     iwvc,irow)
-      speed = orbit%wind_speed(   iamb,iwvc,irow)
-      dir   = mod(orbit%wind_dir( iamb,iwvc,irow)+180.0_r4, 360.0_r4)
+!     speed =     orbit%wind_speed(iamb,iwvc,irow)
+!     dir   = mod(orbit%wind_dir(  iamb,iwvc,irow)+180.0_r4, 360.0_r4)
 
+      ! Use this block for the DIRTH selection
+
+      speed =     orbit%wind_speed_selection(iwvc,irow)
+      dir   = mod(orbit%wind_dir_selection(  iwvc,irow) + 180.0_r4, 360.0_r4)
+
       if ( speed < 1.0_r4 ) cycle wvcloop ! everything unreliable 
 
       ! The requirements for QuikSCAT were 2 m/s speed (rms) over 3-20m/s
@@ -362,11 +369,11 @@
 !------------------------------------------------------------------------------
 integer,        intent(in)    :: num_copies, num_qc
 type(obs_type), intent(inout) :: obs
-real(r8),       intent(in)    :: lon, lat, vloc, obs_value, var2, aqc
+real(r8),       intent(in)    :: lon, lat, vloc, obs_value, var2, aqc(:)
 integer,        intent(in)    :: obs_kind, which_vert, seconds, days
 
 integer            :: i
-real(r8)           :: aqc01(1), obs_value01(1)
+real(r8)           :: obs_value01(1)
 type(obs_def_type) :: obsdef0
 
 if ( .not. module_initialized ) call initialize_module
@@ -382,10 +389,7 @@
    call set_obs_values(obs, obs_value01(1:1) )
 end do
 
-do i = 1, num_qc
-   aqc01(1) = aqc
-   call set_qc(obs, aqc01(1:1))
-end do
+call set_qc(obs, aqc)
 
 end subroutine real_obs
 

Added: DART/trunk/observations/quikscat/work/ConvertMany.csh
===================================================================
--- DART/trunk/observations/quikscat/work/ConvertMany.csh	                        (rev 0)
+++ DART/trunk/observations/quikscat/work/ConvertMany.csh	2009-05-22 19:39:40 UTC (rev 3884)
@@ -0,0 +1,106 @@
+#!/bin/csh
+#
+#BSUB -J qscat
+#BSUB -n 1
+#BSUB -q standby
+#BSUB -W 0:05
+#BSUB -o out.%J.%I
+#BSUB -e err.%J.%I
+#BSUB -N -u ${USER}@ucar.edu
+
+#----------------------------------------------------------------------
+#----------------------------------------------------------------------
+
+set DARTHOME = /fs/image/home/thoar/DART/observations
+set DATADIR = /gpfs/ptmp/dart/Obs_sets/QuikSCAT_24_ascii
+
+#----------------------------------------------------------------------
+#----------------------------------------------------------------------
+
+@ y = 2007
+@ n = 305
+@ nmax = 313
+
+while ( $n <= $nmax )
+
+   echo "$y $n"
+
+   cd /ptmp/thoar/QuikSCAT_L2B/${y}/${n}
+
+   \rm -f *obs_seq_out
+
+   gunzip -q QS_S2B*.gz
+
+   foreach FILE ( QS_S2B* )
+
+      echo "&obs_kind_nml"                             >! input.nml
+      echo "   /"                                      >> input.nml
+      echo "&location_nml"                             >> input.nml
+      echo "   /"                                      >> input.nml
+      echo "&utilities_nml"                            >> input.nml
+      echo "   /"                                      >> input.nml
+      echo "&obs_sequence_nml"                         >> input.nml
+      echo "   write_binary_obs_sequence = .false."    >> input.nml
+      echo "   /"                                      >> input.nml
+      echo " "                                         >> input.nml
+      echo "&convert_L2b_nml"                          >> input.nml
+      echo "datadir   = '.',"                          >> input.nml
+      echo "outputdir = '.',"                          >> input.nml
+      echo "l2b_file = '"$FILE"',"                     >> input.nml
+      echo "lon1 =   0.0, lon2 = 360.0,"               >> input.nml
+      echo "lat1 = -90.0, lat2 =  90.0"                >> input.nml
+      echo "   /"                                      >> input.nml
+      echo " "                                         >> input.nml
+
+      echo "      $FILE"
+
+      ${DARTHOME}/quikscat/work/convert_L2b > /dev/null || exit 1
+   
+   end
+
+   #----------------------------------------------------------------------
+   # Concatenate all the observation sequence files for each orbit 
+   # into one observation sequence file for a day. 
+   #
+   # Create namelist for obs_sequence_tool
+   #----------------------------------------------------------------------
+
+   set STRING = "1,$ s# #', '#g"
+   set filenames = `ls *obs_seq_out`
+   set numorbits = $#filenames
+
+   if ( $numorbits > 0 ) then
+
+      echo $filenames >! filenames_file
+
+      set filenamestring = `sed -e "$STRING" filenames_file` 
+
+      echo " &obs_sequence_tool_nml"                >> input.nml
+      echo " num_input_files = ${numorbits},"       >> input.nml
+      echo " filename_seq = '"${filenamestring}"'," >> input.nml
+      echo " filename_out = 'obs_seq.processed',"   >> input.nml
+      echo " first_obs_days = -1,"                  >> input.nml
+      echo " first_obs_seconds = -1,"               >> input.nml
+      echo " last_obs_days = -1,"                   >> input.nml
+      echo " last_obs_seconds = -1,"                >> input.nml
+      echo " obs_types = '',"                       >> input.nml
+      echo " keep_types = .false.,"                 >> input.nml
+      echo " print_only = .false.,"                 >> input.nml
+      echo " min_lat = -90.0,"                      >> input.nml
+      echo " max_lat = 90.0,"                       >> input.nml
+      echo " min_lon = 0.0,"                        >> input.nml
+      echo " max_lon = 360.0"                       >> input.nml
+      echo "    /"                                  >> input.nml
+
+      ${DARTHOME}/utilities/threed_sphere/obs_sequence_tool || exit 2
+
+      mv obs_seq.processed ${DATADIR}/${y}11/qscatL2B_${y}_${n}_obs_seq.out
+
+   endif
+
+   @ n = $n + 1
+
+   \rm -rf input.nml filenames_file dart_log.out dart_log.nml
+
+end
+


Property changes on: DART/trunk/observations/quikscat/work/ConvertMany.csh
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Date Revision Author HeadURL Id
Name: svn:eol-style
   + native

Modified: DART/trunk/observations/quikscat/work/mkmf_convert_L2b
===================================================================
--- DART/trunk/observations/quikscat/work/mkmf_convert_L2b	2009-05-22 19:27:01 UTC (rev 3883)
+++ DART/trunk/observations/quikscat/work/mkmf_convert_L2b	2009-05-22 19:39:40 UTC (rev 3884)
@@ -13,11 +13,13 @@
 #
 
 set JPGDIR = /contrib/jpeg-6b_gnu-4.1.2-64
-set HDFDIR = /contrib/hdf-4.2r4_gnu-4.1.2-64
+set HDFDIR = /contrib/HDF4.2r4/intel-10-64
 set MYLIBS = "-lmfhdf -ldf -ljpeg -lz  -lm"
 
-set MYINCDIR = "-I${HDFDIR}/include -I${JPGDIR}/include"
-set MYLIBDIR = "-L${HDFDIR}/lib     -L${JPGDIR}/lib"
+#set MYINCDIR = "-I${HDFDIR}/include -I${JPGDIR}/include"
+#set MYLIBDIR = "-L${HDFDIR}/lib     -L${JPGDIR}/lib"
+set MYINCDIR = "-I${HDFDIR}/include"
+set MYLIBDIR = "-L${HDFDIR}/lib"
 
 ../../../mkmf/mkmf -p convert_L2b -t ../../../mkmf/mkmf.template \
  -l "${MYINCDIR} -L/usr/lib64 ${MYLIBDIR} ${MYLIBS}" \


More information about the Dart-dev mailing list