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_InfoGetFromHost ESMF_InfoGetFromHost proc~add_new_field_to_bundle->ESMF_InfoGetFromHost ESMF_InfoSet ESMF_InfoSet proc~add_new_field_to_bundle->ESMF_InfoSet 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
      type(ESMF_Info) :: infoh

      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_InfoGetFromHost(field,infoh,_RC)
      call ESMF_InfoSet(infoh,key='LONG_NAME',value=trim(long_name),_RC)
      call ESMF_InfoSet(infoh,key='UNITS',value=trim(units),_RC)
      if (lm == 0) then
         call ESMF_InfoSet(infoh,key='DIMS',value=MAPL_DimsHorzOnly,_RC)
         call ESMF_InfoSet(infoh,key='VLOCATION',value=MAPL_VLocationNone,_RC)
      else if (lm > 0) then
         call ESMF_InfoSet(infoh,key='DIMS',value=MAPL_DimsHorzVert,_RC)
         call ESMF_InfoSet(infoh,key='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