Skip to content

Commit 4b8777e

Browse files
authored
Merge pull request NOAA-EMC#135 from DeniseWorthen/bugfix/initcplscalars
initialize cpl_scalar field when created
2 parents b32aea7 + 8d05f39 commit 4b8777e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

config_src/drivers/nuopc_cap/mom_cap.F90

+5
Original file line numberDiff line numberDiff line change
@@ -2370,6 +2370,11 @@ subroutine SetScalarField(field, rc)
23702370
ungriddedLBound=(/1/), ungriddedUBound=(/scalar_field_count/), gridToFieldMap=(/2/), rc=rc)
23712371
if (ChkErr(rc,__LINE__,u_FILE_u)) return
23722372

2373+
! initialize fldptr to zero
2374+
call ESMF_FieldGet(field, farrayPtr=fldptr2d, rc=rc)
2375+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
2376+
fldptr2d(:,:) = 0.0
2377+
23732378
end subroutine SetScalarField
23742379

23752380
end subroutine MOM_RealizeFields

0 commit comments

Comments
 (0)