add_variables Subroutine

public subroutine add_variables(metadata, bundle, rc)

Arguments

Type IntentOptional Attributes Name
type(FileMetadata), intent(inout) :: metadata
type(ESMF_FieldBundle), intent(in) :: bundle
integer, intent(out), optional :: rc

Calls

proc~~add_variables~~CallsGraph proc~add_variables add_variables esmf_fieldbundleget esmf_fieldbundleget proc~add_variables->esmf_fieldbundleget proc~add_variable~2 add_variable proc~add_variables->proc~add_variable~2 proc~mapl_return MAPL_Return proc~add_variables->proc~mapl_return proc~mapl_verify MAPL_Verify proc~add_variables->proc~mapl_verify proc~add_variable~2->proc~mapl_return proc~add_variable~2->proc~mapl_verify ESMF_InfoGetCharAlloc ESMF_InfoGetCharAlloc proc~add_variable~2->ESMF_InfoGetCharAlloc ESMF_InfoGetFromHost ESMF_InfoGetFromHost proc~add_variable~2->ESMF_InfoGetFromHost esmf_fieldget esmf_fieldget proc~add_variable~2->esmf_fieldget get_gridded_dims get_gridded_dims proc~add_variable~2->get_gridded_dims none~add_attribute~3 Variable%add_attribute proc~add_variable~2->none~add_attribute~3 none~add_variable~2 FileMetadata%add_variable proc~add_variable~2->none~add_variable~2 proc~esmf_to_pfio_type esmf_to_pfio_type proc~add_variable~2->proc~esmf_to_pfio_type proc~get_mapl_geom get_mapl_geom proc~add_variable~2->proc~get_mapl_geom proc~get_vertical_dimension_name_from_field get_vertical_dimension_name_from_field proc~add_variable~2->proc~get_vertical_dimension_name_from_field proc~string_vec_to_comma_sep string_vec_to_comma_sep proc~add_variable~2->proc~string_vec_to_comma_sep proc~ungridded_dim_names ungridded_dim_names proc~add_variable~2->proc~ungridded_dim_names 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

Called by

proc~~add_variables~~CalledByGraph proc~add_variables add_variables proc~bundle_to_metadata bundle_to_metadata proc~bundle_to_metadata->proc~add_variables

Source Code

   subroutine add_variables(metadata, bundle, rc)
      type(ESMF_FieldBundle), intent(in) :: bundle
      type(FileMetaData), intent(inout) :: metadata
      integer, intent(out), optional :: rc

      integer :: status, num_fields, i
      character(len=ESMF_MAXSTR), allocatable :: field_names(:)
      type(ESMF_Field) :: field

      call ESMF_FieldBundleGet(bundle, fieldCount=num_fields, _RC)
      allocate(field_names(num_fields))
      call ESMF_FieldBundleGet(bundle, fieldNameList=field_names, _RC)
      do i=1,num_fields
         call ESMF_FieldBundleGet(bundle, field_names(i), field=field, _RC)
         call add_variable(metadata, field, _RC)
      enddo
      _RETURN(_SUCCESS)

   end subroutine add_variables