Skip to content

Commit

Permalink
Nullify pointers that are no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanchihwang committed Nov 22, 2024
1 parent c135be4 commit b36fe58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dynamics/mpas/dyn_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ subroutine model_grid_init()
! Read time-invariant (e.g., grid/mesh) variables.
call mpas_dynamical_core % read_write_stream(pio_file, 'r', 'invariant')

nullify(pio_file)

! Compute local east, north and edge-normal unit vectors whenever time-invariant (e.g., grid/mesh) variables are read.
call mpas_dynamical_core % compute_unit_vector()

Expand Down Expand Up @@ -422,6 +424,7 @@ subroutine define_cam_grid()
call cam_grid_attribute_register('mpas_cell', 'cell_weight', 'MPAS cell weight', 'nCells', cell_weight, &
map=global_grid_index)

nullify(areacell)
nullify(cell_area, cell_weight)
nullify(lat_coord, lon_coord)

Expand All @@ -438,7 +441,6 @@ subroutine define_cam_grid()
call cam_grid_register('cam_cell', dyn_grid_id('cam_cell'), lat_coord, lon_coord, global_grid_map, &
unstruct=.true., block_indexed=.false.)

nullify(areacell)
nullify(indextocellid)
nullify(latcell, loncell)

Expand Down

0 comments on commit b36fe58

Please sign in to comment.