Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialize cpl_scalar field when created #83

Merged
Merged
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
6 changes: 6 additions & 0 deletions cicecore/drivers/nuopc/cmeps/ice_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,7 @@ subroutine SetScalarField(field, flds_scalar_name, flds_scalar_num, rc)
! local variables
type(ESMF_Distgrid) :: distgrid
type(ESMF_Grid) :: grid
real(ESMF_KIND_R8), pointer :: fldptr2d(:,:)
character(len=*), parameter :: subname='(ice_import_export:SetScalarField)'
! ----------------------------------------------

Expand All @@ -1511,6 +1512,11 @@ subroutine SetScalarField(field, flds_scalar_name, flds_scalar_num, rc)
ungriddedLBound=(/1/), ungriddedUBound=(/flds_scalar_num/), gridToFieldMap=(/2/), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! initialize fldptr to zero
call ESMF_FieldGet(field, farrayPtr=fldptr2d, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
fldptr2d(:,:) = 0.0

end subroutine SetScalarField

end subroutine fldlist_realize
Expand Down
Loading