[Dart-dev] DART/branches Revision: 12041

dart at ucar.edu dart at ucar.edu
Fri Nov 3 14:42:52 MDT 2017


hendric at ucar.edu
2017-11-03 14:42:49 -0600 (Fri, 03 Nov 2017)
79
adding stagger table that get state metadata can 
use to return the location.




Modified: DART/branches/recam/assimilation_code/modules/io/state_structure_mod.f90
===================================================================
--- DART/branches/recam/assimilation_code/modules/io/state_structure_mod.f90	2017-11-03 18:00:09 UTC (rev 12040)
+++ DART/branches/recam/assimilation_code/modules/io/state_structure_mod.f90	2017-11-03 20:42:49 UTC (rev 12041)
@@ -1685,7 +1685,7 @@
 !-------------------------------------------------------------------------------
 !> Returns the variable dart kind index
 
-
+!>@todo need to switch all kinds to qty
 function get_kind_index(dom_id, var_id)
 
 integer, intent(in) :: dom_id ! domain

Modified: DART/branches/recam/models/cam-fv/new_model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/new_model_mod.f90	2017-11-03 18:00:09 UTC (rev 12040)
+++ DART/branches/recam/models/cam-fv/new_model_mod.f90	2017-11-03 20:42:49 UTC (rev 12041)
@@ -114,7 +114,7 @@
 
 type cam_1d_array
    integer  :: nsize
-   real(r8), allocatable :: vals(:) 
+   real(r8), allocatable :: vals(:)
 end type
 
 type cam_grid
@@ -135,6 +135,18 @@
 type(cam_grid) :: grid_data
 
 
+integer, parameter :: STAGGER_NONE = -1
+integer, parameter :: STAGGER_U    =  1
+integer, parameter :: STAGGER_V    =  2
+integer, parameter :: STAGGER_W    =  3 
+integer, parameter :: STAGGER_UV   =  4
+
+type cam_stagger
+   integer, allocatable :: qty_stagger(:)
+end type
+
+type(cam_stagger) :: grid_stagger
+
 contains
 
 
@@ -184,6 +196,7 @@
 if (do_nml_file()) write(logfileunit, nml=model_nml)
 if (do_nml_term()) write(     *     , nml=model_nml)
 
+call set_calendar_type('GREGORIAN')
 
 call read_grid_info(cam_template_filename, cam_phis_filename, grid_data)
 
@@ -244,21 +257,26 @@
 
 myqty = get_kind_index(domain_id, myvarid)
 
-select case (myqty)
-  case (QTY_U_WIND_COMPONENT)
+select case (grid_stagger%qty_stagger(myqty))
+  case (STAGGER_U)
+   location = set_location(grid_data%lon%vals(iloc), &
+                           grid_data%slat%vals(jloc), &
+                           real(vloc,r8), VERTISLEVEL)
+
+  case (STAGGER_V)
    location = set_location(grid_data%slon%vals(iloc), &
                            grid_data%lat%vals(jloc), &
-                           grid_data%lev%vals(vloc), VERTISLEVEL)
-
-  case (QTY_V_WIND_COMPONENT)
+                           real(vloc,r8), VERTISLEVEL)
+   
+  !>@todo not sure what to do yet. ? +-1/2 ?
+  case (STAGGER_W)
    location = set_location(grid_data%lon%vals(iloc), &
-                           grid_data%slat%vals(jloc), &
-                           grid_data%lev%vals(vloc), VERTISLEVEL)
-
+                           grid_data%lat%vals(jloc), &
+                           real(vloc,r8), VERTISLEVEL)
   case default
    location = set_location(grid_data%lon%vals(iloc), &
                            grid_data%lat%vals(jloc), &
-                           grid_data%lev%vals(vloc), VERTISLEVEL)
+                           real(vloc,r8), VERTISLEVEL)
 
 end select
 
@@ -324,8 +342,6 @@
 
 if ( .not. module_initialized ) call static_init_model
 
-call set_calendar_type('GREGORIAN')
-
 shortest_time_between_assimilations = set_time(assimilation_period_seconds, &
                                                assimilation_period_days)
 
@@ -914,11 +930,51 @@
 domain_id = add_domain(cam_template_filename, nfields, var_names, kind_list, &


More information about the Dart-dev mailing list