[Dart-dev] DART/branches Revision: 11421

dart at ucar.edu dart at ucar.edu
Thu Mar 30 08:13:47 MDT 2017


mizzi at ucar.edu
2017-03-30 08:13:46 -0600 (Thu, 30 Mar 2017)
135
Updates to add the deepest member selection, make adjust_chem_emiss namelist controlled, and coordinate the real time driver scripts.




Modified: DART/branches/mizzi/models/wrf_chem/WRF_DART_utilities/dart_to_wrf.f90
===================================================================
--- DART/branches/mizzi/models/wrf_chem/WRF_DART_utilities/dart_to_wrf.f90	2017-03-30 00:09:43 UTC (rev 11420)
+++ DART/branches/mizzi/models/wrf_chem/WRF_DART_utilities/dart_to_wrf.f90	2017-03-30 14:13:46 UTC (rev 11421)
@@ -229,7 +229,7 @@
       endif
 !
 ! LXL/APM +++
-      ! read wrfinput or wrfchemi
+! determine where to place variable from the dart state vector (wrfinput, wrfchemi, or wrffirechemi)
       if ( ind .le. wrf%number_of_conv_variables ) then
          ncid_f = ncid
          if (debug) print*, ' read from wrfinput: ncid_f = ncid'
@@ -241,6 +241,9 @@
          wrf%number_of_emiss_chemi_variables ) then
          ncid_f = ncid_emiss_firechemi
          if (debug) print*, ' read from wrffirechemi: ncid_f = ncid_emiss_firechemi'
+      else
+         print *, 'APM: dart_to_wrf - ind index exceeds the number of wrf state variables'
+         stop
       endif
 
       ! get stagger and variable size
@@ -249,8 +252,11 @@
                      'inq_var_id ' // wrf_state_variables(1,my_index))
 ! LXL/APM ---
 !
+      print *, 'APM: var_size ',ind,wrf%var_size(3,ind)
+      print *, 'APM: variable ',ind,wrf_state_variables(1,my_index)
       if (  wrf%var_size(3,ind) == 1 ) then
-
+!
+! 1-D or 2-D field
          if ( debug ) then
             write(*,"(A,2(A,I5))") trim(my_field), ': 2D, size: ', wrf%var_size(1,ind), &
                                     ' by ', wrf%var_size(2,ind)
@@ -336,7 +342,8 @@
          deallocate(wrf_var_2d)
 
       else
-
+!
+! 3-D field
          if ( debug ) then
             write(*,"(A,3(A,I5))") trim(my_field), ': 3D, size: ', wrf%var_size(1,ind), &
                                     " by ", wrf%var_size(2, ind), " by ", wrf%var_size(3, ind)
@@ -426,9 +433,9 @@
 
       endif 
 
-      if (debug) write(*,"(A,I9)") trim(my_field)//': starts at offset into state vector: ', dart_ind
+      write(*,"(A,I9)") trim(my_field)//': starts at offset into state vector: ', dart_ind
       dart_ind = dart_ind + wrf%var_size(1,ind) * wrf%var_size(2,ind) * wrf%var_size(3,ind)
-      if (debug) write(*,"(A,I9)") trim(my_field)//': ends at offset into state vector:   ', dart_ind-1
+      write(*,"(A,I9)") trim(my_field)//': ends at offset into state vector:   ', dart_ind-1
  
    enddo
 

Added: DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_BAND_DEPTH/ComputeBandDepth.m
===================================================================
--- DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_BAND_DEPTH/ComputeBandDepth.m	                        (rev 0)
+++ DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_BAND_DEPTH/ComputeBandDepth.m	2017-03-30 14:13:46 UTC (rev 11421)
@@ -0,0 +1,51 @@
+function [ ] = ComputeBandDepth(isoval)
+%% This code will compute the band depth of an ensemble of iscontours (corresponding to a given isovalue)
+%% the filename is hard-coded, so this code will look for files starting with 'wrfout' in the given directory (dname)
+%% inputs: directory name
+%%         isovalue of interest
+%% output: the depth value for each ensemble member
+%%         the filename for the median
+
+EAll = []; % holds the ensemble
+
+%% read NetCDF files from a single directory given the number of files in that directory is exactly ENum
+dname='./';
+D = dir( fullfile(dname,'wrfout*') ); %dir(dname);
+d = {D.name};
+
+ENum = size(d, 2);
+
+for i=1:ENum
+    filename = d{i};
+    C = ncread([dname filename], 'co');
+    
+    %% isocontour extraction
+    I = find(C>isoval);
+    m = zeros(size(C));
+    m(I) = 1;
+    EAll = [EAll, m(:)];
+end
+
+%% M is pxn matrix n being the ensembles ize
+n = size(EAll,2);
+p = size(EAll,1);
+
+%% checking the band inclusion - this is n log n version of the combinatorial problem 
+[~, R] = sort(EAll,2);
+na = n - R;
+nb = R - 1;
+match = na.*nb;


More information about the Dart-dev mailing list