get_file_levels Subroutine

subroutine get_file_levels(filename, vertical_data, rc)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(verticalData), intent(inout) :: vertical_data
integer, intent(out), optional :: rc

Calls

proc~~get_file_levels~2~~CallsGraph proc~get_file_levels~2 get_file_levels none~create~9 FileMetadataUtils%create proc~get_file_levels~2->none~create~9 none~get_coordinate_info FileMetadataUtils%get_coordinate_info proc~get_file_levels~2->none~get_coordinate_info none~get_level_name FileMetadataUtils%get_level_name proc~get_file_levels~2->none~get_level_name proc~mapl_return MAPL_Return proc~get_file_levels~2->proc~mapl_return proc~mapl_verify MAPL_Verify proc~get_file_levels~2->proc~mapl_verify none~get_coordinate_info->proc~mapl_return none~get_coordinate_info->proc~mapl_verify interface~mapl_assert MAPL_Assert none~get_coordinate_info->interface~mapl_assert none~get_attribute Variable%get_attribute none~get_coordinate_info->none~get_attribute none~get_coordinate_data CoordinateVariable%get_coordinate_data none~get_coordinate_info->none~get_coordinate_data none~get_coordinate_variable~2 FileMetadataUtils%get_coordinate_variable none~get_coordinate_info->none~get_coordinate_variable~2 none~get_dimension~2 FileMetadataUtils%get_dimension none~get_coordinate_info->none~get_dimension~2 none~get_file_name FileMetadataUtils%get_file_name none~get_coordinate_info->none~get_file_name none~get_ith_dimension Variable%get_ith_dimension none~get_coordinate_info->none~get_ith_dimension none~get_value UnlimitedEntity%get_value none~get_coordinate_info->none~get_value none~var_has_attr FileMetadataUtils%var_has_attr none~get_coordinate_info->none~var_has_attr none~get_level_name->proc~mapl_return none~first~177 StringVariableMapIterator%first none~get_level_name->none~first~177 none~ftn_begin~25 StringVariableMap%ftn_begin none~get_level_name->none~ftn_begin~25 none~ftn_end~25 StringVariableMap%ftn_end none~get_level_name->none~ftn_end~25 none~get_level_name->none~get_coordinate_variable~2 none~get_variable_attribute FileMetadataUtils%get_variable_attribute none~get_level_name->none~get_variable_attribute none~get_variables~2 FileMetadataUtils%get_variables none~get_level_name->none~get_variables~2 none~is_attribute_present Variable%is_attribute_present none~get_level_name->none~is_attribute_present none~next~82 StringVariableMapIterator%next none~get_level_name->none~next~82 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 none~of~152 StringVariableMapIterator%of none~first~177->none~of~152 to_node to_node none~ftn_end~25->to_node none~get_attribute->proc~mapl_return none~get_attribute->interface~mapl_assert none~at~85 StringAttributeMap%at none~get_attribute->none~at~85 none~get_coordinate_data->proc~mapl_return none~get_coordinate_variable~2->proc~mapl_return none~get_coordinate_variable~2->proc~mapl_verify none~get_coordinate_variable FileMetadata%get_coordinate_variable none~get_coordinate_variable~2->none~get_coordinate_variable none~get_dimension~2->proc~mapl_return none~get_dimension~2->proc~mapl_verify none~get_dimension FileMetadata%get_dimension none~get_dimension~2->none~get_dimension none~get_file_name->proc~mapl_return none~get_ith_dimension->proc~mapl_return none~get_ith_dimension->at none~get_value->proc~mapl_return none~get_variable_attribute->proc~mapl_return none~get_variable_attribute->proc~mapl_verify none~get_variable_attribute->interface~mapl_assert none~get_variable_attribute->none~get_attribute none~get_variable_attribute->none~get_file_name none~get_variable_attribute->none~get_value none~get_variable_attribute->none~is_attribute_present none~get_variable~2 FileMetadataUtils%get_variable none~get_variable_attribute->none~get_variable~2 none~get_variables~2->proc~mapl_return none~get_variables~2->proc~mapl_verify none~get_variables FileMetadata%get_variables none~get_variables~2->none~get_variables none~is_attribute_present->proc~mapl_return none~is_attribute_present->none~at~85 none~next~82->to_node none~var_has_attr->proc~mapl_return none~var_has_attr->proc~mapl_verify none~var_has_attr->interface~mapl_assert none~var_has_attr->none~get_file_name none~var_has_attr->none~is_attribute_present none~var_has_attr->none~get_variable~2

Called by

proc~~get_file_levels~2~~CalledByGraph proc~get_file_levels~2 get_file_levels proc~main~2 main proc~main~2->proc~get_file_levels~2 program~regrid_util Regrid_Util program~regrid_util->proc~main~2

Source Code

   subroutine get_file_levels(filename,vertical_data,rc)
      character(len=*), intent(in) :: filename
      type(VerticalData), intent(inout) :: vertical_data
      integer, intent(out), optional :: rc

      integer :: status
      type(NetCDF4_fileFormatter) :: formatter
      type(FileMetadata) :: basic_metadata
      type(FileMetadataUtils) :: metadata
      character(len=:), allocatable :: lev_name
      character(len=ESMF_MAXSTR) :: long_name
      character(len=ESMF_MAXSTR) :: standard_name
      character(len=ESMF_MAXSTR) :: vcoord
      character(len=ESMF_MAXSTR) :: lev_units
      real, allocatable, target :: levs(:)
      real, pointer :: plevs(:)

      call formatter%open(trim(filename),pFIO_Read,_RC)
      basic_metadata=formatter%read(_RC)
      call metadata%create(basic_metadata,trim(filename))
      lev_name = metadata%get_level_name(_RC)
      call metadata%get_coordinate_info(lev_name,coords=levs,coordUnits=lev_units,long_name=long_name,&
           standard_name=standard_name,coordinate_attr=vcoord,_RC)
      plevs => levs
      vertical_data = VerticalData(levels=plevs,vunit=lev_units,vcoord=vcoord,standard_name=standard_name,long_name=long_name, &
                      force_no_regrid=.true.,_RC)
      nullify(plevs)

      _RETURN(_SUCCESS)

   end subroutine get_file_levels