From 298f720a6fb437dc0047a2a189ab8fb81cf4c486 Mon Sep 17 00:00:00 2001 From: Atanas Trayanov Date: Mon, 4 Dec 2023 10:39:34 -0500 Subject: [PATCH] Added a missing protection to run Schmidt transform only when needed --- tools/fv_grid_tools.F90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/fv_grid_tools.F90 b/tools/fv_grid_tools.F90 index d8d7abd6e..802029c23 100644 --- a/tools/fv_grid_tools.F90 +++ b/tools/fv_grid_tools.F90 @@ -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