Skip to content

Commit

Permalink
Merge pull request #93 from GEOS-ESM/bugfix/atrayano/local_coord_fix
Browse files Browse the repository at this point in the history
Added a missing protection to run Schmidt transform only when needed
  • Loading branch information
mathomp4 authored Dec 5, 2023
2 parents b36c456 + 298f720 commit 700e681
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 700e681

Please sign in to comment.