From 665f9b41d177a507be0575b4a9d0eee945ddbb05 Mon Sep 17 00:00:00 2001 From: ShunLiu-NOAA Date: Tue, 1 Oct 2024 12:08:17 -0400 Subject: [PATCH] Initialize variables to avoid the warning message when compiling (#753) This PR is to initialize variables in observer_fv3reg.f90 to avoid the warning message when compiling. The change will update regional EnKF excutable. However, the current regression test can't identify the changes in regional EnKF mode. The difference between before and after this update is that no warning message appears when compiling regional EnKF. This PR is to address https://github.com/NOAA-EMC/GSI/issues/751 **Type of change** - [x] Bug fix (non-breaking change which fixes an issue) **Checklist** - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code --- src/enkf/observer_fv3reg.f90 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/enkf/observer_fv3reg.f90 b/src/enkf/observer_fv3reg.f90 index 8f77bca417..9084ee58f6 100644 --- a/src/enkf/observer_fv3reg.f90 +++ b/src/enkf/observer_fv3reg.f90 @@ -45,7 +45,7 @@ subroutine setup_linhx(rlat, rlon, time, ix, delx, ixp, delxp, iy, dely, & use params, only: nstatefields, nlons, nlats, nlevs, nhr_state, fhr_assim use gridinfo, only: npts, latsgrd, lonsgrd use statevec, only: nsdim - use constants, only: zero,one,pi + use constants, only: izero,zero,one,pi use mpisetup implicit none @@ -54,6 +54,18 @@ subroutine setup_linhx(rlat, rlon, time, ix, delx, ixp, delxp, iy, dely, & real(r_single) ,intent(in ) :: time ! observation time relative to middle of window integer(i_kind), intent(out) :: ix, iy, it, ixp, iyp, itp real(r_kind), intent(out) :: delx, dely, delxp, delyp, delt, deltp + ix=izero + iy=izero + it=izero + ixp=izero + iyp=izero + itp=izero + delx=zero + dely=zero + delxp=zero + delyp=zero + delt=zero + deltp=zero write(6,*)'this is a dummy subroutine, running this means something wrong ,stop' call stop2(555) @@ -110,6 +122,7 @@ subroutine calc_linhx(hx, dens, dhx_dx, hxpert, hx_ens, & type(raggedarr) ,intent(inout) :: hxpert ! interpolated background real(r_single) ,intent( out) :: hx_ens ! H (x_ens) integer(i_kind) i,j + hx_ens=zero write(6,*)'this is a dummy subroutine, running this means something wrong ,stop' call stop2(555) @@ -145,6 +158,7 @@ subroutine calc_linhx_modens(hx, dhx_dx, hxpert, hx_ens, vscale) !$$$ use kinds, only: r_kind,i_kind,r_single use sparsearr, only: sparr, raggedarr + use constants, only: zero use mpisetup implicit none @@ -155,6 +169,7 @@ subroutine calc_linhx_modens(hx, dhx_dx, hxpert, hx_ens, vscale) real(r_single) ,intent( out) :: hx_ens(neigv)! H (x_ens) real(r_double),dimension(neigv,nlevs+1) ,intent(in ) :: vscale ! vertical scaling (for modulated ens) integer(i_kind) i + hx_ens=zero write(6,*)'this is a dummy subroutine, running this means something wrong ,stop' call stop2(555)