From nancy at ucar.edu Mon Dec 7 14:43:46 2015
From: nancy at ucar.edu (nancy at ucar.edu)
Date: Mon, 07 Dec 2015 14:43:46 -0700
Subject: [Dart-dev] [9188] DART/trunk/observations/MADIS: update the default
conversion script to echo 3 values into
Message-ID:
Revision: 9188
Author: nancy
Date: 2015-12-07 14:43:45 -0700 (Mon, 07 Dec 2015)
Log Message:
-----------
update the default conversion script to echo 3 values into
the satwind converter or it will sit there waiting for one
more value and appear to be hung. also add some minor
cleanup to the script comments, and add a warning for
missing input files.
update the documentation slightly to point out there are
compile-time choices and run-time choices for these converters.
Modified Paths:
--------------
DART/trunk/observations/MADIS/MADIS.html
DART/trunk/observations/MADIS/shell_scripts/madis_conv.csh
-------------- next part --------------
Modified: DART/trunk/observations/MADIS/MADIS.html
===================================================================
--- DART/trunk/observations/MADIS/MADIS.html 2015-12-07 18:23:57 UTC (rev 9187)
+++ DART/trunk/observations/MADIS/MADIS.html 2015-12-07 21:43:45 UTC (rev 9188)
@@ -123,9 +123,13 @@
should be commented enough to indicate where changes will be
likely to need to be made.
-The converters have compile-time choices
+
Several converters have compile-time choices
for outputting various types of moist variables.
Check the source code for more details.
+Some converters also read multiple T/F strings
+from the console (standard input) to control at
+run-time what types of observations to convert.
+Again, check the source code for more details.
Each converter has hard-coded input and output filenames:
Modified: DART/trunk/observations/MADIS/shell_scripts/madis_conv.csh
===================================================================
--- DART/trunk/observations/MADIS/shell_scripts/madis_conv.csh 2015-12-07 18:23:57 UTC (rev 9187)
+++ DART/trunk/observations/MADIS/shell_scripts/madis_conv.csh 2015-12-07 21:43:45 UTC (rev 9188)
@@ -1,4 +1,4 @@
-#!/bin/csh
+#!/bin/csh
#
# DART software - Copyright 2004 - 2013 UCAR. This open source software is
# provided by UCAR, "as is", without charge, subject to all terms of use at
@@ -16,14 +16,15 @@
# requires an input.nml namelist file.
-# set this to true if you're planning to pass the start & end times
-# in as command line args. set it to false if you're planning to set
-# the times by editing this file.
+# set the following variable to true if you're planning to pass the
+# start & end times for this script in as command line args.
+# set it to false if you're planning to set the times by editing this file.
set command_line_args = false
# set the type, and first and last times. can roll over day, month and
# year boundaries. hours go from 0 to 23; days 1 to 31; months 1 to 12.
+# do not add a preceeding 0 to any single digit values.
if ($command_line_args == 'true') then
if ($#argv != 9) then
@@ -56,14 +57,14 @@
set end_hour = 0
endif
-# put more stuff here if you have user settable options
-
# set this to true to make a single output file for each calendar day.
# set it to false to make one output file per input file.
set daily = true
-# locations for input madis netcdf files, output dart obs_seq files
-set src_base_dir = /Volumes/joshua3/romine/data/STEP2009/MADIS/
+# locations for input madis netcdf files, output dart obs_seq files.
+# assumes directory structure under this location with the naming
+# convention: .../YYYYMM/DD/${type}
+set src_base_dir = /Volumes/joshua3/romine/data/STEP2009/MADIS
set out_dir = /users/romine/step09/MADIS/obs_sequence/conus
set obs_out = obs_seq.${type}
@@ -127,15 +128,16 @@
echo starting processing for ${year} ${month} ${day} ${hour}
#echo which is gregorian day: $gregday, $gregsec
+ ##################################################################
- # your code goes here.
- # use $year, $month, $day, $hour, and $gregday, $gregsec as needed.
+ # $year, $month, $day, $hour, and $gregday, $gregsec are available
+ # to be used as needed.
##################################################################
# make sure output dir exists. could make it per month, or per day
# by adding year, month, day to dirname here.
- if (! -d $out_dir) mkdir $out_dir
+ if (! -d $out_dir) mkdir -p $out_dir
# append YYYYMM/DD/type to the base directory
set src_dir = ${src_base_dir}/${year}${month}/${day}/${type}
@@ -151,18 +153,27 @@
# if the input is still zipped, unzip it
if ( -f $src_dir/${infn}.gz ) gunzip $src_dir/${infn}.gz
+ if ( ! -f $src_dir/$infn ) echo input filename $src_dir/$infn not found
ln -sf $src_dir/$infn ${type}_input.nc
- # the rawinsonde converter needs two logicals for whether to output
- # significant level data as well as the default data. set these to
- # T or F as you wish. the other converters need no input.
+ # set these to T or F as you wish:
+ # the rawinsonde converter reads two logicals from standard input to
+ # control whether to ouput significant level winds and/or significant
+ # level temperatures in addition to the mandatory level info.
+ # the satwind converter reads three logicals to control whether to
+ # output IR, VIS, and/or WV band winds.
+ # the other converters read nothing from stdin.
if ( ${type} == 'rawin') then
- echo "T T" | ./convert_madis_${type} >&! out.convert_madis_${type}
+ set instring = 'T T'
+ else if ( ${type} == 'satwnd' ) then
+ set instring = 'T T T'
else
- ./convert_madis_${type} >&! out.convert_madis_${type}
+ set instring = ''
endif
+ echo $instring | ./convert_madis_${type} >&! out.convert_madis_${type}
+
if ($daily == 'true') then
if ($hour == 23) mv $obs_out $out_dir/$outfn
else
From nancy at ucar.edu Thu Dec 17 12:52:44 2015
From: nancy at ucar.edu (nancy at ucar.edu)
Date: Thu, 17 Dec 2015 12:52:44 -0700
Subject: [Dart-dev] [9258]
DART/trunk/adaptive_inflate/adaptive_inflate_mod.f90: 3 Bug fixes:
Message-ID:
Revision: 9258
Author: hkershaw
Date: 2015-12-17 12:52:43 -0700 (Thu, 17 Dec 2015)
Log Message:
-----------
3 Bug fixes:
1. Min/max values. If pe 0 owns the inflation index, only pe 0 should access ens_handle%vars(:, owners_index). Otherwise there can be an out of bounds error if other tasks access ens_handle%vars(:, owners_index)
2. Checking for missing_r8 in the inflation mean and sd copies. This should only be done for state space in inflation. Obs space inflation does not use the mean and sd copy - these are initialized to missing_r8.
3. Only 1 task needs to write obs space inflation to a file.
Modified Paths:
--------------
DART/trunk/adaptive_inflate/adaptive_inflate_mod.f90
-------------- next part --------------
Modified: DART/trunk/adaptive_inflate/adaptive_inflate_mod.f90
===================================================================
--- DART/trunk/adaptive_inflate/adaptive_inflate_mod.f90 2015-12-17 16:57:05 UTC (rev 9257)
+++ DART/trunk/adaptive_inflate/adaptive_inflate_mod.f90 2015-12-17 19:52:43 UTC (rev 9258)
@@ -247,9 +247,11 @@
! if inflation array is already on PE0, just figure out the
! largest value in the array and we're done.
if (owner == 0) then
- call prepare_to_read_from_vars(ens_handle)
- minmax_mean(1) = minval(ens_handle%vars(:, owners_index))
- minmax_mean(2) = maxval(ens_handle%vars(:, owners_index))
+ if (ens_handle%my_pe == 0) then
+ call prepare_to_read_from_vars(ens_handle)
+ minmax_mean(1) = minval(ens_handle%vars(:, owners_index))
+ minmax_mean(2) = maxval(ens_handle%vars(:, owners_index))
+ endif
else
! someone else has the inf array. have the owner send the min/max
! values to PE0. after this point only PE0 has the right value
@@ -269,9 +271,11 @@
! if inflation sd array is already on PE0, just figure out the
! largest value in the array and we're done.
if (owner == 0) then
- call prepare_to_read_from_vars(ens_handle)
- minmax_sd(1) = minval(ens_handle%vars(:, owners_index))
- minmax_sd(2) = maxval(ens_handle%vars(:, owners_index))
+ if (ens_handle%my_pe == 0) then
+ call prepare_to_read_from_vars(ens_handle)
+ minmax_sd(1) = minval(ens_handle%vars(:, owners_index))
+ minmax_sd(2) = maxval(ens_handle%vars(:, owners_index))
+ endif
else
! someone else has the sd array. have the owner send the min/max
! values to PE0. after this point only PE0 has the right value
@@ -366,20 +370,26 @@
! if the inflation flavor is 2 there are 2 values: the min and max from the
! state-vector-sized array. for flavors 1 and 3 there is only a single value.
! also check for bad values (missing_r8s should not be found in the inflation files).
+! Only checking for missing_r8 for state space inflation.
if (inf_flavor > 0) then
- ! if my task owns the mean/sd, test for any missing_r8 and error out if found
- call get_copy_owner_index(ss_inflate_index, owner, owners_index)
- if (owner == ens_handle%my_pe) then
- if (any(ens_handle%vars(:, owners_index) == MISSING_R8)) then
- call error_handler(E_ERR, 'adaptive_inflate_init', 'illegal missing values found in inflation mean file', &
- source, revision, revdate)
+ if (mean_from_restart .and. inf_flavor > 1) then
+ ! if my task owns the mean/sd, test for any missing_r8 and error out if found
+ call get_copy_owner_index(ss_inflate_index, owner, owners_index)
+ if (owner == ens_handle%my_pe) then
+ if (any(ens_handle%vars(:, owners_index) == MISSING_R8)) then
+ call error_handler(E_ERR, 'adaptive_inflate_init', 'illegal missing values found in inflation mean file', &
+ source, revision, revdate)
+ endif
endif
endif
- call get_copy_owner_index(ss_inflate_sd_index, owner, owners_index)
- if (owner == ens_handle%my_pe) then
- if (any(ens_handle%vars(:, owners_index) == MISSING_R8)) then
- call error_handler(E_ERR, 'adaptive_inflate_init', 'illegal missing values found in inflation sd file', &
- source, revision, revdate)
+
+ if (sd_from_restart .and. inf_flavor > 1) then
+ call get_copy_owner_index(ss_inflate_sd_index, owner, owners_index)
+ if (owner == ens_handle%my_pe) then
+ if (any(ens_handle%vars(:, owners_index) == MISSING_R8)) then
+ call error_handler(E_ERR, 'adaptive_inflate_init', 'illegal missing values found in inflation sd file', &
+ source, revision, revdate)
+ endif
endif
endif
! task 0 knows the min and maxes and needs to print them for the log
@@ -436,16 +446,18 @@
! Flavor 1 is observation space, write its restart directly
else if(do_obs_inflate(inflate_handle)) then
! Open the restart file
- restart_unit = open_file(inflate_handle%out_file_name, &
+ if (my_task_id()==0) then
+ restart_unit = open_file(inflate_handle%out_file_name, &
form = 'formatted', action='write')
- write(restart_unit, *, iostat = io) inflate_handle%inflate, inflate_handle%sd
- if (io /= 0) then
- write(msgstring, *) 'unable to write into inflation restart file ', &
+ write(restart_unit, *, iostat = io) inflate_handle%inflate, inflate_handle%sd
+ if (io /= 0) then
+ write(msgstring, *) 'unable to write into inflation restart file ', &
trim(inflate_handle%out_file_name)
- call error_handler(E_ERR, 'adaptive_inflate_end', &
+ call error_handler(E_ERR, 'adaptive_inflate_end', &
msgstring, source, revision, revdate)
+ endif
+ call close_file(restart_unit)
endif
- call close_file(restart_unit)
endif
endif