[Dart-dev] DART/branches Revision: 12078

dart at ucar.edu dart at ucar.edu
Thu Nov 9 11:48:46 MST 2017


nancy at ucar.edu
2017-11-09 11:48:44 -0700 (Thu, 09 Nov 2017)
122
add a translation from string to vertical integer,
change the namelist to use strings and an updated
namelist item name.




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2017-11-09 18:37:06 UTC (rev 12077)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2017-11-09 18:48:44 UTC (rev 12078)
@@ -74,7 +74,7 @@
 ! model_nml namelist variables and default values
 character(len=256) :: cam_template_filename           = 'caminput.nc'
 character(len=256) :: cam_phis_filename               = 'camphis.nc'
-character(len=32)  :: vert_localization_coord         = 'PRESSURE'
+character(len=32)  :: vertical_localization_coord     = 'PRESSURE'
 integer            :: assimilation_period_days        = 0
 integer            :: assimilation_period_seconds     = 21600
 integer            :: no_assim_above_this_model_level = 5
@@ -97,7 +97,7 @@
 namelist /model_nml/  &
    cam_template_filename,           &
    cam_phis_filename,               &
-   vert_localization_coord,         &
+   vertical_localization_coord,     &
    state_variables,                 &
    assimilation_period_days,        &
    assimilation_period_seconds,     &
@@ -115,6 +115,10 @@
 ! info and is require for getting state variables.
 integer :: domain_id
 
+! this one must match the threed_sphere codes for VERTISxx
+! default to pressure (2)
+integer :: vert_local_coord = VERTISPRESSURE
+
 !> Everything needed to describe a variable. Basically all the metadata from
 !> a netCDF file is stored here as well as all the information about where
 !> the variable is stored in the DART state vector.
@@ -226,6 +230,9 @@
 
 call set_cam_variable_info(state_variables, nfields)
 
+! convert from string to integer
+call set_vert_localization(vertical_localization_coord, vert_local_coord)
+
 end subroutine static_init_model
 
 
@@ -1596,7 +1603,38 @@
 
 end subroutine free_cam_1d_array
 
+!-----------------------------------------------------------------------
+!>
+!> 
+!>   
 
+subroutine set_vert_localization(typename, vcoord)
+character(len=*), intent(in)  :: typename
+integer,          intent(out) :: vcoord
+
+character(len=32) :: ucasename
+
+ucasename = typename
+call to_upper(ucasename)
+
+select case (ucasename)
+  case ("PRESSURE")
+     vcoord = VERTISPRESSURE
+  case ("HEIGHT")
+     vcoord = VERTISHEIGHT
+  case ("SCALEHEIGHT", "SCALE_HEIGHT")
+     vcoord = VERTISSCALEHEIGHT
+  case ("LEVEL", "MODEL_LEVEL")
+     vcoord = VERTISLEVEL
+  case default
+     write(string1,*)'unrecognized vertical localization coordinate type: '//trim(typename)
+     write(string2,*)'valid values are: PRESSURE, HEIGHT, SCALEHEIGHT, LEVEL'
+     call error_handler(E_ERR,'set_vert_localization:',string1, &
+                        source,revision,revdate,text2=string2)
+end select
+ 
+end subroutine set_vert_localization
+
 !-----------------------------------------------------------------------
 !>
 !> 

Modified: DART/branches/recam/models/cam-fv/work/input.nml
===================================================================
--- DART/branches/recam/models/cam-fv/work/input.nml	2017-11-09 18:37:06 UTC (rev 12077)
+++ DART/branches/recam/models/cam-fv/work/input.nml	2017-11-09 18:48:44 UTC (rev 12078)
@@ -134,7 +134,7 @@
 &model_nml
    cam_template_filename       = 'caminput.nc' 
    cam_phis_filename           = 'cam_phis.nc'
-   vert_localization_coord     = 'PRESSURE'
+   vertical_localization_coord = 'PRESSURE'
    state_variables             = 'T'  'QTY_TEMPERATURE',       'NA', 'NA', 'UPDATE'
                                  'US' 'QTY_U_WIND_COMPONENT',  'NA', 'NA', 'UPDATE'
                                  'VS' 'QTY_V_WIND_COMPONENT',  'NA', 'NA', 'UPDATE'


More information about the Dart-dev mailing list