Skip to content

Commit c23345d

Browse files
committed
use different routine signature -- tested
correct what looks like an incorrect if conditional for scm and convert it to positive. only nullify is scm
1 parent f0fa68c commit c23345d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

components/eam/src/dynamics/se/dyn_grid.F90

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -667,17 +667,16 @@ subroutine define_cam_grids()
667667
! The native HOMME GLL grid
668668
call cam_grid_register(trim(gridname), dyn_decomp, lat_coord, lon_coord, &
669669
grid_map_d,block_indexed=.false., unstruct=.true.)
670-
if (.not.single_column .or. scm_multcols) then
671-
call cam_grid_attribute_register(trim(gridname), trim(areaname), &
672-
'gll grid areas', trim(ncolname), pearea, pemap)
673-
else
674-
! If single column model, set pearea_scm(1) to be the area.
675-
! Then register attribute in same way as non-SCM to simplify.
670+
if (single_column .or. scm_multcols) then
671+
! If single column model, set pearea_scm(1) to be the area as 1 value to simplify
676672
allocate(pearea_scm(1))
677673
pearea_scm(1) = 1.0_r8 / elem(1)%rspheremp(1,1)
678674
call cam_grid_attribute_register(trim(gridname), trim(areaname), &
679-
'gll grid areas', trim(ncolname), pearea_scm, pemap)
680-
nullify(pearea_scm)
675+
'gll grid areas', trim(ncolname), pearea_scm)
676+
else
677+
call cam_grid_attribute_register(trim(gridname), trim(areaname), &
678+
'gll grid areas', trim(ncolname), pearea, pemap)
679+
681680
end if ! .not. single_column
682681

683682
call cam_grid_attribute_register(trim(gridname), 'np', '', np)
@@ -692,6 +691,9 @@ subroutine define_cam_grids()
692691
nullify(grid_map_d)
693692
nullify(pearea)
694693
nullify(pemap)
694+
if (single_column .or. scm_multcols) then
695+
nullify(pearea_scm)
696+
endif
695697

696698
!---------------------------------------------------------------------------
697699
! Create grid object for physics grid on the dynamics decomposition

0 commit comments

Comments
 (0)