get_variable_dim_names Function

public function get_variable_dim_names(field, geom, rc) result(dim_names)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Field), intent(in) :: field
type(ESMF_Geom), intent(in) :: geom
integer, intent(out), optional :: rc

Return Value character(len=:), allocatable


Calls

proc~~get_variable_dim_names~~CallsGraph proc~get_variable_dim_names get_variable_dim_names esmf_fieldget esmf_fieldget proc~get_variable_dim_names->esmf_fieldget get_gridded_dims get_gridded_dims proc~get_variable_dim_names->get_gridded_dims proc~get_mapl_geom get_mapl_geom proc~get_variable_dim_names->proc~get_mapl_geom proc~get_vertical_dimension_name_from_field get_vertical_dimension_name_from_field proc~get_variable_dim_names->proc~get_vertical_dimension_name_from_field proc~mapl_return MAPL_Return proc~get_variable_dim_names->proc~mapl_return proc~mapl_verify MAPL_Verify proc~get_variable_dim_names->proc~mapl_verify proc~string_vec_to_comma_sep string_vec_to_comma_sep proc~get_variable_dim_names->proc~string_vec_to_comma_sep proc~ungridded_dim_names ungridded_dim_names proc~get_variable_dim_names->proc~ungridded_dim_names proc~get_mapl_geom->proc~mapl_return proc~get_mapl_geom->proc~mapl_verify get_geom_manager get_geom_manager proc~get_mapl_geom->get_geom_manager get_mapl_geom_from_id get_mapl_geom_from_id proc~get_mapl_geom->get_mapl_geom_from_id proc~mapl_geomgetid MAPL_GeomGetId proc~get_mapl_geom->proc~mapl_geomgetid proc~get_vertical_dimension_name_from_field->proc~mapl_return proc~get_vertical_dimension_name_from_field->proc~mapl_verify interface~mapl_fieldget MAPL_FieldGet proc~get_vertical_dimension_name_from_field->interface~mapl_fieldget none~get_dimension_name VerticalStaggerLoc%get_dimension_name proc~get_vertical_dimension_name_from_field->none~get_dimension_name at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception begin begin proc~string_vec_to_comma_sep->begin next next proc~string_vec_to_comma_sep->next of of proc~string_vec_to_comma_sep->of proc~ungridded_dim_names->proc~mapl_return proc~ungridded_dim_names->proc~mapl_verify proc~ungridded_dim_names->interface~mapl_fieldget proc~cat_ungridded_dim_names cat_ungridded_dim_names proc~ungridded_dim_names->proc~cat_ungridded_dim_names get_name get_name proc~cat_ungridded_dim_names->get_name none~get_ith_dim_spec UngriddedDims%get_ith_dim_spec proc~cat_ungridded_dim_names->none~get_ith_dim_spec none~get_num_ungridded UngriddedDims%get_num_ungridded proc~cat_ungridded_dim_names->none~get_num_ungridded proc~mapl_geomgetid->proc~mapl_return proc~mapl_geomgetid->proc~mapl_verify ESMF_InfoGet ESMF_InfoGet proc~mapl_geomgetid->ESMF_InfoGet ESMF_InfoGetFromHost ESMF_InfoGetFromHost proc~mapl_geomgetid->ESMF_InfoGetFromHost none~get_ith_dim_spec->proc~mapl_return none~get_ith_dim_spec->proc~mapl_verify none~at~215 UngriddedDimVector%at none~get_ith_dim_spec->none~at~215

Called by

proc~~get_variable_dim_names~~CalledByGraph proc~get_variable_dim_names get_variable_dim_names proc~add_variable~3 add_variable proc~add_variable~3->proc~get_variable_dim_names proc~add_variables add_variables proc~add_variables->proc~add_variable~3 proc~bundle_to_metadata bundle_to_metadata proc~bundle_to_metadata->proc~add_variables

Source Code

   function get_variable_dim_names(field, geom, rc) result(dim_names)
      character(len=:), allocatable :: dim_names
      type(ESMF_Field), intent(in) :: field
      type(ESMF_Geom), intent(in) :: geom
      integer, optional, intent(out) :: rc
      
      type(MAPLGeom), pointer :: mapl_geom
      type(StringVector) :: grid_variables
      type(ESMF_Geom) :: esmfgeom
      character(len=:), allocatable :: vert_dim_name, ungridded_names
      integer :: status
      
      call ESMF_FieldGet(field, geom=esmfgeom, _RC)
      mapl_geom => get_mapl_geom(esmfgeom, _RC)
      grid_variables = mapl_geom%get_gridded_dims()
      dim_names = string_vec_to_comma_sep(grid_variables)
      ! add vertical dimension
      vert_dim_name = get_vertical_dimension_name_from_field(field, _RC)
      if(vert_dim_name /= EMPTY) dim_names = dim_names // "," // vert_dim_name
      ! add any ungridded dimensions
      ungridded_names = ungridded_dim_names(field, _RC)
      if(ungridded_names /= EMPTY) dim_names = dim_names // ungridded_names
      ! add time dimension
      dim_names = dim_names // ",time"

      _RETURN(_SUCCESS)
   end function get_variable_dim_names