[Dart-dev] [6239] DART/branches/development/models/PBL_1d: Josh Hacker says the single column model in the standard WRF directory

nancy at ucar.edu nancy at ucar.edu
Tue Jun 11 08:18:33 MDT 2013


Revision: 6239
Author:   nancy
Date:     2013-06-11 08:18:31 -0600 (Tue, 11 Jun 2013)
Log Message:
-----------
Josh Hacker says the single column model in the standard WRF directory
is identical to this and is current and supported.  So we are removing
this model interface and leaving a pointer to the WRF model interface
and a pointer to the WRF/DART Wiki pages for help in setting up a 
single column configuration in WRF.

Added Paths:
-----------
    DART/branches/development/models/PBL_1d/README

Removed Paths:
-------------
    DART/branches/development/models/PBL_1d/create_real_network.f90
    DART/branches/development/models/PBL_1d/create_real_network.nml
    DART/branches/development/models/PBL_1d/gen_init/
    DART/branches/development/models/PBL_1d/indata/
    DART/branches/development/models/PBL_1d/model_mod.f90
    DART/branches/development/models/PBL_1d/model_mod.html
    DART/branches/development/models/PBL_1d/model_mod.nml
    DART/branches/development/models/PBL_1d/module_map_utils.f90
    DART/branches/development/models/PBL_1d/outdata/
    DART/branches/development/models/PBL_1d/src/
    DART/branches/development/models/PBL_1d/work/

-------------- next part --------------
Added: DART/branches/development/models/PBL_1d/README
===================================================================
--- DART/branches/development/models/PBL_1d/README	                        (rev 0)
+++ DART/branches/development/models/PBL_1d/README	2013-06-11 14:18:31 UTC (rev 6239)
@@ -0,0 +1,23 @@
+# DART software - Copyright 2004 - 2011 UCAR. This open source software is
+# provided by UCAR, "as is", without charge, subject to all terms of use at
+# http://www.image.ucar.edu/DAReS/DART/DART_download
+#
+# DART $Id$
+#
+
+The PBL_1D directory has been deprecated in favor of using the WRF/DART model
+interface.  There is now support for WRF single column mode built into the
+standard model_mod in that directory.
+
+There is a page on the DART-Dev (DART Developers) Wiki that describes how to
+alter both WRF and DART to work in single-column mode.   If you don't already
+have access to this Wiki, email dart at ucar dot edu and ask for access.  If
+you have access already, the Wiki page is here:
+
+https://wiki.ucar.edu/display/DARTdev/WRF+Single+Column+Model
+
+If you really want the files that used to be in this directory, check them
+out from the Kodiak release of DART.
+
+Contact dart at ucar dot edu for more information or questions.
+


Property changes on: DART/branches/development/models/PBL_1d/README
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author HeadURL Id
Added: svn:eol-style
   + native

Deleted: DART/branches/development/models/PBL_1d/create_real_network.f90
===================================================================
--- DART/branches/development/models/PBL_1d/create_real_network.f90	2013-06-10 23:06:39 UTC (rev 6238)
+++ DART/branches/development/models/PBL_1d/create_real_network.f90	2013-06-11 14:18:31 UTC (rev 6239)
@@ -1,376 +0,0 @@
-! 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
-! http://www.image.ucar.edu/DAReS/DART/DART_download
-!
-! $Id$
-
-program create_real_network_seq
-
-! JPH
-! This code originated from create_fixed_network.  It uses module_wrf to get
-! obs from smos file, with file, date, and interval controlled via the wrf1d
-! namelist.  Note that an obs_def is still required to control which
-! obs are actually written out.  Normally, this would be created with 
-! create_obs_sequence.  This would be run in place of both create_fixed_network
-! and perfect_model_obs.
-
-use        types_mod, only : r8, missing_r8, missing_i, metadatalength
-use    utilities_mod, only : finalize_utilities, register_module, open_file, &
-                             close_file, find_namelist_in_file, &
-                             error_handler, check_namelist_read, &
-                             initialize_utilities, E_ERR
-use     obs_kind_mod, only : assimilate_this_obs_kind, evaluate_this_obs_kind
-use      obs_def_mod, only : obs_def_type, get_obs_def_time, set_obs_def_time,&
-                             get_obs_kind, get_obs_name
-use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, &
-                             get_num_obs, init_obs_sequence, get_first_obs, &
-                             write_obs_seq, set_copy_meta_data, &
-                             get_obs_def, set_obs_def, append_obs_to_seq, &
-                             get_next_obs, insert_obs_in_seq, init_obs, &
-                             assignment(=), static_init_obs_sequence, &
-                             get_num_copies, get_num_qc, &
-                             get_copy_meta_data, get_qc_meta_data, &
-                             set_qc_meta_data, read_obs_seq_header, &
-                             set_obs_values, set_qc, get_qc
-use time_manager_mod, only : time_type, operator(*), operator(+), set_time, &
-                             set_date, increment_time, get_time, print_time, &
-                             operator(==), operator(/), operator(<), operator(-)
-use        model_mod, only : static_init_model, real_obs_period, start_real_obs
-use        module_wrf, only : static_init_wrf, init_wrf, nt_f_smos, &
-                              start_year_f, start_month_f,start_day_f, &
-                              start_hour_f, start_minute_f, &
-                              start_forecast, interval_smos, &
-                              init_f_type, u10_init_f, v10_init_f, &
-                              q2_init_f, t2_init_f, forecast_length
-
-
-implicit none
-
-! version controlled file description for error handling, do not edit
-character(len=256), parameter :: source   = &
-   "$URL$"
-character(len=32 ), parameter :: revision = "$Revision$"
-character(len=128), parameter :: revdate  = "$Date$"
-
-
-type(obs_sequence_type) :: seq, seq_in, seq_out
-type(obs_type)          :: obs, next_obs, new_obs
-type(obs_def_type)      :: obs_def
-character(len = 129)    :: file_name, obs_seq_in_file_name
-logical                 :: is_there_one, is_this_last
-type(time_type)         :: ob_time, init_time, this_time
-type(time_type)         :: obs_seq_period, obs_list_period
-type(time_type),dimension(:), allocatable :: obs_list_time
-type(time_type),dimension(:), allocatable :: obs_seq_time
-type(time_type)         :: start_seq_time, flen_time, end_time
-integer                 :: seconds, days, i, j, network_size,  num_times, num_copies, num_qc
-integer                 :: obs_seq_file_id, iunit, io
-integer                 :: cnum_copies, cnum_qc, cnum_obs, cnum_max
-integer                 :: additional_qc, additional_copies
-integer                 :: last_key_used, time_step_number
-integer                 :: num_obs, obs_kind_ind
-real(r8)                :: this_obs_val, this_qc_val
-real(r8), dimension(:), allocatable :: obs_vals, qc_vals, qc_sequence
-logical                 :: assimilate_this_ob, evaluate_this_ob, pre_I_format
-character(len=metadatalength) :: copy_meta_data(2), qc_meta_data, obs_seq_read_format
-integer                 :: wrf_rnd_seed = -1
-
-! Record the current time, date, etc. to the logfile
-call initialize_utilities('Create_real_network_seq')
-call register_module(source,revision,revdate)
-
-! The only necessary namelist variables come from the model
-
-! Call the underlying model's static initialization for calendar info
-call static_init_model()
-
-! Initialize the obs_sequence module
-call static_init_obs_sequence
-
-! fail if we are not initializing from OBS (this could be easily modified
-! to get values from WRF, and may come in handy later!
-if ( init_f_type == 'WRF' ) then
-  call error_handler(E_ERR, 'create_real_network', &
-     'CANNOT PRODUCE OBS SEQUENCE FROM WRF OUTPUT YET', source, revision, revdate)
-endif
-
-! Write the sequence to a file
-write(*, *) 'Input filename for network definition sequence (usually  set_def.out  )'
-read(*, *) file_name
-call read_obs_seq(file_name, 0, 0, 0, seq_in)
-
-! Find out how many obs there are
-network_size = get_num_obs(seq_in)
-
-! Initialize the obs_type variables
-num_copies = get_num_copies(seq_in)
-num_qc = get_num_qc(seq_in)
-call init_obs(obs, num_copies, num_qc)
-call init_obs(next_obs, num_copies, num_qc)
-call init_obs(new_obs, num_copies, num_qc)
-
-! set init time and period, including increment for forecast start and
-! increment to the proper time of day.  One might want to start the assimilation
-! later then when constrained to start the obs list.
-   init_time = set_date(start_year_f, start_month_f, start_day_f, &
-                        start_hour_f, start_minute_f, 0)
-   init_time = increment_time(init_time,start_forecast,0)
-   flen_time = set_time(forecast_length,0) 
-   end_time  = init_time + flen_time
-
-   call get_time(init_time,seconds,days)
-
-   start_seq_time = increment_time(init_time,start_real_obs,0)
-   obs_seq_period = set_time(real_obs_period, 0)
-   obs_list_period = set_time(interval_smos, 0)
-
-   num_times = (end_time - start_seq_time) / set_time(real_obs_period,0) + 1
-
-   ! time information comes from the wrf1d_namelist.input
-   ! only supports regularly-repeating obs right now
-   allocate(obs_seq_time(num_times))
-   allocate(obs_list_time(nt_f_smos))
-
-   ! associate a time with each obs in the input list
-   do j = 1, nt_f_smos
-      obs_list_time(j) = init_time + (j - 1) * obs_list_period
-   enddo
-
-   ! Initialize the output sequence
-   call init_obs_sequence(seq, num_copies, &
-      num_qc, network_size * num_times)
-
-   ! Get the metadata (might want a call in obs_sequence to do this)
-   do i = 1, num_copies
-      call set_copy_meta_data(seq, i, get_copy_meta_data(seq_in, i))
-   end do
-   do i = 1, num_qc
-      call set_qc_meta_data(seq, i, get_qc_meta_data(seq_in, i))
-   end do
-
-   ! while looping through the times, generate a list of obs times
-   ! and qc values
-   do j = 1, num_times
-      write(*, *) j
-      ob_time = start_seq_time + (j - 1) * obs_seq_period
-      obs_seq_time(j) = ob_time
-      call print_time(obs_seq_time(j))
-
-      is_there_one = get_first_obs(seq_in, obs)
-
-      do i = 1, network_size
-         new_obs = obs
-         ! Set the time
-         call get_obs_def(new_obs, obs_def)
-         call set_obs_def_time(obs_def, ob_time) 
-         call set_obs_def(new_obs, obs_def)
-
-         ! Append it to the sequence
-         call append_obs_to_seq(seq, new_obs)
-
-         ! Find the next observation in the input set
-         call get_next_obs(seq_in, obs, next_obs, is_this_last)
-         if(.not. is_this_last) obs = next_obs
-      end do
-
-   enddo
-
-!-------------------------------------------------------------------------
-! write to a temporary file for ingestion into the next block
-file_name = 'real_obs_seq.in'
-
-call write_obs_seq(seq, file_name)
-
-!-------------------------------------------------------------------------
-! Now the part that replaces perfect_model_obs.  There are some 
-! assumptions in here about what type of obs we are ingesting:
-! 1.  pressure and vapor pressure are used to get mixing ratio
-! 2.  T and winds are in correct units (K and m/s)
-
-call init_wrf(wrf_rnd_seed)
-
-!do i = 1,num_times
-!  print*,t2_init_f(i),u10_init_f(i),v10_init_f(i),q2_init_f(i)
-!enddo
-
-obs_seq_in_file_name = file_name
-
-call read_obs_seq_header(obs_seq_in_file_name, cnum_copies, cnum_qc, &
-                         cnum_obs, cnum_max, obs_seq_file_id, &
-                         obs_seq_read_format, pre_I_format, &
-                         close_the_file = .true.)
-
-! First two copies of output will be truth and observation;
-! Will overwrite first two existing copies in file if there are any
-! Note that truth=obs for this case of real obs
-additional_copies = 2 - cnum_copies
-if(additional_copies < 0) additional_copies = 0
-
-! currently no need for additional qc field
-additional_qc = 0
-
-! Just read in the definition part of the obs sequence; expand to include
-! observation and truth field
-call read_obs_seq(obs_seq_in_file_name, additional_copies, additional_qc, &
-                  0, seq)
-
-! Initialize an obs type variable
-call init_obs(obs, cnum_copies + additional_copies, cnum_qc + additional_qc)
-
-! Need metadata for added qc field (here in case needed later)
-if(additional_qc == 1) then
-   qc_meta_data = 'Quality Control'
-   call set_qc_meta_data(seq, 1, qc_meta_data)
-endif
-
-time_step_number = 0
-num_qc = get_num_qc(seq)
-num_copies = get_num_copies(seq)
-num_obs = get_num_obs(seq)
-
-! init output obs sequence
-call init_obs_sequence(seq_out, num_copies, num_qc, num_obs)
-call init_obs(obs, num_copies, num_qc)
-call init_obs(next_obs, num_copies, num_qc)
-call init_obs(new_obs, num_copies, num_qc)
-
-! Need space to put in the obs_values in the sequence;
-copy_meta_data(1) = 'observations'
-copy_meta_data(2) = 'truth'
-call set_copy_meta_data(seq_out, 1, copy_meta_data(1))
-call set_copy_meta_data(seq_out, 2, copy_meta_data(2))
-do i = 1, num_qc
-  call set_qc_meta_data(seq_out, i, get_qc_meta_data(seq, i))
-end do
-
-! simply look through obs one-by-one and pull from the proper vector
-allocate(obs_vals(num_copies), qc_vals(num_qc))
-allocate(qc_sequence(num_obs))
-
-is_there_one = get_first_obs(seq, obs)
-if ( is_there_one ) then
-   do i = 1, num_obs
-     new_obs = obs
-
-     ! Set the time
-     call get_obs_def(new_obs, obs_def)
-     ob_time = get_obs_def_time(obs_def)
-     obs_kind_ind = get_obs_kind(obs_def)
-     assimilate_this_ob = assimilate_this_obs_kind(obs_kind_ind)
-     evaluate_this_ob = evaluate_this_obs_kind(obs_kind_ind)
-
-     this_obs_val = get_obs_from_input(ob_time,obs_kind_ind,num_times)
-     this_qc_val  = get_qc_from_obs(obs_kind_ind,this_obs_val)
-     if ( num_qc > 0 ) then
-       call get_qc(new_obs,qc_sequence(i:i),1)
-       this_qc_val = max(this_qc_val,qc_sequence(i))
-     endif
-
-     ! for input, all copies are the same
-     obs_vals = this_obs_val
-     call set_obs_values(new_obs,obs_vals)
-     qc_vals = this_qc_val
-
-     if ( num_qc > 0 ) then
-       call set_qc(new_obs,qc_vals)
-     endif
-       
-     call set_obs_def(new_obs, obs_def)
-
-     ! Append it to the sequence
-     call append_obs_to_seq(seq_out, new_obs)
-
-     ! Find the next observation in the input set
-     call get_next_obs(seq, obs, next_obs, is_this_last)
-     if(.not. is_this_last) obs = next_obs
-  
-   end do ! obs
-
-   file_name = 'real_obs_seq.out'
-
-   call write_obs_seq(seq_out, file_name)
-
-else 
-
-   print*, "could not find any obs in the input sequence"
-
-endif
-
-call error_handler(E_MSG, 'create_real_network', 'Finished successfully.',
-                   source,revision,revdate)
-call finalize_utilities()
-
-
-!--------------------------------------------------------------
-CONTAINS
-!--------------------------------------------------------------
-
-
-real(r8) function get_obs_from_input(ob_time,obs_kind_in,num_times)
-
-implicit none
-
-type(time_type), intent(in)      :: ob_time
-integer, intent(in)              :: obs_kind_in, num_times
-
-integer                          :: seconds, days, i
-integer                          :: this_time_ind
-real(r8)                         :: obs_val
-
-get_obs_from_input = missing_r8
-
-this_time_ind = missing_i
-do i = 1, nt_f_smos
-  if ( obs_list_time(i) == ob_time ) this_time_ind = i
-enddo
-
-if ( this_time_ind == missing_i ) return
-
-select case ( trim(get_obs_name(obs_kind_in)) )
-  case ('METAR_U_10_METER_WIND')
-    obs_val = u10_init_f(this_time_ind)
-  case ('METAR_V_10_METER_WIND')
-    obs_val = v10_init_f(this_time_ind)
-  case ('METAR_TEMPERATURE_2_METER')
-    obs_val = t2_init_f(this_time_ind)
-  case ('METAR_SPECIFIC_HUMIDITY_2_METER')
-    obs_val = q2_init_f(this_time_ind)
-  case default
-    return
-end select
-
-get_obs_from_input = obs_val
-
-end function get_obs_from_input
-
-!--------------------------------------------------------------
-
-real(r8) function get_qc_from_obs(obs_kind_in,obs_val)
-! simple gross error check on qc
-
-implicit none
-
-integer, intent(in)              :: obs_kind_in
-real(r8), intent(in)             :: obs_val
-
-get_qc_from_obs = 0.0_r8
-if ( obs_val == missing_r8 ) then
-  get_qc_from_obs = 9.0_r8
-  return
-end if
-
-! no real qc yet
-select case ( trim(get_obs_name(obs_kind_in)) )
-  case default
-    return
-end select
-
-end function get_qc_from_obs
-
-end program create_real_network_seq
-
-! <next few lines under version control, do not edit>
-! $URL$
-! $Id$
-! $Revision$
-! $Date$

Deleted: DART/branches/development/models/PBL_1d/create_real_network.nml
===================================================================
--- DART/branches/development/models/PBL_1d/create_real_network.nml	2013-06-10 23:06:39 UTC (rev 6238)
+++ DART/branches/development/models/PBL_1d/create_real_network.nml	2013-06-11 14:18:31 UTC (rev 6239)
@@ -1,4 +0,0 @@
-&create_real_network
-  seconds_start = 43200
-  obs_period = 3600   /
-  

Deleted: DART/branches/development/models/PBL_1d/model_mod.f90
===================================================================
--- DART/branches/development/models/PBL_1d/model_mod.f90	2013-06-10 23:06:39 UTC (rev 6238)
+++ DART/branches/development/models/PBL_1d/model_mod.f90	2013-06-11 14:18:31 UTC (rev 6239)
@@ -1,3719 +0,0 @@
-! 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
-! http://www.image.ucar.edu/DAReS/DART/DART_download
-!
-! $Id$
-
-module model_mod
-
-use        types_mod, only : r8, missing_r8
-use time_manager_mod, only : time_type, set_time, get_time, &
-                             increment_time, print_time, set_date, &
-                             get_date, julian_day, &
-                             set_calendar_type, GREGORIAN, &
-                             operator(==), operator(<=), &
-                             operator(-), operator(+)
-use     location_mod, only : location_type, get_dist, set_location, &
-                             get_location, query_location, &
-                             LocationDims, LocationName, LocationLName, &
-                             vert_is_surface, vert_is_pressure, &
-                             vert_is_level, vert_is_height, &
-                             get_close_maxdist_init, get_close_obs_init, get_close_obs
-
-use    utilities_mod, only : file_exist, open_file, close_file, &
-                             find_namelist_in_file, check_namelist_read, &
-                             register_module, error_handler, E_ERR, E_MSG, &
-                             nmlfileunit, do_nml_file, do_nml_term
-use         sort_mod, only : sort   
-use   random_seq_mod, only : random_seq_type, random_gaussian, &
-                             init_random_seq, random_uniform
-use     obs_kind_mod, only : KIND_U_WIND_COMPONENT, &
-                             KIND_V_WIND_COMPONENT, &
-                             KIND_SURFACE_PRESSURE, &
-                             KIND_TEMPERATURE, &
-                             KIND_SPECIFIC_HUMIDITY
-!use        map_utils, only : proj_info, map_init, map_set, latlon_to_ij, &
-!                             PROJ_LATLON, PROJ_MERC, PROJ_LC, PROJ_PS, &
-!                             gridwind_to_truewind
-
-!---- WRF modules
-use module_model_constants
-use module_initialize
-use module_namelist
-use module_wrf
-
-!use            netcdf
-
-implicit none
-private
-
-public :: get_model_size, &
-          adv_1step, &
-          get_state_meta_data, &
-          model_interpolate, &
-          get_model_time_step, &
-          end_model, &
-          static_init_model, &
-          init_time, &
-          init_conditions, &
-          model_get_close_states, &
-          nc_write_model_atts, &
-          nc_write_model_vars, &
-          nc_read_model_vars, &
-          pert_model_state, &
-          get_pblh, &
-          pert_params_time, &
-          adjust_param_spread, &
-          real_obs_period, &
-          start_real_obs, &
-          synchronize_mavail, &
-          ok_to_nudge, &
-          get_close_maxdist_init, get_close_obs_init, get_close_obs, ens_mean_for_model
-
-
-! version controlled file description for error handling, do not edit
-character(len=256), parameter :: source   = &
-   "$URL$"
-character(len=32 ), parameter :: revision = "$Revision$"
-character(len=128), parameter :: revdate  = "$Date$"
-
-! Basic model parameters controlled by namelist
-
-integer                :: num_est_params  = 0
-integer, dimension(10) :: est_param_types = 600
-real   , dimension(10) :: pert_init_sd    = 0.0
-real   , dimension(10) :: pert_param_sd   = 0.0
-integer, dimension(10) :: pert_init_beta_1 = -1
-integer, dimension(10) :: pert_init_beta_2 = -1
-real   , dimension(10) :: pert_param_min  = 0.00001
-real   , dimension(10) :: pert_param_max  = 0.99999
-logical                :: maintain_initial_spread = .false.
-logical                :: increment_psfc = .false. 
-logical                :: increment_tsk = .false. 
-logical                :: increment_smois = .false. 
-logical                :: increment_sh2o  = .false. 
-logical                :: increment_tslb  = .true. 
-character(len=4), dimension(10) :: dist_shape = 'logn'
-
-integer                :: real_obs_period, start_real_obs
-
-namelist /model_nml/ num_est_params, est_param_types, pert_param_sd, &
-         pert_init_sd, pert_init_beta_1, pert_init_beta_2, &
-         maintain_initial_spread, dist_shape, pert_param_min, &
-         pert_param_max, real_obs_period, start_real_obs, &
-         increment_smois, increment_sh2o, increment_tslb, &
-         increment_tsk, increment_psfc
-
-! Define the location of the state variables in module storage
-type(location_type), allocatable :: state_loc(:)
-type(time_type) :: time_step, initialization_time
-
-! Private definition of model variable types
-
-integer, parameter :: TYPE_U   = 1,   TYPE_V   = 2,  TYPE_W  = 3,  &
-                      TYPE_GZ  = 4,   TYPE_T   = 5,  TYPE_MU = 6,  &
-                      TYPE_QV  = 7,   TYPE_U10 = 8,  TYPE_V10 = 9,  &
-                      TYPE_T2 = 10,   TYPE_Q2  = 11,  TYPE_PSFC= 12,  &
-                      TYPE_TSK = 13, TYPE_TH = 14,   TYPE_TKE = 15 , &
-                      TYPE_P   = 16
-
-! whether these are included is determined from the model_nml
-integer, parameter :: TYPE_SMOIS = 50, TYPE_SH2O = 51, TYPE_TSLB = 52
-
-! additional "far away" types that will not be part of the assimilation
-! GROUP THESE BY SHAPE OF ARRAYS!  this will make life easier below
-integer, parameter :: TYPE_GSWF  = 100,    TYPE_GLWF = 101, & !1D       
-                      TYPE_PRECIPF = 102
-
-integer, parameter :: TYPE_CBH = 110, TYPE_LWP = 111,       & !1D stochastic
-                      TYPE_YN = 112
-
-integer, parameter :: TYPE_UF = 120,       TYPE_VF = 121, &   !2D...
-                      TYPE_PF = 122,       TYPE_P8WF = 123
-
-integer, parameter :: TYPE_TH_UPSTREAM_X = 130, TYPE_TH_UPSTREAM_Y = 131, &
-                      TYPE_QV_UPSTREAM_X = 132, TYPE_QV_UPSTREAM_Y = 133, &
-                      TYPE_U_UPSTREAM_X = 134,  TYPE_U_UPSTREAM_Y = 135,  &
-                      TYPE_V_UPSTREAM_X = 136,  TYPE_V_UPSTREAM_Y = 137,  &
-                      TYPE_TAU_U = 138,         TYPE_TAU_V = 139, &
-                      TYPE_QC_UPSTREAM_X = 140, TYPE_QC_UPSTREAM_Y = 141, &
-                      TYPE_QR_UPSTREAM_X = 142, TYPE_QR_UPSTREAM_Y = 143, &
-                      TYPE_QI_UPSTREAM_X = 144, TYPE_QI_UPSTREAM_Y = 145, &
-                      TYPE_QG_UPSTREAM_X = 146, TYPE_QG_UPSTREAM_Y = 147
-! don't add any more here without dealing with optional moisture vars
-
-! far away types that we may want to add to the state vector at some
-! point
-integer, parameter :: TYPE_KEEPFR3DFLAG = 200, TYPE_SMFR3D = 201
-
-integer, parameter :: TYPE_UZ0 = 300,        TYPE_VZ0 = 301, &   !scalars
-                      TYPE_THZ0 = 302,       TYPE_QZ0 = 303, &
-                      TYPE_QVG  = 304,       TYPE_QSG = 305, &
-                      TYPE_QCG  = 306,       TYPE_QSFC = 307, &
-                      TYPE_AKMS = 308,       TYPE_AKHS = 309, &
-                      TYPE_HOL = 310,        TYPE_MOL = 311, &
-                      TYPE_GSW = 312,        TYPE_GLW = 313, &
-                      TYPE_GRDFLX = 314,     TYPE_HFX = 315, &
-                      TYPE_QFX = 316,        TYPE_PSHLTR = 317, &
-                      TYPE_QSHLTR = 318,     TYPE_FLHC = 319, &
-                      TYPE_FLQC = 320,       TYPE_Q10 = 321, &
-                      TYPE_UDRUNOFF = 322,   TYPE_ACSNOM = 323, &
-                      TYPE_ACSNOW = 324,     TYPE_UST = 325, &
-                      TYPE_PBLH = 326,       TYPE_TMN = 327, &
-                      TYPE_CS = 328,         TYPE_ERATE = 329, &
-                      TYPE_MAXM = 330,       TYPE_MINM = 331
-integer, parameter :: TYPE_RMOL = 332,       TYPE_ZNT = 333, &
-                      TYPE_GAMMA = 334,      TYPE_RAINNC = 335, &
-                      TYPE_RAINNCV = 336
-
-! parameter section - first some strange ones
-integer, parameter :: TYPE_VEGFRA = 400
-
-! far away profiles may or may not be part of the external forcing - perhaps
-! diagnostic (U_G and V_G are only for output - redundant)
-integer, parameter :: TYPE_RHO = 500, TYPE_U_G  = 501, &
-                      TYPE_V_G  = 502, TYPE_EL = 503, &
-                      TYPE_QC  = 504,  TYPE_QR = 505, &
-                      TYPE_QI = 506,   TYPE_QG = 507
-! don't add any more here without dealing with optional moisture vars
-
-! optional soil forcing
-integer, parameter :: TYPE_TSLB_F = 550, TYPE_SMOIS_F = 551
-
-! parameter section - some out of state (constant) and are far away
-! others are in-state and will be assigned a true location
-integer, parameter ::  TYPE_EMISS = 600, TYPE_ALBEDO = 601, &
-                       TYPE_Z0    = 602, TYPE_THC    = 603, &
-                       TYPE_MAVAIL= 604, TYPE_TADV_SCALE   = 605, &
-                       TYPE_QADV_SCALE = 606, TYPE_UADV_SCALE = 607, &
-                       TYPE_VADV_SCALE = 608
-
-integer, parameter :: calendar_type = GREGORIAN
-integer            :: internal_ensemble_counter = 0
-integer            :: number_ensemble_members = 0
-
-! these are parameters that will be stuffed in the the meta data type
-! soil variables in state vector to dart
-integer, parameter  ::   number_of_soil_variables = 0 
-                         ! (none right now, all optioal)
-integer, parameter  ::   number_of_optional_soil_variables = 3 
-                         ! (SMOIS, SH2O, TSLB)
-! the usual profile variables in state to dart
-integer, parameter  ::   number_of_profile_variables =     8 
-                         ! (U, V, Z, T, QV, TH, TKE,P)
-! screen height vars in state vector to dart
-integer, parameter  ::   number_of_scalars =               6      
-                         ! (U10, V10, T2, Q2, TSK, PSFC) 
-! external forcing
-integer, parameter  ::   number_of_1d_f =                3
-                         ! (GSWF, GLWF, PRECIPF)
-integer, parameter  ::   number_of_soil_f =                2
-                         ! (SMOIS_F, TSLB_F)
-integer, parameter  ::   number_of_1d_stochastic_f =     3 ! added ...RT
-                         ! (YN, CBH, LWP)
-integer, parameter  ::   number_of_2d_f =               4 
-                         !(UF, VF, PF, P8WF
-integer, parameter  ::   number_of_2d_advection =        10
-                         ! TH_UPSTREAM_X, TH_UPSTREAM_Y
-                         ! QV_UPSTREAM_X, QV_UPSTREAM_Y
-                         ! U_UPSTREAM_X, U_UPSTREAM_Y
-                         ! V_UPSTREAM_X, V_UPSTREAM_Y
-                         ! TAU_U, TAU_V
-          !optionally    ! QC_UPSTREAM_X, QC_UPSTREAM_Y
-                         ! QR_UPSTREAM_X, QR_UPSTREAM_Y
-                         ! QI_UPSTREAM_X, QI_UPSTREAM_Y
-                         ! QG_UPSTREAM_X, QG_UPSTREAM_Y
-
-! profile variables NOT in state vector to dart
-integer, parameter  ::   number_noassim_profiles =         4
-                         ! RHO, U_G, V_G, EL, 
-                         ! QC, QR, QI, QG depend on WRF namelist
-                         ! and are added in-line
-! soil variables NOT in state vector to dart
-integer, parameter  ::   number_noassim_soil_vars =        2 
-                         ! (KEEPFR3DFLAG, SMFR3D)
-! scalars NOT in state vector to dart
-integer, parameter  ::   number_noassim_scalars = 37 
-                         ! (UZ0, VZ0, THZ0, QZ0, 
-                         !  QVG, QSG, QCG, QSFC, 
-                         ! AKMS, AKHS, HOL, MOL, 
-                         ! GSW, GLW,              ! added...RT
-                         ! GRDFLX, HFX, QFX, 
-                         ! PSHLTR, QSHLTR, 
-                         ! FLQC, FLHC, Q10, UDRUNOFF, 
-                         ! ACSNOM, ACSNOW, UST, PBLH, TMN,
-                         ! RMOL, ZNT, GAMMA, RAINNC, RAINNCV)
-
-! parameters that depend on initialization date
-integer, parameter  ::   number_dependent_params = 1
-                         ! (VEGFRA)
-! parameters that are independent, and MAY be in the state
-integer, parameter  ::   number_total_params = 9
-                         ! (EMISS, ALBEDO, Z0, THC, MAVAIL)
-
-TYPE state_vector_meta_data
-! additional necessary vars
-   integer             ::   model_size
-   integer             ::   total_number_of_vars
-! soil variables in state vector to dart
-   integer             ::   number_of_soil_variables   
-! soil variables maybe in state vector to dart
-   integer             ::   number_of_optional_soil_variables   
-! the usual profile variables in state to dart
-   integer             ::   number_of_profile_variables
-! screen height vars in state vector to dart
-   integer             ::   number_of_scalars         
-! external forcing
-   integer             ::   number_of_1d_f 
-   integer             ::   number_of_soil_f 
-   integer             ::   number_of_1d_stochastic_f !added...RT 
-   integer             ::   number_of_2d_f 
-   integer             ::   number_of_2d_advection 
-! profile variables NOT in state vector to dart
-   integer             ::   number_noassim_profiles
-! soil variables NOT in state vector to dart
-   integer             ::   number_noassim_soil_vars   
-! scalars NOT in state vector to dart
-   integer             ::   number_noassim_scalars
-! parameters that depend on initialization date
-   integer             ::   number_dependent_params
-! parameters that are independent, and are not in the state
-   integer             ::   number_independent_params
-! parameters in the state, will be estimated
-   integer             ::   number_state_params
-
-! list of parameter types and properties to estimate
-   integer,    dimension(:), pointer :: est_param_types
-   real(r8),   dimension(:), pointer :: pert_init_sd
-   real(r8),   dimension(:), pointer :: pert_param_sd
-   real(r8),   dimension(:), pointer :: pert_param_min
-   integer,    dimension(:), pointer :: pert_init_beta_1
-   integer,    dimension(:), pointer :: pert_init_beta_2
-   real(r8),   dimension(:), pointer :: pert_param_max
-   character(len=4),dimension(:), pointer :: dist_shape
-
-   integer, dimension(:), pointer :: var_type
-   integer, dimension(:), pointer :: var_size
-   integer, dimension(:), pointer :: var_index
-end TYPE state_vector_meta_data
-
-TYPE domain_static_data
-   real(r8) :: latitude, longitude
-end TYPE domain_static_data
-
-type(state_vector_meta_data)    :: wrf_meta
-
-!type(proj_info)                 :: my_projection
-
-type(domain_static_data)        :: column
-
-! A flag for allocation, starts as true then goes to false with first
-! call to init_wrf, which occurs in init_conditions.
-
-integer                         :: wrf_rnd_seed
-logical                         :: allocate_wrf = .true.
-
-! random sequence for the parameter estimates
-type (random_seq_type)          :: param_ran_seq
-type (random_seq_type)          :: pert_ran_seq
-
-contains
-
-!==================================================================
-
-
-subroutine static_init_model()
-!------------------------------------------------------------------
-! Initializes class data for this model. For now, simply outputs the
-! identity info, sets the location of the state variables, and initializes
-! the time type for the time stepping (is this general enough for time???)
-implicit none
-
-integer  :: io, iunit, k_adv
-real(r8) :: x_loc
-integer :: dart_index, var_cnt, k, bot, top, unit_nml, vcnt !, projcode
-LOGICAL :: is_it_there = .FALSE.
-REAL :: timeo,timetot
-    
-!real(r8) :: center_i, center_j, truelat1, truelat2
-!real(r8) :: sw_corner_lat, sw_corner_lon, dx, stdlon
-real(r8) :: long_far
-
-integer :: nbtimestep ! ...RT: for stochastic cloud forcing assumed available @ every time step
-
-! Print module information to log file and stdout.
-call register_module(source, revision, revdate)
-
-! Read the namelist entry
-call find_namelist_in_file("input.nml", "model_nml", iunit)
-read(iunit, nml = model_nml, iostat = io)
-call check_namelist_read(iunit, io, "model_nml")
-
-! Record the namelist values used for the run ...
-call error_handler(E_MSG,'static_init_model','model_nml values are',' ',' ',' ')
-if (do_nml_file()) write(nmlfileunit, nml=model_nml)
-if (do_nml_term()) write(     *     , nml=model_nml)
-
-! Begin by reading the namelist input
-if(file_exist('wrf1d_namelist.input')) then
-   unit_nml = open_file(fname = 'wrf1d_namelist.input', action = 'read')
-   call do_namelist_wrf1d(unit_nml,nmlfileunit)
-   close(unit_nml)
-endif
-
-! initialize the random sequences
-wrf_rnd_seed = rnd_seed_val
-call init_random_seq(param_ran_seq)
-call init_random_seq(pert_ran_seq)
-
-! need some dimension information
-call static_init_wrf(allocate_wrf)
-allocate_wrf = .false.
-
-! initialize some timing stuff
-time_step = set_time(int(dt), 0)
-call set_calendar_type(calendar_type)
-call init_time(initialization_time)
-
-! numbers
-wrf_meta%number_of_scalars = number_of_scalars
-wrf_meta%number_of_profile_variables = number_of_profile_variables
-wrf_meta%number_of_soil_variables = number_of_soil_variables
-wrf_meta%number_of_optional_soil_variables = number_of_optional_soil_variables
-wrf_meta%number_of_1d_f =  0
-wrf_meta%number_of_soil_f =  0
-wrf_meta%number_of_1d_stochastic_f = number_of_1d_stochastic_f 
-wrf_meta%number_of_2d_f = 0
-wrf_meta%number_of_2d_advection = 0
-wrf_meta%number_noassim_profiles = number_noassim_profiles
-wrf_meta%number_noassim_soil_vars = number_noassim_soil_vars
-wrf_meta%number_noassim_scalars = number_noassim_scalars
-wrf_meta%number_dependent_params = number_dependent_params
-wrf_meta%number_state_params = num_est_params !from namelist
-
-if ( init_f .eqv. .true. ) then
-   wrf_meta%number_of_1d_f = number_of_1d_f
-   wrf_meta%number_of_2d_f = number_of_2d_f
-   wrf_meta%number_of_2d_advection = number_of_2d_advection
-endif
-
-if ( force_soil .eqv. .true. ) then
-   wrf_meta%number_of_soil_f = number_of_soil_f
-endif
-
-! add moisture variables as needed
-if ( P_QC > 1 ) then
-   wrf_meta%number_noassim_profiles = wrf_meta%number_noassim_profiles + 1
-   if ( qc_advection .eqv. .true. ) then
-     wrf_meta%number_of_2d_advection = wrf_meta%number_of_2d_advection + 2
-   endif
-endif
-if ( P_QR > 1 ) then
-   wrf_meta%number_noassim_profiles = wrf_meta%number_noassim_profiles + 1
-   if ( qr_advection .eqv. .true. ) then
-     wrf_meta%number_of_2d_advection = wrf_meta%number_of_2d_advection + 2
-   endif
-endif
-if ( P_QI > 1 ) then
-   wrf_meta%number_noassim_profiles = wrf_meta%number_noassim_profiles + 1
-   if ( qi_advection .eqv. .true. ) then
-     wrf_meta%number_of_2d_advection = wrf_meta%number_of_2d_advection + 2
-   endif
-endif
-if ( P_QG > 1 ) then
-   wrf_meta%number_noassim_profiles = wrf_meta%number_noassim_profiles + 1
-   if ( qg_advection .eqv. .true. ) then
-     wrf_meta%number_of_2d_advection = wrf_meta%number_of_2d_advection + 2
-   endif
-endif
-
-! these are not appended or retained in memory because they are constant
-wrf_meta%number_independent_params = number_total_params - num_est_params 
-                                         
-nbtimestep = int(forecast_length/dt) !...added by RT
-
-! compute the model size
-wrf_meta%model_size = num_soil_layers * wrf_meta%number_of_soil_variables    &
-                    + num_soil_layers *                                      &
-                      wrf_meta%number_of_optional_soil_variables             &
-                    + nz              * wrf_meta%number_of_profile_variables &
-                    + 1               * wrf_meta%number_of_scalars           &
-                    + nz*nsplinetimes * wrf_meta%number_of_2d_f              &
-                    + nz*nsplinetimes_advection *                            &
-                         wrf_meta%number_of_2d_advection                     &
-                    + nz              * wrf_meta%number_noassim_profiles     &
-                    + num_soil_layers * wrf_meta%number_noassim_soil_vars    &
-                    + 1               * wrf_meta%number_noassim_scalars      &
-                    + 1               * wrf_meta%number_dependent_params     &
-                    + 1               * wrf_meta%number_state_params         
-
-! need space for 1D forcing (GLW_F GSW_F PRECIPF)
-if ( init_f .eqv. .true.) wrf_meta%model_size = wrf_meta%model_size + n1dsplines
-! need space for soil forcing (SMOIS_F, TSLB_F) if asked
-if ( force_soil .eqv. .true. ) wrf_meta%model_size = wrf_meta%model_size +  & 
-             wrf_meta%number_of_soil_f*nsplinetimes_soil*num_soil_layers
-
-! need space for cloud info if using
-if ( forc_stochastic_cloud ) wrf_meta%model_size = wrf_meta%model_size       &
-                        + nbtimestep * number_of_1d_stochastic_f            
-
-! state vector locations and wrf grid meta data
-wrf_meta%total_number_of_vars = wrf_meta%number_of_scalars &
-                              + wrf_meta%number_of_profile_variables &
-                              + wrf_meta%number_of_soil_variables &
-                              + wrf_meta%number_of_optional_soil_variables &
-                              + wrf_meta%number_of_1d_f &
-                              + wrf_meta%number_of_soil_f &
-                              + wrf_meta%number_of_2d_f &
-                              + wrf_meta%number_of_2d_advection &
-                              + wrf_meta%number_noassim_profiles &
-                              + wrf_meta%number_noassim_soil_vars &
-                              + wrf_meta%number_noassim_scalars &
-                              + wrf_meta%number_dependent_params &
-                              + wrf_meta%number_state_params
-
-if ( forc_stochastic_cloud ) wrf_meta%total_number_of_vars = &
-   wrf_meta%total_number_of_vars  + wrf_meta%number_of_1d_stochastic_f 
-
-allocate(wrf_meta%est_param_types(wrf_meta%number_state_params))
-allocate(wrf_meta%pert_init_sd(wrf_meta%number_state_params))
-allocate(wrf_meta%pert_param_sd(wrf_meta%number_state_params))
-allocate(wrf_meta%pert_init_beta_1(wrf_meta%number_state_params))
-allocate(wrf_meta%pert_init_beta_2(wrf_meta%number_state_params))
-allocate(wrf_meta%pert_param_min(wrf_meta%number_state_params))
-allocate(wrf_meta%pert_param_max(wrf_meta%number_state_params))
-allocate(wrf_meta%dist_shape(wrf_meta%number_state_params))
-
-allocate(wrf_meta%var_type(wrf_meta%total_number_of_vars))
-allocate(wrf_meta%var_size(wrf_meta%total_number_of_vars))
-allocate(wrf_meta%var_index(wrf_meta%total_number_of_vars))
-allocate(state_loc(wrf_meta%model_size))
-
-! fill the parameter estimation types (no error checking)
-do i = 1, wrf_meta%number_state_params
-  wrf_meta%est_param_types(i) = est_param_types(i)
-  wrf_meta%pert_init_sd(i) = pert_init_sd(i)
-  wrf_meta%pert_init_beta_1(i) = pert_init_beta_1(i)
-  wrf_meta%pert_init_beta_2(i) = pert_init_beta_2(i)
-  wrf_meta%pert_param_sd(i) = pert_param_sd(i)
-  wrf_meta%pert_param_min(i) = pert_param_min(i)
-  wrf_meta%pert_param_max(i) = pert_param_max(i)
-  wrf_meta%dist_shape(i) = dist_shape(i)
-enddo
-
-! domain info - change lon to [0,360] for DART compliance
-if ( lon_ref < 0.0_r8 ) lon_ref = lon_ref + 360.0_r8
-column%longitude = lon_ref
-column%latitude  = lat_ref
-long_far = lon_ref+180.0_r8
-if ( long_far > 360.0_r8 ) long_far = long_far - 360.0_r8
-
-! fill locations for state variables
-dart_index = 1
-var_cnt    = 1
-
-wrf_meta%var_type(var_cnt) = TYPE_U
-wrf_meta%var_size(var_cnt) = nz
-wrf_meta%var_index(var_cnt) = dart_index
-bot = wrf_meta%var_index(var_cnt)
-top = wrf_meta%var_index(var_cnt) + wrf_meta%var_size(var_cnt) - 1
-do k = bot,top
-  state_loc(k) = set_location(column%longitude,column%latitude,z_grid(k - bot + 1),3)
-enddo
-dart_index = dart_index + wrf_meta%var_size(var_cnt)
-var_cnt = var_cnt + 1
-
-wrf_meta%var_type(var_cnt) = TYPE_V
-wrf_meta%var_size(var_cnt) = nz
-wrf_meta%var_index(var_cnt) = dart_index
-bot = wrf_meta%var_index(var_cnt)
-top = wrf_meta%var_index(var_cnt) + wrf_meta%var_size(var_cnt) - 1
-do k = bot,top
-  state_loc(k) = set_location(column%longitude,column%latitude,z_grid(k - bot + 1),3)
-enddo
-dart_index = dart_index + wrf_meta%var_size(var_cnt)
-var_cnt = var_cnt + 1
-
-wrf_meta%var_type(var_cnt) = TYPE_GZ
-wrf_meta%var_size(var_cnt) = nz
-wrf_meta%var_index(var_cnt) = dart_index
-bot = wrf_meta%var_index(var_cnt)
-top = wrf_meta%var_index(var_cnt) + wrf_meta%var_size(var_cnt) - 1
-do k = bot,top
-  state_loc(k) = set_location(column%longitude,column%latitude,z_grid(k - bot + 1),3)
-enddo
-dart_index = dart_index + wrf_meta%var_size(var_cnt)
-var_cnt = var_cnt + 1
-
-wrf_meta%var_type(var_cnt) = TYPE_T
-wrf_meta%var_size(var_cnt) = nz
-wrf_meta%var_index(var_cnt) = dart_index

@@ Diff output truncated at 40000 characters. @@


More information about the Dart-dev mailing list