[Dart-dev] DART/branches Revision: 11194

dart at ucar.edu dart at ucar.edu
Mon Mar 6 09:03:48 MST 2017


nancy at ucar.edu
2017-03-06 09:03:45 -0700 (Mon, 06 Mar 2017)
248
get these changes into the repository - i got them tangled
up with other changes and i don't have time to test and
fix all the references to these routines, but after the
release this is how i'd like to restructure the locations
modules and code.




Modified: DART/branches/location_utils/location/annulus/location_mod.f90
===================================================================
--- DART/branches/location_utils/location/annulus/location_mod.f90	2017-03-06 15:47:49 UTC (rev 11193)
+++ DART/branches/location_utils/location/annulus/location_mod.f90	2017-03-06 16:03:45 UTC (rev 11194)
@@ -16,11 +16,12 @@
 
 use      types_mod, only : r8, PI, RAD2DEG, DEG2RAD, MISSING_R8, MISSING_I
 use  utilities_mod, only : register_module, error_handler, E_ERR, ascii_file_format, &
-                           nc_check, find_namelist_in_file, check_namelist_read, &
+                           find_namelist_in_file, check_namelist_read, &
                            do_output, do_nml_file, do_nml_term, nmlfileunit, &
-                           open_file, close_file, nc_check, is_longitude_between
+                           open_file, close_file, is_longitude_between
 use random_seq_mod, only : random_seq_type, init_random_seq, random_uniform
 
+
 implicit none
 private
 
@@ -28,12 +29,12 @@
           set_location_missing, is_location_in_region, &
           write_location, read_location, interactive_location, query_location, &
           LocationDims, LocationName, LocationLName, get_close_obs, &
+          LocationStorageOrder, LocationUnits, has_vert_choice, &
           get_close_maxdist_init, get_close_obs_init, get_close_type, &
           operator(==), operator(/=), get_dist, get_close_obs_destroy, &
-          nc_write_location_atts, nc_get_location_varids, nc_write_location, &
           vert_is_height, vert_is_pressure, vert_is_undef, vert_is_level, &
           vert_is_surface, has_vertical_localization, VERTISSURFACE, &
-          VERTISLEVEL, VERTISHEIGHT, &
+          VERTISLEVEL, VERTISHEIGHT, vert_is_scale_height, &
           set_vert, get_vert, set_which_vert
 
 
@@ -71,6 +72,8 @@
 character(len = 129), parameter :: LocationName = "loc_annulus"
 character(len = 129), parameter :: LocationLName = &
                                    "Annulus location: azimuthal angle, radius, and height"
+character(len = 129), parameter :: LocationStorageOrder = 'Azimuth Radius Vertical'
+character(len = 129), parameter :: LocationUnits = 'degrees meters which_vert'
 
 ! really just a placeholder.  there was a comment that this code
 ! needs a namelist with a min & max limit on the radius, but 
@@ -564,133 +567,17 @@
 
 end subroutine interactive_location
 
-!----------------------------------------------------------------------------
+!--------------------------------------------------------------------
+!> does this location mod have a variable vertical component?
+function has_vert_choice()
+logical :: has_vert_choice
 
-function nc_write_location_atts( ncFileID, fname, ObsNumDimID ) result (ierr)
- 
-! Writes the "location module" -specific attributes to a netCDF file.
+has_vert_choice = .false.
 
-use typeSizes
-use netcdf
+end function has_vert_choice
 
-integer,          intent(in) :: ncFileID     ! handle to the netcdf file
-character(len=*), intent(in) :: fname        ! file name (for printing purposes)
-integer,          intent(in) :: ObsNumDimID  ! handle to the dimension that grows
-integer                      :: ierr
-
-integer :: LocDimID
-integer :: VarID
-
-if ( .not. module_initialized ) call initialize_module
-
-ierr = -1 ! assume things will fail ...
-
-! define the rank/dimension of the location information
-call nc_check(nf90_def_dim(ncid=ncFileID, name='location', len=LocationDims, &
-       dimid = LocDimID), 'nc_write_location_atts', 'def_dim:location '//trim(fname))
-
-! Define the observation location variable and attributes
-
-call nc_check(nf90_def_var(ncid=ncFileID, name='location', xtype=nf90_double, &
-          dimids=(/ LocDimID, ObsNumDimID /), varid=VarID), &
-            'nc_write_location_atts', 'location:def_var')
-
-call nc_check(nf90_put_att(ncFileID, VarID, 'description', &
-        'location coordinates'), 'nc_write_location_atts', 'location:description')
-call nc_check(nf90_put_att(ncFileID, VarID, 'location_type', &
-        trim(LocationName)), 'nc_write_location_atts', 'location:location_type')
-call nc_check(nf90_put_att(ncFileID, VarID, 'long_name', &
-        trim(LocationLName)), 'nc_write_location_atts', 'location:long_name')
-call nc_check(nf90_put_att(ncFileID, VarID, 'storage_order',     &
-        'Azimuth Radius Vertical'), 'nc_write_location_atts', 'location:storage_order')
-call nc_check(nf90_put_att(ncFileID, VarID, 'units',     &
-        'degrees meters which_vert'), 'nc_write_location_atts', 'location:units')
-
-! Define the ancillary vertical array and attributes
-
-call nc_check(nf90_def_var(ncid=ncFileID, name='which_vert', xtype=nf90_int, &
-          dimids=(/ ObsNumDimID /), varid=VarID), &
-            'nc_write_location_atts', 'which_vert:def_var')
-


More information about the Dart-dev mailing list