[Dart-dev] [4370] DART/trunk: Adding a couple observation kinds for the COAMPS folks.

nancy at ucar.edu nancy at ucar.edu
Fri May 21 16:07:29 MDT 2010


Revision: 4370
Author:   thoar
Date:     2010-05-21 16:07:29 -0600 (Fri, 21 May 2010)
Log Message:
-----------
Adding a couple observation kinds for the COAMPS folks.
Also took steps to ensure FORTRAN parameter names are less than 
the 32 character limit. This was potentially a problem when
trying to 'build' horizontal wind names from the components.
Had to change XXXXX_10_METER_HORIZONTAL_WIND (where XXXXX is the platform)
to XXXXX_10_M_HORZ_WIND. Change was made consistent in obs_diag
and should not affect any of the existing Matlab scripts.

Modified Paths:
--------------
    DART/trunk/diagnostics/threed_sphere/obs_diag.f90
    DART/trunk/obs_kind/DEFAULT_obs_kind_mod.F90

-------------- next part --------------
Modified: DART/trunk/diagnostics/threed_sphere/obs_diag.f90
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_diag.f90	2010-05-21 15:54:45 UTC (rev 4369)
+++ DART/trunk/diagnostics/threed_sphere/obs_diag.f90	2010-05-21 22:07:29 UTC (rev 4370)
@@ -2550,7 +2550,7 @@
    if (indx1 > 0) then ! must be _?_WIND_COMPONENT
       str3 = str1(1:indx1)//'_HORIZONTAL_WIND'
    else                ! must be _?_10_METER_WIND
-      str3 = str1(1:indx2)//'_10_METER_HORIZONTAL_WIND'
+      str3 = str1(1:indx2)//'_10_M_HORZ_WIND'
       indx1 = indx2
    endif
 
@@ -3593,7 +3593,7 @@
          indxN = index(str1(1:indx1),str2(1:indx2))
          if (indxN > 0) then ! we know they are matching kinds
             nwinds = nwinds + 1
-            str3   = str1(1:indx2)//'_10_METER_HORIZONTAL_WIND'
+            str3   = str1(1:indx2)//'_10_M_HORZ_WIND'
             names(max_obs_kinds + nwinds) = str3
          endif
       endif

Modified: DART/trunk/obs_kind/DEFAULT_obs_kind_mod.F90
===================================================================
--- DART/trunk/obs_kind/DEFAULT_obs_kind_mod.F90	2010-05-21 15:54:45 UTC (rev 4369)
+++ DART/trunk/obs_kind/DEFAULT_obs_kind_mod.F90	2010-05-21 22:07:29 UTC (rev 4370)
@@ -48,7 +48,12 @@
 ! be rerun to generate a obs_kind_mod.f90 file for use by the rest of the
 ! DART system.  Future versions of the preprocess program will be able to
 ! generate this table automatically.
-!
+
+! F90 currently has a maximum length of 32 characters for the NAME of
+! any Fortran PARAMETER. 
+
+integer, parameter :: paramname_length = 32
+
 ! Definition and public access to the observation types/kinds
 ! Unique index values associated with each observation type and 
 ! kind strings are defined here. 
@@ -157,11 +162,14 @@
     KIND_VORTEX_WMAX                 = 84, &
  
 ! kinds for COAMPS (Tim Whitcomb)
-    KIND_EXNER_FUNCTION              = 85
+    KIND_EXNER_FUNCTION              = 85, &
+    KIND_TURBULENT_KINETIC_ENERGY    = 86, &
+    KIND_VERTLEVEL                   = 87
+
  
 !! PRIVATE ONLY TO THIS MODULE. see comment below near the max_obs_specific
 !! declaration.
-integer, parameter :: max_obs_generic = 85
+integer, parameter :: max_obs_generic = 87
 
 !----------------------------------------------------------------------------
 ! This list is autogenerated by the 'preprocess' program.  To add new 
@@ -218,7 +226,7 @@
 ! restrictions on the length of parameter identifiers.
 type obs_type_type
    integer              :: index
-   character(len = 32)  :: name
+   character(len = paramname_length) :: name
    integer              :: var_type
    logical              :: assimilate
    logical              :: evaluate
@@ -231,7 +239,7 @@
 
 type obs_kind_type
    integer              :: index
-   character(len = 32)  :: name
+   character(len = paramname_length) :: name
 end type obs_kind_type
 
 ! An obs_kind_name_type is defined by the preprocess program to store 
@@ -349,6 +357,8 @@
 obs_kind_names(83) = obs_kind_type(KIND_VORTEX_PMIN, 'KIND_VORTEX_PMIN')
 obs_kind_names(84) = obs_kind_type(KIND_VORTEX_WMAX, 'KIND_VORTEX_WMAX')
 obs_kind_names(85) = obs_kind_type(KIND_EXNER_FUNCTION, 'KIND_EXNER_FUNCTION')
+obs_kind_names(86) = obs_kind_type(KIND_TURBULENT_KINETIC_ENERGY, 'KIND_TURBULENT_KINETIC_ENERGY')
+obs_kind_names(87) = obs_kind_type(KIND_VERTLEVEL, 'KIND_VERTLEVEL')
 
 
 ! count here, then output below 
@@ -477,7 +487,7 @@
 ! Returns observation type name
 
 integer, intent(in) :: obs_kind_ind
-character(len = 32) :: get_obs_kind_name
+character(len = paramname_length) :: get_obs_kind_name
 
 if ( .not. module_initialized ) call initialize_module
 
@@ -501,7 +511,7 @@
 ! Returns observation kind name
 
 integer, intent(in) :: obs_kind_ind
-character(len=32)   :: get_raw_obs_kind_name
+character(len=paramname_length) :: get_raw_obs_kind_name
 
 if (.not. module_initialized) call initialize_module
 
@@ -651,7 +661,7 @@
 character(len=*), intent(in), optional :: fform
 integer, intent(in), optional          :: use_list(:)
 
-character(len=32) :: fileformat
+character(len=paramname_length) :: fileformat
 integer :: i
 
 if ( .not. module_initialized ) call initialize_module
@@ -805,7 +815,7 @@
 integer :: get_kind_from_menu
 
 integer :: i, ierr
-character(len=32) :: in
+character(len=paramname_length) :: in
 
 if ( .not. module_initialized ) call initialize_module
 
@@ -862,8 +872,8 @@
 integer :: add_wind_names
 
 integer :: ivar, nwinds
-character(len=len(my_names)) :: str1, str2, str3
-character(len=len(my_names)), dimension(2*max_obs_kinds) :: names
+character(len=paramname_length) :: str1, str2, str3
+character(len=paramname_length), dimension(2*max_obs_kinds) :: names
 
 ! Initially, the array of obs_kind_names is exactly 'max_num_obs' in length.
 ! This block finds the U,V wind pairs and creates the 'horizontal_wind'
@@ -878,8 +888,6 @@
 
 nwinds = 0
 
-if ( DEBUG ) write(*,*)'my_names length is ',len(my_names)
-
 ! Copy all the known obs kinds to a local list that is SURELY too BIG
 ! as we find wind pairs, we insert the new name at the end of the known 
 ! names.
@@ -939,7 +947,7 @@
       indxN = index(str1(1:indx1),str2(1:indx2))
       if (indxN > 0) then ! we know they are matching kinds
          nwinds = nwinds + 1
-         str3   = str1(1:indx2)//'_10_METER_HORIZONTAL_WIND'
+         str3   = str1(1:indx2)//'_10_M_HORZ_WIND'
          names(max_obs_kinds + nwinds) = str3
       endif
    endif
@@ -1049,7 +1057,7 @@
 if (indx1 > 0) then ! must be _?_WIND_COMPONENT
    str3 = str1(1:indx1)//'_HORIZONTAL_WIND'
 else                ! must be _?_10_METER_WIND
-   str3 = str1(1:indx2)//'_10_METER_HORIZONTAL_WIND'
+   str3 = str1(1:indx2)//'_10_M_HORZ_WIND'
    indx1 = indx2
 endif
 
@@ -1058,7 +1066,7 @@
 ! str1(1:indx1) and str2(1:indx1) should be the wind name - 
 ! 'RADIOSONDE_' or 'SHIP_' or 'AIREP_' or ...
 
-if (index(str1, str2(1:indx1)) < 1) then
+if ( str1(1:indx1) /= str2(1:indx1) ) then
    write(msg_string,*) 'around OBS ', obskey, trim(str1),trim(str2), 'observation types not compatible.'
    call error_handler(E_WARN,'do_obs_form_pair',msg_string,source,revision,revdate)
 endif


More information about the Dart-dev mailing list