Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions ESMF/GOCART2G_GridComp/SS2G_GridComp/SS2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ subroutine SetServices(gc, rc)
!EOP

!Locals
character(len=ESMF_MAXSTR) :: comp_name
character(len=:), allocatable :: comp_name
type(SS2G_GridComp), pointer :: self
character(len=ESMF_MAXSTR) :: field_name
real :: DEFVAL
Expand All @@ -103,8 +103,7 @@ subroutine SetServices(gc, rc)
type(UngriddedDim) :: ungrd_wavelengths_profile, ungrd_wavelengths_vertint
integer :: i, status

call ESMF_GridCompGet(gc, name=comp_name, _RC)
call MAPL_GridCompGet(gc, logger=logger, _RC)
call MAPL_GridCompGet(gc, logger=logger, name=comp_name, _RC)

! Wrap gridcomp's private state and store it in gridcomp
_SET_NAMED_PRIVATE_STATE(gc, SS2G_GridComp, PRIVATE_STATE)
Expand Down Expand Up @@ -333,13 +332,12 @@ subroutine Initialize(gc, import, export, clock, rc)
integer :: i, dims(3), km
integer :: status

call MAPL_GridCompGet(gc, name=comp_name, _RC)
call MAPL_GridCompGet(gc, name=comp_name, geom=geom, grid=grid, num_levels=km, _RC)

! Get my internal private state
_GET_NAMED_PRIVATE_STATE(gc, SS2G_GridComp, PRIVATE_STATE, self)

! Global dimensions are needed here for choosing tuning parameters
call MAPL_GridCompGet(gc, geom=geom, grid=grid, num_levels=km, _RC)
call MAPL2_GridGet(grid, globalCellCountPerDim=dims, _RC)
self%km = km

Expand Down
22 changes: 10 additions & 12 deletions ESMF/Shared/Chem_AeroGeneric.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module Chem_AeroGeneric
use mapl_ErrorHandling, only: MAPL_Verify, MAPL_Assert, MAPL_Return
use mapl3g_State_API, only: MAPL_StateGetPointer
use mapl3g_Field_API, only: MAPL_FieldGet, MAPL_FieldCreate
use mapl3g_FieldInfo, only: FieldInfoSetInternal
use mapl3g_FieldBundle_API, only: MAPL_FieldBundleAdd
use mapl3g_VerticalStaggerLoc, only: VerticalStaggerLoc, VERTICAL_STAGGER_EDGE, VERTICAL_STAGGER_CENTER
use mapl3g_UngriddedDims, only: UngriddedDims
Expand Down Expand Up @@ -164,21 +163,20 @@ subroutine append_to_bundle(varname, provider_state, prefix, bundle, rc)
do iter = 1, size(orig_ptr, 3)
write (bin_index, "(A, I0.3)") "", iter
ptr2d => orig_ptr(:,:,iter)
field2d = ESMF_FieldCreate( &
geom, &
farray=ptr2d, &
indexflag=ESMF_INDEX_DELOCAL, &
datacopyflag=ESMF_DATACOPY_REFERENCE, &
name=trim(varname)//trim(bin_index), _RC)
call ESMF_InfoGetFromHost(field2d, info, _RC)
call FieldInfoSetInternal( &
info, &
typekind=typekind, &
vert_staggerloc=vert_stagger, &
field2d = MAPL_FieldCreate( &
geom, typekind, &
name=trim(varname)//trim(bin_index), &
ungridded_dims=UngriddedDims(), &
vert_staggerloc=vert_stagger, &
units=units, &
standard_name=stdname//' Bin '//trim(bin_index), &
long_name="unknown", _RC)
call ESMF_FieldEmptyReset(field2d, status=ESMF_FIELDSTATUS_GEOMSET, _RC)
call ESMF_FieldEmptyComplete( &
field2d, &
farray=ptr2d, &
indexflag=ESMF_INDEX_DELOCAL, &
datacopyflag=ESMF_DATACOPY_REFERENCE, _RC)
call MAPL_FieldBundleAdd(bundle, [field2d], _RC)
end do
end if
Expand Down