diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 824826d578..be83da0f3d 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,7 +163,7 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 1844; +my $ntests = 1841; if ( defined($opts{'compare'}) ) { $ntests += 1254; } @@ -771,21 +771,6 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, - "-vic with origflag=1" =>{ options=>"-vichydro -envxml_dir .", - namelst=>"origflag=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm4_5", - }, - "l_bnd=flux with origflag=0"=>{ options=>"-envxml_dir .", - namelst=>"origflag=0, lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm4_5", - }, - "l_bnd=zflux with origflag=0"=>{ options=>"-envxml_dir .", - namelst=>"origflag=0, lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm4_5", - }, "bedrock with l_bnc=flux" =>{ options=>"-envxml_dir .", namelst=>"use_bedrock=.true., lower_boundary_condition=1", GLC_TWO_WAY_COUPLING=>"FALSE", diff --git a/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm index 351bce0a82..5ef1fc660a 100644 --- a/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm @@ -1,4 +1,3 @@ snow_cover_fraction_method = 'NiuYang2007' h2osfcflag = 0 - origflag = 1 use_subgrid_fluxes = .false. diff --git a/src/main/lnd2glcMod.F90 b/src/main/lnd2glcMod.F90 index 2a9931851d..27fa7639d7 100644 --- a/src/main/lnd2glcMod.F90 +++ b/src/main/lnd2glcMod.F90 @@ -20,7 +20,7 @@ module lnd2glcMod use decompMod , only : get_proc_bounds, bounds_type, subgrid_level_column use domainMod , only : ldomain use clm_varpar , only : maxpatch_glc - use clm_varctl , only : iulog + use clm_varctl , only : iulog, use_hillslope use clm_varcon , only : spval, tfrz use column_varcon , only : col_itype_to_ice_class use landunit_varcon , only : istice, istsoil @@ -204,8 +204,16 @@ subroutine update_lnd2glc(this, bounds, num_do_smb_c, filter_do_smb_c, & ! Make sure we haven't already assigned the coupling fields for this point ! (this could happen, for example, if there were multiple columns in the ! istsoil landunit, which we aren't prepared to handle) -!scs if (fields_assigned(g,n)) then - if (1==2) then + ! + ! BUG(wjs, 2022-07-17, ESCOMP/CTSM#204) We have a known bug in the handling of bare + ! land fluxes when we potentially have multiple vegetated columns in a grid cell. + ! The most common configuration where this is the case is when use_hillslope is + ! true. In order to allow hillslope hydrology runs to work for now, we are + ! bypassing this error check when use_hillslope is true - under the assumption + ! that, for now, people aren't going to be interested in SMB in a run with + ! hillslope hydrology. Once we resolve ESCOMP/CTSM#204, we should remove the '.and. + ! .not. use_hillslope' part of this conditional. + if (fields_assigned(g,n) .and. .not. use_hillslope) then write(iulog,*) subname//' ERROR: attempt to assign coupling fields twice for the same index.' write(iulog,*) 'One possible cause is having multiple columns in the istsoil landunit,' write(iulog,*) 'which this routine cannot handle.' diff --git a/src/main/test/atm2lnd_test/test_downscale_forcings.pf b/src/main/test/atm2lnd_test/test_downscale_forcings.pf index d7705f2d56..a6c1a7e356 100644 --- a/src/main/test/atm2lnd_test/test_downscale_forcings.pf +++ b/src/main/test/atm2lnd_test/test_downscale_forcings.pf @@ -9,6 +9,7 @@ module test_downscale_forcings use unittestSimpleSubgridSetupsMod use unittestArrayMod use atm2lndType, only : atm2lnd_type, atm2lnd_params_type + use SurfaceAlbedoType, only : surfalb_type use Wateratm2lndBulkType, only : wateratm2lndbulk_type use WaterInfoBulkType, only : water_info_bulk_type use TopoMod, only : topo_type @@ -25,6 +26,7 @@ module test_downscale_forcings @TestCase type, extends(TestCase) :: TestDownscaleForcings type(atm2lnd_type) :: atm2lnd_inst + type(surfalb_type) :: surfalb_inst type(wateratm2lndbulk_type) :: wateratm2lndbulk_inst type(topo_type_always_downscale) :: topo_inst real(r8), allocatable :: eflx_sh_precip_conversion(:) @@ -204,8 +206,13 @@ contains class(TestDownscaleForcings), intent(inout) :: this this%eflx_sh_precip_conversion = col_array() - call downscale_forcings(bounds, this%topo_inst, & - this%atm2lnd_inst, this%wateratm2lndbulk_inst, & + call downscale_forcings(bounds, & + this%topo_inst, & + this%atm2lnd_inst, & + ! Currently surfalb_inst is only used for hillslope downscaling; we need to pass + ! it to satisfy the interface but we haven't bothered setting it up + this%surfalb_inst, & + this%wateratm2lndbulk_inst, & this%eflx_sh_precip_conversion) end subroutine call_downscale_forcings diff --git a/src/main/test/atm2lnd_test/test_partition_precip.pf b/src/main/test/atm2lnd_test/test_partition_precip.pf index c0d9065007..ba233263ce 100644 --- a/src/main/test/atm2lnd_test/test_partition_precip.pf +++ b/src/main/test/atm2lnd_test/test_partition_precip.pf @@ -5,6 +5,7 @@ module test_partition_precip use pfunit_mod use atm2lndMod use atm2lndType + use ColumnType, only : col use shr_kind_mod, only : r8 => shr_kind_r8 use unittestSubgridMod use unittestSimpleSubgridSetupsMod @@ -64,6 +65,7 @@ contains logical :: l_repartition_rain_snow type(atm2lnd_params_type) :: atm2lnd_params + integer :: c, g if (present(repartition_rain_snow)) then l_repartition_rain_snow = repartition_rain_snow @@ -89,6 +91,15 @@ contains this%wateratm2lndbulk_inst%forc_rain_not_downscaled_grc(bounds%begg:bounds%endg) = rain(:) this%wateratm2lndbulk_inst%forc_snow_not_downscaled_grc(bounds%begg:bounds%endg) = snow(:) this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = temperature(:) + + ! In the production code, column-level versions of forc_rain and forc_snow are + ! initialized to the gridcell-level versions prior to the call to partition_precip; do + ! that here + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%wateratm2lndbulk_inst%forc_rain_downscaled_col(c) = this%wateratm2lndbulk_inst%forc_rain_not_downscaled_grc(g) + this%wateratm2lndbulk_inst%forc_snow_downscaled_col(c) = this%wateratm2lndbulk_inst%forc_snow_not_downscaled_grc(g) + end do end subroutine set_inputs @Test