Skip to content

Commit

Permalink
need to always declare and initialize gsflow_ag_actet
Browse files Browse the repository at this point in the history
  • Loading branch information
rsregan committed May 27, 2022
1 parent 6981032 commit 32b11fb
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions GSFLOW/src/prms/climateflow.f90
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ INTEGER FUNCTION climateflow_decl()
& Strmflow_module, Temp_module, Stream_order_flag, GSFLOW_flag, no_snow_flag, &
& Precip_module, Solrad_module, Transp_module, Et_module, PRMS4_flag, &
& Soilzone_module, Srunoff_module, Call_cascade, Et_flag, Dprst_flag, Solrad_flag, &
& AG_flag, PRMS_land_iteration_flag, Ag_gravity_flag, Ag_package
& AG_flag, PRMS_land_iteration_flag, Ag_gravity_flag
USE PRMS_CLIMATEVARS
USE PRMS_FLOWVARS
USE PRMS_IT0_VARS
Expand Down Expand Up @@ -440,12 +440,10 @@ INTEGER FUNCTION climateflow_decl()
& 'Actual ET for each HRU', &
& 'inches', Hru_actet)

IF ( Ag_package==ACTIVE ) THEN
ALLOCATE ( gsflow_ag_actet(Nhru) )
CALL declvar_real(Soilzone_module, 'gsflow_ag_actet', 'nhru', Nhru, &
& 'Agriculture actual ET for GSFLOW simulations for each HRU', &
& 'inches', gsflow_ag_actet)
ENDIF
ALLOCATE ( gsflow_ag_actet(Nhru) )
CALL declvar_real(Soilzone_module, 'gsflow_ag_actet', 'nhru', Nhru, &
& 'Agriculture actual ET for GSFLOW simulations for each HRU', &
& 'inches', gsflow_ag_actet)

CALL declvar_dble(Soilzone_module, 'basin_actet', 'one', 1, &
& 'Basin area-weighted average actual ET', &
Expand Down Expand Up @@ -1060,7 +1058,7 @@ INTEGER FUNCTION climateflow_init()
& Precip_module, Solrad_module, Et_module, PRMS4_flag, no_snow_flag, &
& Soilzone_module, Srunoff_module, Et_flag, Dprst_flag, Solrad_flag, &
& Parameter_check_flag, Inputerror_flag, Humidity_cbh_flag, AG_flag, &
& Glacier_flag, Ag_package
& Glacier_flag
USE PRMS_CLIMATEVARS
USE PRMS_FLOWVARS
USE PRMS_BASIN, ONLY: Elev_units, Active_hrus, Hru_route_order, Hru_perv
Expand Down Expand Up @@ -1413,7 +1411,7 @@ INTEGER FUNCTION climateflow_init()
Soil_to_gw = 0.0
Soil_to_ssr = 0.0
Hru_actet = 0.0
IF ( Ag_package==ACTIVE ) gsflow_ag_actet = 0.0
gsflow_ag_actet = 0.0
Infil = 0.0
Sroff = 0.0
! initialize arrays (dimensioned Nssr)
Expand Down

0 comments on commit 32b11fb

Please sign in to comment.