Skip to content

Commit

Permalink
Added a missing protection to run Schmidt transform only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
atrayano committed Dec 4, 2023
1 parent b36c456 commit 298f720
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/fv_grid_tools.F90
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,11 @@ subroutine init_grid(Atm, grid_name, grid_file, npx, npy, npz, ndims, nregions,
grid_local(:,:,1) = grid_local(:,:,1) + 2*pi
end where
where (abs(grid_local(:,:,:)) < 1.d-10) grid_local = 0
call direct_transform(Atm%flagstruct%stretch_fac, is, ie+1, js, je+1, &
Atm%flagstruct%target_lon, Atm%flagstruct%target_lat, &
tile, grid_local(:,:,1), grid_local(:,:,2))
if ( Atm%flagstruct%do_schmidt ) then
call direct_transform(Atm%flagstruct%stretch_fac, is, ie+1, js, je+1, &
Atm%flagstruct%target_lon, Atm%flagstruct%target_lat, &
tile, grid_local(:,:,1), grid_local(:,:,2))
end if
grid(is:ie+1,js:je+1,:) = grid_local(:,:,:)
deallocate(grid_local)
endif
Expand Down

0 comments on commit 298f720

Please sign in to comment.