add_new_field_to_bundle Subroutine

subroutine add_new_field_to_bundle(bundle, grid, lm, field_name, long_name, units, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_FieldBundle), intent(inout) :: bundle
type(ESMF_Grid), intent(in) :: grid
integer, intent(in) :: lm
character(len=*), intent(in) :: field_name
character(len=*), intent(in) :: long_name
character(len=*), intent(in) :: units
integer, intent(out), optional :: rc

Calls

proc~~add_new_field_to_bundle~~CallsGraph proc~add_new_field_to_bundle add_new_field_to_bundle ESMF_AttributeSet ESMF_AttributeSet proc~add_new_field_to_bundle->ESMF_AttributeSet esmf_fieldcreate esmf_fieldcreate proc~add_new_field_to_bundle->esmf_fieldcreate interface~mapl_fieldbundleadd MAPL_FieldBundleAdd proc~add_new_field_to_bundle->interface~mapl_fieldbundleadd proc~mapl_abort MAPL_abort proc~add_new_field_to_bundle->proc~mapl_abort proc~mapl_verify MAPL_Verify proc~add_new_field_to_bundle->proc~mapl_verify mpi_abort mpi_abort proc~mapl_abort->mpi_abort proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~add_new_field_to_bundle~~CalledByGraph proc~add_new_field_to_bundle add_new_field_to_bundle program~time_ave time_ave program~time_ave->proc~add_new_field_to_bundle

Source Code

   subroutine add_new_field_to_bundle(bundle,grid,lm,field_name,long_name,units,rc)
      type(ESMF_FieldBundle), intent(inout) :: bundle
      type(ESMF_Grid), intent(in) :: grid
      integer, intent(in) :: lm
      character(len=*), intent(in) :: field_name
      character(len=*), intent(in) :: long_name
      character(len=*), intent(in) :: units
      integer, intent(out), optional :: rc

      integer :: status
      type(ESMF_Field) :: field

      if (lm == 0) then
         field = ESMF_FieldCreate(grid,name=trim(field_name),typekind=ESMF_TYPEKIND_R4,_RC)
      else if (lm > 0) then
         field = ESMF_FieldCreate(grid,name=trim(field_name),typekind=ESMF_TYPEKIND_R4, &
               ungriddedLBound=[1],ungriddedUBound=[lm],_RC)
      end if
      call ESMF_AttributeSet(field,name='LONG_NAME',value=trim(long_name),_RC)
      call ESMF_AttributeSet(field,name='UNITS',value=trim(units),_RC)
      if (lm == 0) then
         call ESMF_AttributeSet(field,name='DIMS',value=MAPL_DimsHorzOnly,_RC)
         call ESMF_AttributeSet(field,name='VLOCATION',value=MAPL_VLocationNone,_RC)
      else if (lm > 0) then
         call ESMF_AttributeSet(field,name='DIMS',value=MAPL_DimsHorzVert,_RC)
         call ESMF_AttributeSet(field,name='VLOCATION',value=MAPL_VLocationCenter,_RC)
      end if
      call MAPL_FieldBundleAdd(bundle,field,_RC)
      if (present(rc)) then
         RC=_SUCCESS
      end if
   end subroutine add_new_field_to_bundle