From e5dc526d16326bb8305e0e8ef690f4445a5d3626 Mon Sep 17 00:00:00 2001
From: KyleKlenk <kyle.c.klenk@gmail.com>
Date: Thu, 14 Apr 2022 15:29:05 -0600
Subject: [PATCH] removed all variables causing warnings

---
 build/makefile                                | 16 +++++-----
 build/source/engine/ffile_info.f90            |  1 -
 .../file_access_actor/cppwrap_fileAccess.f90  | 32 -------------------
 .../interface/job_actor/cppwrap_job.f90       |  2 +-
 config/Summa_Actors_Settings.json             |  2 +-
 5 files changed, 10 insertions(+), 43 deletions(-)

diff --git a/build/makefile b/build/makefile
index 94e0ae8..b20c9bf 100644
--- a/build/makefile
+++ b/build/makefile
@@ -17,16 +17,16 @@
 # gfortran compiler flags
 ifeq "$(FC)" "gfortran"
 # Production runs
-# FLAGS_NOAH = -O3 -ffree-form -ffree-line-length-none -fmax-errors=0 -fPIC
-# FLAGS_COMM = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC
-# FLAGS_SUMMA = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC
-# FLAGS_ACTORS = -O3
+FLAGS_NOAH = -O3 -ffree-form -ffree-line-length-none -fmax-errors=0 -fPIC
+FLAGS_COMM = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC
+FLAGS_SUMMA = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC
+FLAGS_ACTORS = -O3
 
 # # Debug runs
-FLAGS_NOAH = -p -g -O0 -ffree-form -ffree-line-length-none -fmax-errors=0 -fbacktrace -Wno-unused -Wno-unused-dummy-argument -fPIC
-FLAGS_COMM = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC
-FLAGS_SUMMA = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC
-FLAGS_ACTORS = -g -O0 -Wall
+# FLAGS_NOAH = -p -g -O0 -ffree-form -ffree-line-length-none -fmax-errors=0 -fbacktrace -Wno-unused -Wno-unused-dummy-argument -fPIC
+# FLAGS_COMM = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC
+# FLAGS_SUMMA = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC
+# FLAGS_ACTORS = -g -O0 -Wall
 endif
 
 # ifort compiler flags
diff --git a/build/source/engine/ffile_info.f90 b/build/source/engine/ffile_info.f90
index dd1dab4..1dcaccf 100755
--- a/build/source/engine/ffile_info.f90
+++ b/build/source/engine/ffile_info.f90
@@ -41,7 +41,6 @@ subroutine ffile_info(indxGRU,forcFileInfo,numFiles,err,message)
   USE summaActors_FileManager,only:SETTINGS_PATH            ! path for metadata files
   USE summaActors_FileManager,only:FORCING_PATH             ! path for forcing files
   USE summaActors_FileManager,only:FORCING_FILELIST         ! list of model forcing files
-  USE summaActors_FileManager,only:FORCING_FREQ
   USE summaActors_FileManager,only:FORCING_START
   USE globalData,only:data_step
   USE globalData,only:forc_meta                      ! forcing metadata
diff --git a/build/source/interface/file_access_actor/cppwrap_fileAccess.f90 b/build/source/interface/file_access_actor/cppwrap_fileAccess.f90
index 8173c57..47d9178 100644
--- a/build/source/interface/file_access_actor/cppwrap_fileAccess.f90
+++ b/build/source/interface/file_access_actor/cppwrap_fileAccess.f90
@@ -55,7 +55,6 @@ subroutine mDecisions_C(num_steps,err) bind(C, name='mDecisions_C')
   integer(c_int),intent(inout)        :: num_steps
   integer(c_int),intent(inout)        :: err                ! Error Code
   ! local variables
-  integer(i4b)                        :: iStruct
   character(len=256)                  :: message            ! error message 
   character(LEN=256)                  :: cmessage           ! error message of downwind routine
 
@@ -199,12 +198,8 @@ subroutine Create_Output_File(&
   type(var_i),pointer                  :: ncid              ! ncid of the output file
   character(LEN=256)                   :: startGRUString    ! String Variable to convert startGRU
   character(LEN=256)                   :: numGRUString      ! String Varaible to convert numGRU
-  character(LEN=256)                   :: message
   character(LEN=256)                   :: cmessage
   integer(i4b)                         :: iGRU
-  integer(i4b)                         :: iStruct
-  integer(i4b)                         :: iStep
-  integer(i4b)                         :: iFreq
 
   call c_f_pointer(handle_ncid, ncid)
 
@@ -289,25 +284,18 @@ subroutine FileAccessActor_WriteOutput(&
                                 indxGRU,          & ! index of GRU we are currently writing for
                                 indxHRU,          & ! index of HRU we are currently writing for
                                 err) bind(C, name="FileAccessActor_WriteOutput")
-  USE globalData,only:fileout
-  USE summaActors_FileManager,only:OUTPUT_PATH,OUTPUT_PREFIX         ! define output file
   USE def_output_module,only:def_output                       ! module to define model output
   USE globalData,only:gru_struc
   USE var_lookup,only:maxVarFreq                               ! # of available output frequencies
   USE writeOutput_module,only:writeParm,writeBasin,writeTime,writeData
   USE globalData,only:structInfo
   USE globalData,only:outputStructure
-  USE globalData,only:attr_meta                 ! attributes metadata structure
-  USE globalData,only:type_meta                 ! veg/soil type metadata structure
-  USE globalData,only:mpar_meta                 ! local parameter metadata structure
-  USE globalData,only:bpar_meta                 ! basin parameter metadata structure
   USE var_lookup,only:iLookFreq                 ! named variables for the frequency structure
   USE globalData,only:bvarChild_map             ! index of the child data structure: stats bvar
   USE netcdf_util_module,only:nc_file_close 
   USE netcdf_util_module,only:nc_file_open 
 
   USE globalData,only:outputTimeStep
-  USE globalData,only:finalizeStats
   USE netcdf
 
   implicit none
@@ -320,11 +308,8 @@ subroutine FileAccessActor_WriteOutput(&
   
   ! local variables 
   type(var_i),pointer                  :: ncid
-  character(LEN=256)                   :: startGRUString
-  character(LEN=256)                   :: numGRUString
   character(LEN=256)                   :: message
   character(LEN=256)                   :: cmessage
-  integer(i4b)                         :: iGRU
   integer(i4b)                         :: iStruct
   integer(i4b)                         :: iStep
   integer(i4b)                         :: iFreq
@@ -382,25 +367,8 @@ subroutine FileAccessActor_DeallocateStructures(handle_forcFileInfo, handle_ncid
   USE netcdf_util_module,only:nc_file_close 
   USE globalData,only:structInfo                              ! information on the data structures
   USE globalData,only:vecTime
-  USE globalData,only:statForc_meta                           ! child metadata for stats
-  USE globalData,only:statProg_meta                           ! child metadata for stats
-  USE globalData,only:statDiag_meta                           ! child metadata for stats
-  USE globalData,only:statFlux_meta                           ! child metadata for stats
-  USE globalData,only:statIndx_meta                           ! child metadata for stats
-  USE globalData,only:statBvar_meta                           ! child metadata for stats
-  USE globalData,only:averageFlux_meta                        ! metadata for time-step average fluxes
-  USE globalData,only:forcChild_map                           ! index of the child data structure: stats forc
-  USE globalData,only:progChild_map                           ! index of the child data structure: stats prog
-  USE globalData,only:diagChild_map                           ! index of the child data structure: stats diag
-  USE globalData,only:fluxChild_map                           ! index of the child data structure: stats flux
-  USE globalData,only:indxChild_map                           ! index of the child data structure: stats indx
-  USE globalData,only:bvarChild_map                           ! index of the child data structure: stats bvar
-  USE var_lookup,only:childFLUX_MEAN                          ! look-up values for timestep-average model fluxes
-  USE globalData,only:gru_struc                               ! gru->hru mapping structure
-  USE globalData,only:index_map  
   USE globalData,only:outputTimeStep
   USE summaActors_deallocateOuptutStruct,only:deallocateOutputStruc
-  USE globalData,only:startTime,finshTime,refTime,oldTime
   implicit none
   type(c_ptr),intent(in), value        :: handle_forcFileInfo
   type(c_ptr),intent(in), value        :: handle_ncid
diff --git a/build/source/interface/job_actor/cppwrap_job.f90 b/build/source/interface/job_actor/cppwrap_job.f90
index fdb62f7..8ece46e 100644
--- a/build/source/interface/job_actor/cppwrap_job.f90
+++ b/build/source/interface/job_actor/cppwrap_job.f90
@@ -154,7 +154,7 @@ subroutine cleanUpJobActor(err) bind(C, name='cleanUpJobActor')
 
   implicit none
   integer(c_int), intent(inout)     :: err
-
+  err=0
 
   ! Deallocate Time Varaibles
   deallocate(startTime%var);
diff --git a/config/Summa_Actors_Settings.json b/config/Summa_Actors_Settings.json
index b20a2ee..83b59a0 100644
--- a/config/Summa_Actors_Settings.json
+++ b/config/Summa_Actors_Settings.json
@@ -12,6 +12,6 @@
 
     "HRUActor": {
         "printOutput": true,
-        "outputFrequency": 10
+        "outputFrequency": 1000
     }
 }
\ No newline at end of file
-- 
GitLab