[Dart-dev] DART/branches Revision: 11847

dart at ucar.edu dart at ucar.edu
Thu Jul 27 14:59:42 MDT 2017


hendric at ucar.edu
2017-07-27 14:59:41 -0600 (Thu, 27 Jul 2017)
116

fixing up path-names and some minor chnages for the model mod
in order for everything to compile with quickbuild.




Modified: DART/branches/rma_fix_clm_restarts/models/clm/model_mod.f90
===================================================================
--- DART/branches/rma_fix_clm_restarts/models/clm/model_mod.f90	2017-07-27 19:48:41 UTC (rev 11846)
+++ DART/branches/rma_fix_clm_restarts/models/clm/model_mod.f90	2017-07-27 20:59:41 UTC (rev 11847)
@@ -35,6 +35,7 @@
                              operator(/=), operator(<=), operator(==)
 
 use     location_mod, only : location_type, set_location, get_location,       &
+                             is_vertical, VERTISLEVEL,                        &
                              VERTISHEIGHT, LocationDims, get_close_obs,       &
                              get_close_state, convert_vertical_obs,           &
                              convert_vertical_state
@@ -1981,7 +1982,6 @@
 real(r8), dimension(LocationDims) :: loc_array
 real(r8) :: llon, llat, lheight
 integer  :: istatus_2(ens_size)
-real(r8) :: interp_val(ens_size)
 real(r8) :: interp_val_2(ens_size)
 character(len=obstypelength) :: qty_string
 integer :: track_status(ens_size)
@@ -2013,7 +2013,7 @@
 ! This is done by trying to 'interpolate' height on a large number of levels.
 ! When the interpolation fails, you've gone one level too far. 
 
-if ((obs_kind == KIND_GEOPOTENTIAL_HEIGHT) .and. vert_is_level(location)) then
+if ((obs_kind == QTY_GEOPOTENTIAL_HEIGHT) .and. is_vertical(location, "LEVEL")) then
    if (nint(lheight) > nlevgrnd) then
       interp_val = MISSING_R8
       istatus = 1
@@ -4843,161 +4843,160 @@
 
 end subroutine mark_missing_r8
 
-=======
 
 
-!>@todo FIXME ... this could be used in the converters to fix missing values
+!#! !>@todo FIXME ... this could be used in the converters to fix missing values
+!#! 
+!#! subroutine mark_missing_r8(ens_handle)
+!#! !------------------------------------------------------------------
+!#! ! Modifies the state to include missing_r8 values for unused snow levels.
+!#! ! This comes from mark_missing_r8.  This is needed when reading
+!#! ! directly from netcdf files.
+!#! 
+!#! type(ensemble_type), intent(inout) :: ens_handle
+!#! 
+!#! ! temp space to hold data while we are reading it
+!#! integer  :: i, j, ni, nj, idom, ivar, indx, icopy, numsnowlevels
+!#! integer,  allocatable, dimension(:) :: snlsno
+!#! real(r8), allocatable, dimension(:) :: tmp_array
+!#! 
+!#! integer :: TimeDimID, VarID, ncNdims
+!#! integer :: ncid
+!#! 
+!#! integer :: numdoms, numvars
+!#! integer :: start_index, end_index
+!#! 
+!#! if ( .not. module_initialized ) call static_init_model
+!#! 
+!#! allocate(snlsno(ncolumn))
+!#! call nc_check(nf90_open(trim(clm_restart_filename), NF90_NOWRITE, ncid), &
+!#!               'makr_missing_r8', 'open SNLSNO'//clm_restart_filename)
+!#! call nc_check(nf90_inq_varid(ncid,'SNLSNO', VarID), &
+!#!               'makr_missing_r8', 'inq_varid SNLSNO'//clm_restart_filename)
+!#! call nc_check(nf90_get_var(ncid, VarID, snlsno), &
+!#!               'makr_missing_r8', 'get_var SNLSNO'//clm_restart_filename)
+!#! 
+!#! ! Start counting and filling the state vector one item at a time,
+!#! ! repacking the Nd arrays into a single 1d list of numbers.
+!#! 
+!#! ! Pack the variable into the DART state vector
+!#! ! Could/should fill metadata arrays at the same time ...
+!#! ! As of 24 Aug 2011, CLM was not consistent about using a single fill_value
+!#! ! or missing value, and the restart files didn't use the right attributes anyway ...
+!#! ! (bugzilla report 1401)
+!#! 
+!#! !>@todo FIXME: I am sure we can do this without having var complete.  This is just
+!#! !>             the quickest way to test for now.
+!#! if(.not. allocated(ens_handle%vars)) allocate(ens_handle%vars(ens_handle%num_vars, ens_handle%my_num_copies))
+!#! call all_copies_to_all_vars(ens_handle)
+!#! 
+!#! numdoms = get_num_domains()
+!#! 
+!#! do idom = 1, numdoms
+!#!    numvars = get_num_variables(idom)
+!#!    do ivar = 1, numvars
+!#! 
+!#!       indx = get_index_start(progvar(ivar)%domain, progvar(ivar)%varname)
+!#!    
+!#!       ! README: The values in unused snow layers must be assumed to be
+!#!       ! indeterminate. If the layer is not in use, fill with a missing value.
+!#!       ! (levsno,column) and (levtot,column) variables may be treated identically.
+!#!       ! abs(snlsno(j)) defines the number of valid levels in each column -
+!#!       ! even over lakes. Lakes use a 'bulk' formula, so all the pertinent
+!#!       ! values are in the 1D variables, SNOWDP and frac_sno.
+!#!    
+!#!       ! FIXME: Question, what happens to unused levels below ground? Are those
+!#!       ! values 'special'?
+!#!       ncNDims = get_num_dims(idom,ivar)
+!#!       if (ncNdims == 2) then


More information about the Dart-dev mailing list