[Dart-dev] [4118] DART/trunk: obs_seq_to_netcdf now uses the same namelist strategy as obs_diag.

nancy at ucar.edu nancy at ucar.edu
Thu Oct 22 17:35:06 MDT 2009


Revision: 4118
Author:   thoar
Date:     2009-10-22 17:35:06 -0600 (Thu, 22 Oct 2009)
Log Message:
-----------
obs_seq_to_netcdf    now uses the same namelist strategy as obs_diag.
Namely, if specified "obs_sequence_name" will act in the 'usual' way - 
either reading a single file or trying to increment the directory to
get more files. If 'obs_sequence_list' is specified - it contains the 
name of the file containing a list of files to be processed.

Only ONE of obs_sequence_name or obs_sequence_list may be 'non-null'.

all namelists that had a obs_seq_to_netcdf namelist were
updated to reflect the new namelist parameter.

Modified Paths:
--------------
    DART/trunk/diagnostics/threed_sphere/obs_diag.html
    DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.f90
    DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html
    DART/trunk/models/wrf/work/input.nml
    DART/trunk/observations/WOD/work/input.nml
    DART/trunk/observations/utilities/threed_sphere/input.nml

-------------- next part --------------
Modified: DART/trunk/diagnostics/threed_sphere/obs_diag.html
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_diag.html	2009-10-22 23:28:40 UTC (rev 4117)
+++ DART/trunk/diagnostics/threed_sphere/obs_diag.html	2009-10-22 23:35:06 UTC (rev 4118)
@@ -313,7 +313,7 @@
 
 <TR><!--contents--><TD valign=top>   obs_sequence_name </TD>
     <!--  type  --><TD valign=top>   character         </TD>
-    <!--descript--><TD>Name of the observation sequence files. <BR>
+    <!--descript--><TD>Name of the observation sequence file(s). <BR>
             This may be a relative or absolute filename. If the filename
             contains a '/', the filename is considered to be comprised of
 	    everything to the right, and a directory structure to the left.
@@ -330,13 +330,11 @@
 
 <TR><!--contents--><TD valign=top>   obs_sequence_list </TD>
     <!--  type  --><TD valign=top>   character         </TD>
-    <!--descript--><TD>Name of a file containing a list of observation 
-            sequence files. <BR>
-            You can only specify <strong>either</strong> 
-            <em class="code">obs_sequence_name</em>
-            <strong>or</strong> 
-            <em class="code">obs_sequence_list</em> -- not both.
-            One of them has to be an empty string ... i.e. <em class="code">''</em>.
+    <!--descript--><TD>Name of an ascii text file which contains a list
+            of one or more observation sequence files, one per line.
+            If this is specified, 'obs_sequence_name' must be set to ''. 
+            Can be created by any method, including sending the output
+            of the 'ls' command to a file, a text editor, or another program.
 	    <BR>
 	    Default '' - an empty string.</TD></TR>  
 

Modified: DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.f90
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.f90	2009-10-22 23:28:40 UTC (rev 4117)
+++ DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.f90	2009-10-22 23:35:06 UTC (rev 4118)
@@ -46,8 +46,8 @@
                              file_exist, error_handler, E_ERR, E_WARN, E_MSG, &
                              initialize_utilities, nmlfileunit, timestamp, &
                              find_namelist_in_file, check_namelist_read, nc_check, &
-                             get_next_filename, find_textfile_dims, file_to_text, &
-                             do_nml_file, do_nml_term
+                             next_file, get_next_filename, find_textfile_dims, &
+                             file_to_text, do_nml_file, do_nml_term
 
 use typeSizes
 use netcdf
@@ -190,9 +190,10 @@
 if (do_nml_term()) write(    *      , nml=obs_seq_to_netcdf_nml)
 
 if ((obs_sequence_name /= '') .and. (obs_sequence_list /= '')) then
-   write(msgstring,*)'in namelist only one of obs filename or filelist can be given.  set other to "" '
-   call error_handler(E_ERR, 'obs_seq_to_netcdf', msgstring, &
-                      source, revision, revdate)
+   write(msgstring,*)'specify "obs_sequence_name" or "obs_sequence_list"'
+   call error_handler(E_MSG, 'obs_seq_to_netcdf', msgstring, source, revision, revdate)
+   write(msgstring,*)'set other to an empty string ... i.e. ""'
+   call error_handler(E_ERR, 'obs_seq_to_netcdf', msgstring, source, revision, revdate)
 endif
 
 
@@ -215,10 +216,10 @@
 ! Prepare the variables
 !----------------------------------------------------------------------
 
-allocate(obs_seq_filenames(Nepochs*4))
+allocate(obs_seq_filenames(1000))
 obs_seq_filenames = 'null'
 
-ObsFileLoop : do ifile=1, Nepochs*4
+ObsFileLoop : do ifile=1, size(obs_seq_filenames)
 !-----------------------------------------------------------------------
 
   ! Because of the ability to 'cycle' the ObsFileLoop, we need to
@@ -233,22 +234,14 @@
    if (allocated(qc)) deallocate( qc, U_qc, copyvals, U_copyvals,  &
                         obs_copy_names, qc_copy_names, obscopies )
 
-   ! Try to build the next input filename ... 
+   ! Determine the next input filename ... 
 
-   ! original code:
-   !obs_seq_in_file_name = next_file(obs_sequence_name,ifile)
-
-   ! if you give a single explicit name, only go through loop once.
-   ! otherwise, you've given a list, so loop until the list is empty
-   ! (the routine returns '' when it gets to the list end).
-   obs_seq_in_file_name = ''
-   if (obs_sequence_name /= '') then
-      if (ifile == 1) obs_seq_in_file_name = obs_sequence_name
+   if (obs_sequence_list == '') then
+      obs_seq_in_file_name = next_file(obs_sequence_name,ifile)
    else
       obs_seq_in_file_name = get_next_filename(obs_sequence_list,ifile)
+      if (obs_seq_in_file_name == '') exit ObsFileLoop
    endif
-      
-   if (obs_seq_in_file_name == '') exit ObsFileLoop
 
    if ( file_exist(trim(obs_seq_in_file_name)) ) then
       write(msgstring,*)'opening ', trim(obs_seq_in_file_name)
@@ -346,9 +339,9 @@
             call error_handler(E_MSG,'obs_seq_to_netcdf',msgstring,source,revision,revdate)
             msgstring = 'does not match the same observation copy from the first file.'
             call error_handler(E_MSG,'obs_seq_to_netcdf',msgstring,source,revision,revdate)
-            write(msgstring,'(''obs copy '',a)') trim(obs_copy_names(i))
+            write(msgstring,'(''obs copy >'',a,''<'')') trim(obs_copy_names(i))
             call error_handler(E_MSG,'obs_seq_to_netcdf',msgstring,source,revision,revdate)
-            write(msgstring,'(''expected '',a)') trim(module_obs_copy_names(i))
+            write(msgstring,'(''expected >'',a,''<'')') trim(module_obs_copy_names(i))
             call error_handler(E_ERR,'obs_seq_to_netcdf',msgstring,source,revision,revdate)
          endif
       enddo

Modified: DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html	2009-10-22 23:28:40 UTC (rev 4117)
+++ DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html	2009-10-22 23:35:06 UTC (rev 4118)
@@ -152,6 +152,12 @@
    longitude [0.,360.] ... but it is possible to specify a region that spans
    the dateline by specifying the <em class="code">lonlim2</em> to be less 
    than <em class="code">lonlim1</em>.
+   <br />
+   <br />
+   You can only specify <strong>either</strong>
+   <em class="code">obs_sequence_name</em>
+   <strong>or</strong>
+   <em class="code">obs_sequence_list</em> -- not both.
 </P>
 
 
@@ -162,9 +168,21 @@
 
 <TR><!--contents--><TD valign=top> obs_sequence_name  </TD>
     <!--  type  --><TD valign=top> character(len=129) </TD>
-    <!--descript--><TD>Name of an observation sequence file. 
-            If this is specified, only this single file will be read,
-            and 'obs_sequence_list' must be set to ''.
+    <!--descript--><TD>Name of an observation sequence file(s). 
+            This may be a relative or absolute filename. If the filename
+            contains a '/', the filename is considered to be comprised of
+            everything to the right, and a directory structure to the left.
+            The directory structure is then queried to see if it can be
+            incremented to handle a sequence of observation files.
+            The default behavior of <em class="program">obs_diag</em>
+            is to look for additional files to include until the files
+            are exhausted or an <em class=file>obs_seq.final</em> file
+            is found that contains observations beyond the timeframe of
+            interest.<BR>e.g. 'obsdir_001/obs_seq.final' will cause
+            <em class="program">obs_diag</em> to look for
+            'obsdir_002/obs_seq.final', and so on.
+            <br />
+            If this is specified, 'obs_sequence_list' must be set to ''.
 	    Default 'obs_seq.final'</TD></TR>  
 
 <TR><!--contents--><TD valign=top> obs_sequence_list  </TD>
@@ -174,7 +192,7 @@
             If this is specified, 'obs_sequence_name' must be set to ''. 
             Can be created by any method, including sending the output
             of the 'ls' command to a file, a text editor, or another program.
-	    Default ''</TD></TR>  
+	    Default '' - and empty string.</TD></TR>  
 
 <TR><!--contents--><TD valign=top>   lonlim1   </TD>
     <!--  type  --><TD valign=top>   real      </TD>

Modified: DART/trunk/models/wrf/work/input.nml
===================================================================
--- DART/trunk/models/wrf/work/input.nml	2009-10-22 23:28:40 UTC (rev 4117)
+++ DART/trunk/models/wrf/work/input.nml	2009-10-22 23:35:06 UTC (rev 4118)
@@ -256,6 +256,7 @@
    
 &obs_seq_to_netcdf_nml  
    obs_sequence_name = 'obs_seq.final',
+   obs_sequence_list = '',
    lonlim1    =    0.0,
    lonlim2    =  360.0,
    latlim1    =  -90.0,

Modified: DART/trunk/observations/WOD/work/input.nml
===================================================================
--- DART/trunk/observations/WOD/work/input.nml	2009-10-22 23:28:40 UTC (rev 4117)
+++ DART/trunk/observations/WOD/work/input.nml	2009-10-22 23:35:06 UTC (rev 4118)
@@ -61,7 +61,8 @@
    /
 
 &obs_seq_to_netcdf_nml
-   obs_sequence_name = 'obs_seq2000.wod'
+   obs_sequence_name = 'obs_seq2000.wod',
+   obs_sequence_list = '',
    lonlim1    =    0.0,
    lonlim2    =  360.0,
    latlim1    =  -90.0,

Modified: DART/trunk/observations/utilities/threed_sphere/input.nml
===================================================================
--- DART/trunk/observations/utilities/threed_sphere/input.nml	2009-10-22 23:28:40 UTC (rev 4117)
+++ DART/trunk/observations/utilities/threed_sphere/input.nml	2009-10-22 23:35:06 UTC (rev 4118)
@@ -49,7 +49,8 @@
    /
 
 &obs_seq_to_netcdf_nml
-   obs_sequence_name = 'obs_seq.final'
+   obs_sequence_name = 'obs_seq.final',
+   obs_sequence_list = '',
    lonlim1    =    0.0,
    lonlim2    =  360.0,
    latlim1    =  -90.0,


More information about the Dart-dev mailing list