From dfd3094c555728a2b490d638b2709d8e54373b0a Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 17 Jul 2017 14:01:08 -0600 Subject: [PATCH 001/144] 'pull ctsm_n01_clm4_5_16_r249 tags from svn' --- ChangeLog_branch | 142 ++++++++++++++++++++++++++++ ChangeLog_branch_template | 83 ++++++++++++++++ src/biogeophys/SoilHydrologyMod.F90 | 6 +- 3 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 ChangeLog_branch create mode 100644 ChangeLog_branch_template diff --git a/ChangeLog_branch b/ChangeLog_branch new file mode 100644 index 0000000000..74c338f66a --- /dev/null +++ b/ChangeLog_branch @@ -0,0 +1,142 @@ +=============================================================== +Tag name: ctsm_n01_clm4_5_16_r249 +Originator(s): sacks +Date: July 7, 2017 +One-line Summary: If using VIC, don't use the TOPModel formulation for SurfaceRunoff ever + +Purpose of changes +------------------ + +The code was using the TOPModel-based formulation for SurfaceRunoff if +frost_table > zwt_perched. Sean Swenson felt this shouldn't be done, and +refactoring will be easier if VIC always uses the vic-looking formulation, so +I'm stopping applying this formulation when using VIC. + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - not run + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - just ran vic tests + yellowstone_pgi - just ran vic tests + yellowstone_gnu - not run + cheyenne_intel - just ran vic tests + hobart_nag - not run + hobart_pgi - not run + hobart_intel - not run + + Just ran the following vic tests (all of the vic tests in the test list): + + ERP_D_Ld5.f09_g17.I2000Clm50Vic.yellowstone_intel.clm-vrtlay + ERP_Ld5.f09_g17.I2000Clm50Vic.yellowstone_pgi.clm-vrtlay + ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_intel.clm-vrtlay + ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_pgi.clm-decStart + SMS_Ld1.f19_g17.I2000Clm50Vic.yellowstone_intel.clm-default + ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay + ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_intel.clm-vrtlay + SMS_Ld1.f19_g17.I2000Clm50Vic.cheyenne_intel.clm-default + +CLM tag used for the baseline comparisons: clm4_5_16_r249 + + For baseline comparisons, just spot-checked one test: + ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay + + This test changed answers + +Answer changes +-------------- + +Changes answers relative to baseline: + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: Vic configurations + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff; not investigated closely + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: + +========= Track changes for this branch +A ChangeLog_branch_template +A ChangeLog_branch + +List all existing files that have been modified, and describe the changes: + +========= Changes as described above +M components/clm/src/biogeophys/SoilHydrologyMod.F90 + +=============================================================== +=============================================================== +Tag name: ctsm_n00_clm4_5_16_r249 +Originator(s): sacks +Date: July 7, 2017 +One-line Summary: Baseline tag corresponding to clm4_5_16_r249 + +Purpose of changes +------------------ + +N/A + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: No additional testing beyond trunk tag + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: none + +=============================================================== diff --git a/ChangeLog_branch_template b/ChangeLog_branch_template new file mode 100644 index 0000000000..eb2375df86 --- /dev/null +++ b/ChangeLog_branch_template @@ -0,0 +1,83 @@ +=============================================================== +Tag name: +Originator(s): +Date: +One-line Summary: + +Purpose of changes +------------------ + +[Fill this in with details] + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - + + unit-tests (components/clm/src): + + yellowstone - + + tools-tests (components/clm/test/tools): + + yellowstone - + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - + + regular tests (aux_clm): + + yellowstone_intel - + yellowstone_pgi - + yellowstone_gnu - + cheyenne_intel - + hobart_nag - + hobart_pgi - + hobart_intel - + +CLM tag used for the baseline comparisons: + + +Answer changes +-------------- + +Changes answers relative to baseline: + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: + - what platforms/compilers: + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: + + URL for LMWG diagnostics output used to validate new climate: + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: + +=============================================================== diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 9458527847..900144ac53 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -239,8 +239,10 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) end if else - if ( frost_table(c) > zwt_perched(c)) then - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt_perched(c))!*( frost_table(c) - zwt_perched(c))/4.0 + if ( frost_table(c) > zwt_perched(c)) then + if (.not. use_vichydro) then + fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt_perched(c))!*( frost_table(c) - zwt_perched(c))/4.0 + end if endif endif if (origflag == 1) then From b6191a1ff268d1603e7e93e388ad5d3f3948b3b3 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 17 Jul 2017 14:52:12 -0600 Subject: [PATCH 002/144] 'pull ctsm_n02_clm4_5_16_r249 tags from svn' --- src/biogeophys/HydrologyNoDrainageMod.F90 | 18 +- src/biogeophys/LakeHydrologyMod.F90 | 4 +- src/biogeophys/SnowHydrologyMod.F90 | 6 +- .../SoilHydrologyInitTimeConstMod.F90 | 2 - src/biogeophys/SoilHydrologyMod.F90 | 301 ++++++++++-------- src/biogeophys/SoilHydrologyType.F90 | 12 +- src/biogeophys/WaterfluxType.F90 | 2 + 7 files changed, 200 insertions(+), 145 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index a26eb6be74..34e4c03711 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -48,16 +48,6 @@ subroutine HydrologyNoDrainage(bounds, & ! !DESCRIPTION: ! This is the main subroutine to execute the calculation of soil/snow ! hydrology - ! Calling sequence is: - ! -> SnowWater: change of snow mass and snow water onto soil - ! -> SurfaceRunoff: surface runoff - ! -> Infiltration: infiltration into surface soil layer - ! -> SoilWater: soil water movement between layers - ! -> Tridiagonal tridiagonal matrix solution - ! -> Drainage: subsurface runoff - ! -> SnowCompaction: compaction of snow layers - ! -> CombineSnowLayers: combine snow layers that are thinner than minimum - ! -> DivideSnowLayers: subdivide snow layers that are thicker than maximum ! ! !USES: use clm_varcon , only : denh2o, denice, hfus, grav, tfrz @@ -69,7 +59,8 @@ subroutine HydrologyNoDrainage(bounds, & use clm_time_manager , only : get_step_size, get_nstep use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter - use SoilHydrologyMod , only : CLMVICMap, SurfaceRunoff, Infiltration, WaterTable, PerchedWaterTable + use SoilHydrologyMod , only : CLMVICMap, SetFracIce, SurfaceRunoff + use SoilHydrologyMod , only : SetQflxTopSoil, Infiltration, WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation use SoilWaterMovementMod , only : SoilWater use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type @@ -182,9 +173,14 @@ subroutine HydrologyNoDrainage(bounds, & soilhydrology_inst, waterstate_inst) end if + call SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, waterstate_inst) + call SurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & soilhydrology_inst, soilstate_inst, waterflux_inst, waterstate_inst) + call SetQflxTopSoil(bounds, num_hydrologyc, filter_hydrologyc, waterflux_inst) + call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & waterflux_inst, waterstate_inst) diff --git a/src/biogeophys/LakeHydrologyMod.F90 b/src/biogeophys/LakeHydrologyMod.F90 index 28a65cc1df..8a9729da17 100644 --- a/src/biogeophys/LakeHydrologyMod.F90 +++ b/src/biogeophys/LakeHydrologyMod.F90 @@ -190,6 +190,7 @@ subroutine LakeHydrology(bounds, & qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Output: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes qflx_runoff => waterflux_inst%qflx_runoff_col , & ! Output: [real(r8) (:) ] total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) qflx_ice_runoff_snwcp => waterflux_inst%qflx_ice_runoff_snwcp_col, & ! Output: [real(r8) (:)] solid runoff from snow capping (mm H2O /s) + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Output: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) eflx_snomelt => energyflux_inst%eflx_snomelt_col , & ! Output: [real(r8) (:) ] snow melt heat flux (W/m**2) @@ -631,7 +632,8 @@ subroutine LakeHydrology(bounds, & (endwb(c)-begwb(c))/dtime + qflx_floodg(g) qflx_floodc(c) = qflx_floodg(g) qflx_runoff(c) = qflx_drain(c) + qflx_qrgwl(c) - qflx_top_soil(c) = qflx_prec_grnd_rain(p) + qflx_snow_drain(c) + qflx_rain_plus_snomelt(c) = qflx_prec_grnd_rain(p) + qflx_snow_drain(c) + qflx_top_soil(c) = qflx_rain_plus_snomelt(c) qflx_ice_runoff_snwcp(c) = qflx_snwcp_ice(c) enddo diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index 2e4ccdc50f..a57641f39c 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -299,7 +299,7 @@ subroutine SnowWater(bounds, & qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Input: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] qflx_snow_drain => waterflux_inst%qflx_snow_drain_col,& ! Output: [real(r8) (:) ] net snow melt - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Output: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) mss_bcphi => aerosol_inst%mss_bcphi_col , & ! Output: [real(r8) (:,:) ] hydrophillic BC mass in snow (col,lyr) [kg] @@ -538,7 +538,7 @@ subroutine SnowWater(bounds, & ! Qout from snow bottom qflx_snow_drain(c) = qflx_snow_drain(c) + (qout(c) / dtime) - qflx_top_soil(c) = (qout(c) / dtime) & + qflx_rain_plus_snomelt(c) = (qout(c) / dtime) & + (1.0_r8 - frac_sno_eff(c)) * qflx_rain_grnd(c) int_snow(c) = int_snow(c) + frac_sno_eff(c) & * (qflx_dew_snow(c) + qflx_dew_grnd(c) + qflx_rain_grnd(c)) * dtime @@ -548,7 +548,7 @@ subroutine SnowWater(bounds, & c = filter_nosnowc(fc) qflx_snow_drain(c) = qflx_snomelt(c) - qflx_top_soil(c) = qflx_rain_grnd(c) + qflx_snomelt(c) + qflx_rain_plus_snomelt(c) = qflx_rain_grnd(c) + qflx_snomelt(c) ! reset accumulated snow when no snow present if (h2osno(c) <= 0._r8) then int_snow(c) = 0._r8 diff --git a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 index 37b79670a0..6b56bafb65 100644 --- a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 +++ b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 @@ -169,8 +169,6 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) end do do c = bounds%begc, bounds%endc - soilhydrology_inst%max_infil_col(c) = spval - soilhydrology_inst%i_0_col(c) = spval do lev = 1, nlayer soilhydrology_inst%ice_col(c,lev) = spval soilhydrology_inst%moist_col(c,lev) = spval diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 900144ac53..dac58816e6 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -6,9 +6,11 @@ module SoilHydrologyMod ! use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg + use abortutils , only : endrun use decompMod , only : bounds_type use clm_varctl , only : iulog, use_vichydro use clm_varcon , only : e_ice, denh2o, denice, rpi, aquifer_water_baseline + use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use EnergyFluxType , only : energyflux_type use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type @@ -25,7 +27,9 @@ module SoilHydrologyMod ! ! !PUBLIC MEMBER FUNCTIONS: public :: SoilHydReadNML ! Read in the Soil hydrology namelist + public :: SetFracIce ! Set diagnostic variables related to the fraction of ice in each layer public :: SurfaceRunoff ! Calculate surface runoff + public :: SetQflxTopSoil ! Set the flux of water into the soil from the top public :: Infiltration ! Calculate infiltration into surface soil layer public :: WaterTable ! Calculate water table before imposing drainage public :: Drainage ! Calculate subsurface drainage @@ -57,7 +61,6 @@ subroutine soilHydReadNML( NLFilename ) use shr_mpi_mod , only : shr_mpi_bcast use clm_varctl , only : iulog use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun ! ! !ARGUMENTS: character(len=*), intent(in) :: NLFilename ! Namelist filename @@ -102,6 +105,66 @@ subroutine soilHydReadNML( NLFilename ) end subroutine soilhydReadNML + !----------------------------------------------------------------------- + subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, waterstate_inst) + ! + ! !DESCRIPTION: + ! Set diagnostic variables related to the fraction of ice in each layer + ! + ! !USES: + use clm_varcon, only : denice + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(soilhydrology_type) , intent(inout) :: soilhydrology_inst + type(soilstate_type) , intent(in) :: soilstate_inst + type(waterstate_type) , intent(in) :: waterstate_inst + ! + ! !LOCAL VARIABLES: + integer :: j, fc, c + real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) !partial volume of ice lens in layer + + character(len=*), parameter :: subname = 'SetFracIce' + !----------------------------------------------------------------------- + + associate( & + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) + + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + + h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) + h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) + + origflag => soilhydrology_inst%origflag , & ! Input: logical + icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ] + fracice => soilhydrology_inst%fracice_col & ! Output: [real(r8) (:,:) ] fractional impermeability (-) + ) + + do j = 1,nlevsoi + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + + ! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer, + ! fractional impermeability + + vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) + if (origflag == 1) then + icefrac(c,j) = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) + else + icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) + endif + + fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac(c,j)))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) + end do + end do + + end associate + + end subroutine SetFracIce + !----------------------------------------------------------------------- subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, waterflux_inst, & @@ -111,13 +174,10 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & ! Calculate surface runoff ! ! !USES: - use clm_varcon , only : denice, denh2o, wimp, pondmx_urban + use clm_varcon , only : pondmx_urban use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_imperv, icol_road_perv - use clm_varpar , only : nlevsoi, maxpatch_pft + use column_varcon , only : icol_road_imperv use clm_time_manager, only : get_step_size - use clm_varpar , only : nlayer, nlayert - use abortutils , only : endrun ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -131,120 +191,64 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & type(waterstate_type) , intent(inout) :: waterstate_inst ! ! !LOCAL VARIABLES: - integer :: c,j,fc,g,l,i !indices + integer :: c,fc,g,l,i !indices real(r8) :: dtime !land model time step (sec) real(r8) :: xs(bounds%begc:bounds%endc) !excess soil water above urban ponding limit - real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) !partial volume of ice lens in layer - real(r8) :: fff(bounds%begc:bounds%endc) !decay factor (m-1) + real(r8) :: fff !decay factor (m-1) real(r8) :: s1 !variable to calculate qinmax real(r8) :: su !variable to calculate qinmax real(r8) :: v !variable to calculate qinmax real(r8) :: qinmax !maximum infiltration capacity (mm/s) - real(r8) :: A(bounds%begc:bounds%endc) !fraction of the saturated area real(r8) :: ex(bounds%begc:bounds%endc) !temporary variable (exponent) - real(r8) :: top_moist(bounds%begc:bounds%endc) !temporary, soil moisture in top VIC layers - real(r8) :: top_max_moist(bounds%begc:bounds%endc) !temporary, maximum soil moisture in top VIC layers - real(r8) :: top_ice(bounds%begc:bounds%endc) !temporary, ice len in top VIC layers character(len=32) :: subname = 'SurfaceRunoff' !subroutine name !----------------------------------------------------------------------- associate( & snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) wtfact => soilstate_inst%wtfact_col , & ! Input: [real(r8) (:) ] maximum saturated fraction for a gridcell - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:) ] snow falling on surface water (mm/s) qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq, mm) frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter - moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil moisture in each VIC layers (liq, mm) - hkdepth => soilhydrology_inst%hkdepth_col , & ! Input: [real(r8) (:) ] decay factor (m) origflag => soilhydrology_inst%origflag , & ! Input: logical fcov => soilhydrology_inst%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area fsat => soilhydrology_inst%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface - fracice => soilhydrology_inst%fracice_col , & ! Output: [real(r8) (:,:) ] fractional impermeability (-) - icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ] - ice => soilhydrology_inst%ice_col , & ! Output: [real(r8) (:,:) ] ice len in each VIC layers(ice, mm) - max_infil => soilhydrology_inst%max_infil_col , & ! Output: [real(r8) (:) ] maximum infiltration capacity in VIC (mm) - i_0 => soilhydrology_inst%i_0_col & ! Output: [real(r8) (:) ] column average soil moisture in top VIC layers (mm) + fracice => soilhydrology_inst%fracice_col , & ! Input: [real(r8) (:,:) ] fractional impermeability (-) + top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers + top_moist_limited => soilhydrology_inst%top_moist_limited_col & ! Input: [real(r8) (:) ] soil moisture in top layers, limited to no greater than top_max_moist ) ! Get time step dtime = get_step_size() - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer, - ! fractional impermeability - - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - if (origflag == 1) then - icefrac(c,j) = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) - else - icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - endif - - fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac(c,j)))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) - end do - end do - ! Saturated fraction do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - fff(c) = 0.5_r8 if (use_vichydro) then - top_moist(c) = 0._r8 - top_ice(c) = 0._r8 - top_max_moist(c) = 0._r8 - do j = 1, nlayer - 1 - top_ice(c) = top_ice(c) + ice(c,j) - top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) - top_max_moist(c) = top_max_moist(c) + max_moist(c,j) - end do - if(top_moist(c)> top_max_moist(c)) top_moist(c)= top_max_moist(c) - top_ice(c) = max(0._r8,top_ice(c)) - max_infil(c) = (1._r8+b_infil(c)) * top_max_moist(c) ex(c) = b_infil(c) / (1._r8 + b_infil(c)) - A(c) = 1._r8 - (1._r8 - top_moist(c) / top_max_moist(c))**ex(c) - i_0(c) = max_infil(c) * (1._r8 - (1._r8 - A(c))**(1._r8/b_infil(c))) - fsat(c) = A(c) !for output + ! fsat is equivalent to A in VIC papers + fsat(c) = 1._r8 - (1._r8 - top_moist_limited(c) / top_max_moist(c))**ex(c) else - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) - end if - - ! use perched water table to determine fsat (if present) - if ( frost_table(c) > zwt(c)) then - if (use_vichydro) then - fsat(c) = A(c) + fff = 0.5_r8 + if (frost_table(c) > zwt_perched(c) .and. frost_table(c) <= zwt(c)) then + ! use perched water table to determine fsat (if present) + fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt_perched(c))!*( frost_table(c) - zwt_perched(c))/4.0 else - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) + fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt(c)) end if - else - if ( frost_table(c) > zwt_perched(c)) then - if (.not. use_vichydro) then - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt_perched(c))!*( frost_table(c) - zwt_perched(c))/4.0 - end if - endif - endif + end if + if (origflag == 1) then if (use_vichydro) then call endrun(msg="VICHYDRO is not available for origflag=1"//errmsg(sourcefile, __LINE__)) @@ -259,34 +263,51 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - ! assume qinmax large relative to qflx_top_soil in control + ! assume qinmax large relative to qflx_rain_plus_snomelt in control if (origflag == 1) then - qflx_surf(c) = fcov(c) * qflx_top_soil(c) + qflx_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) else + ! FIXME(wjs, 2017-07-09) If origflag /= 1, then fcov = fsat. So let's remove + ! this origflag conditional and just use fcov. (First, though, make sure + ! origflag /= 1 is covered by at least one test.) ! only send fast runoff directly to streams - qflx_surf(c) = fsat(c) * qflx_top_soil(c) + qflx_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) endif end do ! Determine water in excess of ponding limit for urban roof and impervious road. ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. + ! FIXME(wjs, 2017-07-07) Put this in a different routine, specific to urban? I + ! think it makes sense to keep it in the new SurfaceRunoff module, but maybe in a + ! separate routine. + ! + ! FIXME(wjs, 2017-07-07) Remove the state updates from that routine, putting them + ! in their own routine? For now, call it immediately afterwards in order to + ! maintain bfb. To do that extraction, I think I'll need to save xs. + ! + ! FIXME(wjs, 2017-07-07) So the new urban routine will set: + ! - qflx_surf for urban points + ! - xs_urban_roof_and_impervroad + ! + ! FIXME(wjs, 2017-07-07) Then we'll have an additional routine that updates + ! h2osoi_liq for urban roof and impervroad, if snl(c) == 0. do fc = 1, num_urbanc c = filter_urbanc(fc) if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - ! If there are snow layers then all qflx_top_soil goes to surface runoff + ! If there are snow layers then all qflx_rain_plus_snomelt goes to surface runoff if (snl(c) < 0) then - qflx_surf(c) = max(0._r8,qflx_top_soil(c)) + qflx_surf(c) = max(0._r8,qflx_rain_plus_snomelt(c)) else xs(c) = max(0._r8, & - h2osoi_liq(c,1)/dtime + qflx_top_soil(c) - qflx_evap_grnd(c) - & + h2osoi_liq(c,1)/dtime + qflx_rain_plus_snomelt(c) - qflx_evap_grnd(c) - & pondmx_urban/dtime) if (xs(c) > 0.) then h2osoi_liq(c,1) = pondmx_urban else h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & - (qflx_top_soil(c)-qflx_evap_grnd(c))*dtime) + (qflx_rain_plus_snomelt(c)-qflx_evap_grnd(c))*dtime) end if qflx_surf(c) = xs(c) end if @@ -298,17 +319,46 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & end do - ! remove stormflow and snow on h2osfc from qflx_top_soil - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! add flood water flux to qflx_top_soil - qflx_top_soil(c) = qflx_top_soil(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) - end do - end associate end subroutine SurfaceRunoff + !----------------------------------------------------------------------- + subroutine SetQflxTopSoil(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst) + ! + ! !DESCRIPTION: + ! Set the flux of water into the soil from the top + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(waterflux_type) , intent(inout) :: waterflux_inst + ! + ! !LOCAL VARIABLES: + integer :: fc, c + + character(len=*), parameter :: subname = 'SetQflxTopSoil' + !----------------------------------------------------------------------- + + associate( & + qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:)] net water input into soil from top (mm/s) + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:)] rain plus snow melt falling on the soil (mm/s) + qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:)] snow falling on surface water (mm/s) + qflx_floodc => waterflux_inst%qflx_floodc_col & ! Input: [real(r8) (:)] column flux of flood water from RTM + ) + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + qflx_top_soil(c) = qflx_rain_plus_snomelt(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) + end do + + end associate + + end subroutine SetQflxTopSoil + + !----------------------------------------------------------------------- subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & @@ -319,8 +369,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f ! ! !USES: use shr_const_mod , only : shr_const_pi - use clm_varpar , only : nlayer, nlayert - use clm_varpar , only : nlevsoi use clm_varcon , only : denh2o, denice, roverg, wimp, pc, mu, tfrz use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv use landunit_varcon , only : istsoil, istcrop @@ -368,9 +416,8 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f real(r8) :: basis ! temporary, variable soil moisture holding capacity ! in top VIC layers for runoff calculation real(r8) :: rsurf_vic ! temp VIC surface runoff - real(r8) :: top_moist(bounds%begc:bounds%endc) ! temporary, soil moisture in top VIC layers - real(r8) :: top_max_moist(bounds%begc:bounds%endc) ! temporary, maximum soil moisture in top VIC layers - real(r8) :: top_ice(bounds%begc:bounds%endc) ! temporary, ice len in top VIC layers + real(r8) :: i_0(bounds%begc:bounds%endc) ! average soil moisture in top VIC layers (mm) + real(r8) :: max_infil(bounds%begc:bounds%endc) ! max infiltration capacity in VIC (mm) real(r8) :: top_icefrac ! temporary, ice fraction in top VIC layers !----------------------------------------------------------------------- @@ -405,15 +452,12 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - fcov => soilhydrology_inst%fcov_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil moisture in each VIC layers (liq, mm) - max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq, mm) - max_infil => soilhydrology_inst%max_infil_col , & ! Input: [real(r8) (:) ] maximum infiltration capacity in VIC (mm) - ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] ice len in each VIC layers(ice, mm) - i_0 => soilhydrology_inst%i_0_col , & ! Input: [real(r8) (:) ] column average soil moisture in top VIC layers (mm) + top_moist => soilhydrology_inst%top_moist_col , & ! Input: [real(r8) (:) ] soil moisture in top VIC layers + top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers + top_ice => soilhydrology_inst%top_ice_col , & ! Input: [real(r8) (:) ] ice len in top VIC layers h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical icefrac => soilhydrology_inst%icefrac_col & ! Output: [real(r8) (:,:) ] fraction of ice ) @@ -456,15 +500,9 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f !3. determine maximum infiltration rate if (use_vichydro) then - top_moist(c)= 0._r8 - top_ice(c)=0._r8 - top_max_moist(c)= 0._r8 - do j = 1, nlayer - 1 - top_ice(c) = top_ice(c) + ice(c,j) - top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) - top_max_moist(c) = top_max_moist(c) + max_moist(c,j) - end do top_icefrac = min(1._r8,top_ice(c)/top_max_moist(c)) + max_infil(c) = (1._r8+b_infil(c)) * top_max_moist(c) + i_0(c) = max_infil(c) * (1._r8 - (1._r8 - fsat(c))**(1._r8/b_infil(c))) if(qflx_in_soil(c) <= 0._r8) then rsurf_vic = 0._r8 else if(max_infil(c) <= 0._r8) then @@ -578,7 +616,6 @@ subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, fil ! !USES: use clm_time_manager , only : get_step_size use clm_varcon , only : pondmx, tfrz, watmin,denice,denh2o - use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: @@ -601,7 +638,6 @@ subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, fil integer :: jwt(bounds%begc:bounds%endc) ! index of the soil layer right above the water table (-) real(r8) :: rsub_bot(bounds%begc:bounds%endc) ! subsurface runoff - bottom drainage (mm/s) real(r8) :: rsub_top(bounds%begc:bounds%endc) ! subsurface runoff - topographic control (mm/s) - real(r8) :: fff(bounds%begc:bounds%endc) ! decay factor (m-1) real(r8) :: xsi(bounds%begc:bounds%endc) ! excess soil water above saturation at layer i (mm) real(r8) :: rous ! aquifer yield (-) real(r8) :: wh ! smpfz(jwt)-z(jwt) (mm) @@ -611,7 +647,6 @@ subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, fil real(r8) :: icefracsum ! summation of icefrac*dzmm of layers below water table (-) real(r8) :: fracice_rsub(bounds%begc:bounds%endc) ! fractional impermeability of soil layers (-) real(r8) :: ka ! hydraulic conductivity of the aquifer (mm/s) - real(r8) :: dza ! fff*(zwt-z(jwt)) (-) real(r8) :: available_h2osoi_liq ! available soil liquid water in a layer real(r8) :: imped real(r8) :: rsub_top_tot @@ -887,10 +922,8 @@ subroutine Drainage(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filte ! ! !USES: use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv - use abortutils , only : endrun ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -1462,7 +1495,6 @@ subroutine CLMVICMap(bounds, numf, filter, & ! ! !USES: use clm_varcon , only : denh2o, denice, watmin - use clm_varpar , only : nlevsoi, nlayer, nlayert, nlevgrnd use decompMod , only : bounds_type ! ! !REVISION HISTORY: @@ -1499,7 +1531,11 @@ subroutine CLMVICMap(bounds, numf, filter, & vic_clm_fract => soilhydrology_inst%vic_clm_fract_col , & ! Input: [real(r8) (:,:,:) ] fraction of VIC layers in each CLM layer moist => soilhydrology_inst%moist_col , & ! Output: [real(r8) (:,:) ] liquid water (mm) ice => soilhydrology_inst%ice_col , & ! Output: [real(r8) (:,:) ] ice lens (mm) - moist_vol => soilhydrology_inst%moist_vol_col & ! Output: [real(r8) (:,:) ] volumetric soil moisture for VIC soil layers + moist_vol => soilhydrology_inst%moist_vol_col , & ! Output: [real(r8) (:,:) ] volumetric soil moisture for VIC soil layers + top_moist => soilhydrology_inst%top_moist_col , & ! Output: [real(r8) (:) ] soil moisture in top VIC layers + top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Output: [real(r8) (:) ] maximum soil moisture in top VIC layers + top_ice => soilhydrology_inst%top_ice_col , & ! Output: [real(r8) (:) ] ice len in top VIC layers + top_moist_limited => soilhydrology_inst%top_moist_limited_col & ! Output: [real(r8) (:) ] soil moisture in top layers, limited to no greater than top_max_moist ) ! map CLM to VIC @@ -1529,6 +1565,30 @@ subroutine CLMVICMap(bounds, numf, filter, & moist_vol(c, nlayer+1:nlayert) = h2osoi_vol(c, nlevsoi+1:nlevgrnd) end do + ! Set values related to top VIC layers + ! FIXME(wjs, 2017-07-09) Probably extract the following into its own routine + + do fc = 1, numf + c = filter(fc) + top_moist(c) = 0._r8 + top_ice(c) = 0._r8 + top_max_moist(c) = 0._r8 + end do + + do j = 1, nlayer - 1 + do fc = 1, numf + c = filter(fc) + top_ice(c) = top_ice(c) + ice(c,j) + top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) + top_max_moist(c) = top_max_moist(c) + max_moist(c,j) + end do + end do + + do fc = 1, numf + c = filter(fc) + top_moist_limited(c) = min(top_moist(c), top_max_moist(c)) + end do + end associate end subroutine CLMVICMap @@ -1544,7 +1604,6 @@ subroutine PerchedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use clm_varcon , only : pondmx, tfrz, watmin,denice,denh2o - use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: @@ -1667,10 +1726,8 @@ subroutine PerchedLateralFlow(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv - use abortutils , only : endrun ! ! !ARGUMENTS: @@ -1830,7 +1887,6 @@ subroutine ThetaBasedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use clm_varcon , only : denice,denh2o - use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: @@ -1928,10 +1984,8 @@ subroutine LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use clm_varcon , only : pondmx, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv - use abortutils , only : endrun use GridcellType , only : grc ! @@ -2258,7 +2312,6 @@ subroutine RenewCondensation(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: diff --git a/src/biogeophys/SoilHydrologyType.F90 b/src/biogeophys/SoilHydrologyType.F90 index 33aee7efda..e867e9f28f 100644 --- a/src/biogeophys/SoilHydrologyType.F90 +++ b/src/biogeophys/SoilHydrologyType.F90 @@ -49,8 +49,10 @@ Module SoilHydrologyType real(r8), pointer :: moist_col (:,:) ! col VIC soil moisture (kg/m2) for VIC soil layers real(r8), pointer :: moist_vol_col (:,:) ! col VIC volumetric soil moisture for VIC soil layers real(r8), pointer :: max_moist_col (:,:) ! col VIC max layer moist + ice (mm) - real(r8), pointer :: max_infil_col (:) ! col VIC maximum infiltration rate calculated in VIC - real(r8), pointer :: i_0_col (:) ! col VIC average saturation in top soil layers + real(r8), pointer :: top_moist_col (:) ! col VIC soil moisture in top layers + real(r8), pointer :: top_max_moist_col (:) ! col VIC maximum soil moisture in top layers + real(r8), pointer :: top_ice_col (:) ! col VIC ice len in top layers + real(r8), pointer :: top_moist_limited_col(:) ! col VIC soil moisture in top layers, limited to no greater than top_max_moist_col real(r8), pointer :: ice_col (:,:) ! col VIC soil ice (kg/m2) for VIC soil layers contains @@ -139,8 +141,10 @@ subroutine InitAllocate(this, bounds) allocate(this%moist_col (begc:endc,nlayert)) ; this%moist_col (:,:) = nan allocate(this%moist_vol_col (begc:endc,nlayert)) ; this%moist_vol_col (:,:) = nan allocate(this%max_moist_col (begc:endc,nlayer)) ; this%max_moist_col (:,:) = nan - allocate(this%max_infil_col (begc:endc)) ; this%max_infil_col (:) = nan - allocate(this%i_0_col (begc:endc)) ; this%i_0_col (:) = nan + allocate(this%top_moist_col (begc:endc)) ; this%top_moist_col (:) = nan + allocate(this%top_max_moist_col (begc:endc)) ; this%top_max_moist_col (:) = nan + allocate(this%top_ice_col (begc:endc)) ; this%top_ice_col (:) = nan + allocate(this%top_moist_limited_col(begc:endc)) ; this%top_moist_limited_col(:) = nan allocate(this%ice_col (begc:endc,nlayert)) ; this%ice_col (:,:) = nan end subroutine InitAllocate diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index 7311d71ba6..ff8d9f661f 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -75,6 +75,7 @@ module WaterfluxType real(r8), pointer :: qflx_infl_col (:) ! col infiltration (mm H2O /s) real(r8), pointer :: qflx_surf_col (:) ! col surface runoff (mm H2O /s) real(r8), pointer :: qflx_drain_col (:) ! col sub-surface runoff (mm H2O /s) + real(r8), pointer :: qflx_rain_plus_snomelt_col(:) ! col rain plus snow melt falling on the soil (mm/s) real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) real(r8), pointer :: qflx_h2osfc_to_ice_col (:) ! col conversion of h2osfc to ice real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff @@ -216,6 +217,7 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_infl_col (begc:endc)) ; this%qflx_infl_col (:) = nan allocate(this%qflx_surf_col (begc:endc)) ; this%qflx_surf_col (:) = nan allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan + allocate(this%qflx_rain_plus_snomelt_col(begc:endc)) ; this%qflx_rain_plus_snomelt_col(:) = nan allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan allocate(this%qflx_h2osfc_to_ice_col (begc:endc)) ; this%qflx_h2osfc_to_ice_col (:) = nan allocate(this%qflx_h2osfc_surf_col (begc:endc)) ; this%qflx_h2osfc_surf_col (:) = nan From 0252134a232b7a177c4947d69e96bdda08d43a9e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 17 Jul 2017 14:55:28 -0600 Subject: [PATCH 003/144] 'pull ctsm_n03_clm4_5_16_r249 tags from svn' --- src/biogeochem/ch4Mod.F90 | 2 +- src/biogeophys/BalanceCheckMod.F90 | 6 +- src/biogeophys/HydrologyDrainageMod.F90 | 5 +- src/biogeophys/HydrologyNoDrainageMod.F90 | 6 +- src/biogeophys/LakeHydrologyMod.F90 | 2 - src/biogeophys/SoilHydrologyMod.F90 | 154 +++++++++++++----- src/biogeophys/WaterfluxType.F90 | 12 +- src/cpl/lnd_import_export.F90 | 4 +- src/main/ColumnType.F90 | 5 + src/main/initSubgridMod.F90 | 1 + src/main/lnd2atmMod.F90 | 5 - src/main/lnd2atmType.F90 | 2 - .../SoilBiogeochemNLeachingMod.F90 | 2 +- 13 files changed, 138 insertions(+), 68 deletions(-) diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 index 4114902af3..787aebbc24 100644 --- a/src/biogeochem/ch4Mod.F90 +++ b/src/biogeochem/ch4Mod.F90 @@ -1725,7 +1725,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) tws => waterstate_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) + qflx_surf => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s) conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) zwt0 => ch4_inst%zwt0_col , & ! Input: [real(r8) (:) ] decay factor for finundated (m) diff --git a/src/biogeophys/BalanceCheckMod.F90 b/src/biogeophys/BalanceCheckMod.F90 index 115a09a617..f71b9aaa8b 100644 --- a/src/biogeophys/BalanceCheckMod.F90 +++ b/src/biogeophys/BalanceCheckMod.F90 @@ -179,7 +179,6 @@ subroutine BalanceCheck( bounds, & qflx_h2osfc_to_ice => waterflux_inst%qflx_h2osfc_to_ice_col , & ! Input: [real(r8) (:) ] conversion of h2osfc to ice qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] total runoff due to flooding - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Input: [real(r8) (:) ] surface water runoff (mm/s) qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Input: [real(r8) (:) ] drainage from snow pack qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Input: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes @@ -270,7 +269,6 @@ subroutine BalanceCheck( bounds, & + qflx_glcice_dyn_water_flux(c) & - qflx_evap_tot(c) & - qflx_surf(c) & - - qflx_h2osfc_surf(c) & - qflx_qrgwl(c) & - qflx_drain(c) & - qflx_drain_perched(c) & @@ -318,7 +316,6 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'qflx_evap_tot = ',qflx_evap_tot(indexc)*dtime write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc)*dtime write(iulog,*)'qflx_surf = ',qflx_surf(indexc)*dtime - write(iulog,*)'qflx_h2osfc_surf = ',qflx_h2osfc_surf(indexc)*dtime write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc)*dtime write(iulog,*)'qflx_drain = ',qflx_drain(indexc)*dtime write(iulog,*)'qflx_ice_runoff_snwcp = ',qflx_ice_runoff_snwcp(indexc)*dtime @@ -330,7 +327,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'deltawb = ',endwb(indexc)-begwb(indexc) write(iulog,*)'deltawb/dtime = ',(endwb(indexc)-begwb(indexc))/dtime write(iulog,*)'deltaflux = ',forc_rain_col(indexc)+forc_snow_col(indexc) - (qflx_evap_tot(indexc) + & - qflx_surf(indexc)+qflx_h2osfc_surf(indexc)+qflx_drain(indexc)) + qflx_surf(indexc)+qflx_drain(indexc)) write(iulog,*)'clm model is stopping' call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) @@ -349,7 +346,6 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'qflx_evap_tot = ',qflx_evap_tot(indexc)*dtime write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc)*dtime write(iulog,*)'qflx_surf = ',qflx_surf(indexc)*dtime - write(iulog,*)'qflx_h2osfc_surf = ',qflx_h2osfc_surf(indexc)*dtime write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc)*dtime write(iulog,*)'qflx_drain = ',qflx_drain(indexc)*dtime write(iulog,*)'qflx_drain_perched = ',qflx_drain_perched(indexc)*dtime diff --git a/src/biogeophys/HydrologyDrainageMod.F90 b/src/biogeophys/HydrologyDrainageMod.F90 index 9ac68f6df6..226d85dd40 100644 --- a/src/biogeophys/HydrologyDrainageMod.F90 +++ b/src/biogeophys/HydrologyDrainageMod.F90 @@ -101,7 +101,6 @@ subroutine HydrologyDrainage(bounds, & qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! excess liquid h2o due to snow capping, ! which we simply discard in order to reset ! the snow pack (mm H2O /s) [+] - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! surface water runoff (mm/s) qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! sub-surface runoff from perched zwt (mm H2O /s) qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! soil saturation excess [mm h2o/s] qflx_drain => waterflux_inst%qflx_drain_col , & ! sub-surface runoff (mm H2O /s) @@ -176,7 +175,6 @@ subroutine HydrologyDrainage(bounds, & qflx_drain(c) = 0._r8 qflx_drain_perched(c) = 0._r8 - qflx_h2osfc_surf(c) = 0._r8 qflx_surf(c) = 0._r8 qflx_infl(c) = 0._r8 qflx_qrgwl(c) = forc_rain(c) + forc_snow(c) + qflx_floodg(g) - qflx_evap_tot(c) - qflx_snwcp_ice(c) - & @@ -186,7 +184,6 @@ subroutine HydrologyDrainage(bounds, & else if (lun%urbpoi(l) .and. ctype(c) /= icol_road_perv) then qflx_drain_perched(c) = 0._r8 - qflx_h2osfc_surf(c) = 0._r8 qflx_rsub_sat(c) = spval end if @@ -206,7 +203,7 @@ subroutine HydrologyDrainage(bounds, & c = filter_nolakec(fc) l = col%landunit(c) - qflx_runoff(c) = qflx_drain(c) + qflx_surf(c) + qflx_h2osfc_surf(c) + qflx_qrgwl(c) + qflx_drain_perched(c) + qflx_runoff(c) = qflx_drain(c) + qflx_surf(c) + qflx_qrgwl(c) + qflx_drain_perched(c) if ((lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) .and. col%active(c)) then qflx_runoff(c) = qflx_runoff(c) - qflx_irrig(c) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 34e4c03711..df09613d55 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -60,7 +60,8 @@ subroutine HydrologyNoDrainage(bounds, & use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter use SoilHydrologyMod , only : CLMVICMap, SetFracIce, SurfaceRunoff - use SoilHydrologyMod , only : SetQflxTopSoil, Infiltration, WaterTable, PerchedWaterTable + use SoilHydrologyMod , only : SetQflxTopSoil, Infiltration, TotalSurfaceRunoff + use SoilHydrologyMod , only : WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation use SoilWaterMovementMod , only : SoilWater use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type @@ -185,6 +186,9 @@ subroutine HydrologyNoDrainage(bounds, & energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & waterflux_inst, waterstate_inst) + call TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst) + call Compute_EffecRootFrac_And_VertTranSink(bounds, num_hydrologyc, & filter_hydrologyc, soilstate_inst, canopystate_inst, waterflux_inst, energyflux_inst) diff --git a/src/biogeophys/LakeHydrologyMod.F90 b/src/biogeophys/LakeHydrologyMod.F90 index 8a9729da17..ffe691ac04 100644 --- a/src/biogeophys/LakeHydrologyMod.F90 +++ b/src/biogeophys/LakeHydrologyMod.F90 @@ -181,7 +181,6 @@ subroutine LakeHydrology(bounds, & qflx_snwcp_discarded_ice => waterflux_inst%qflx_snwcp_discarded_ice_col, & ! Input: [real(r8) (:) ] excess solid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! Input: [real(r8) (:) ] excess liquid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Output: [real(r8) (:) ] perched wt sub-surface runoff (mm H2O /s) !TODO - move this to somewhere else - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Output: [real(r8) (:) ] drainage from snow pack qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! Output: [real(r8) (:) ] soil saturation excess [mm h2o/s] qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) @@ -619,7 +618,6 @@ subroutine LakeHydrology(bounds, & g = pgridcell(p) qflx_drain_perched(c) = 0._r8 - qflx_h2osfc_surf(c) = 0._r8 qflx_rsub_sat(c) = 0._r8 qflx_infl(c) = 0._r8 qflx_surf(c) = 0._r8 diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index dac58816e6..783e357b18 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -31,6 +31,7 @@ module SoilHydrologyMod public :: SurfaceRunoff ! Calculate surface runoff public :: SetQflxTopSoil ! Set the flux of water into the soil from the top public :: Infiltration ! Calculate infiltration into surface soil layer + public :: TotalSurfaceRunoff ! Calculate total surface runoff public :: WaterTable ! Calculate water table before imposing drainage public :: Drainage ! Calculate subsurface drainage public :: CLMVICMap @@ -213,6 +214,7 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) + qflx_sat_surf => waterflux_inst%qflx_sat_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) @@ -243,7 +245,7 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & fff = 0.5_r8 if (frost_table(c) > zwt_perched(c) .and. frost_table(c) <= zwt(c)) then ! use perched water table to determine fsat (if present) - fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt_perched(c))!*( frost_table(c) - zwt_perched(c))/4.0 + fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt_perched(c)) else fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt(c)) end if @@ -265,22 +267,25 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & ! assume qinmax large relative to qflx_rain_plus_snomelt in control if (origflag == 1) then - qflx_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) + qflx_sat_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) else ! FIXME(wjs, 2017-07-09) If origflag /= 1, then fcov = fsat. So let's remove ! this origflag conditional and just use fcov. (First, though, make sure ! origflag /= 1 is covered by at least one test.) ! only send fast runoff directly to streams - qflx_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) + qflx_sat_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) endif + + if (col%urbpoi(c)) then + ! send flood water flux to runoff for all urban columns + qflx_sat_surf(c) = qflx_sat_surf(c) + qflx_floodc(c) + end if end do ! Determine water in excess of ponding limit for urban roof and impervious road. ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. - ! FIXME(wjs, 2017-07-07) Put this in a different routine, specific to urban? I - ! think it makes sense to keep it in the new SurfaceRunoff module, but maybe in a - ! separate routine. + ! FIXME(wjs, 2017-07-11) Put this in TotalSurfaceRunoff. ! ! FIXME(wjs, 2017-07-07) Remove the state updates from that routine, putting them ! in their own routine? For now, call it immediately afterwards in order to @@ -294,29 +299,36 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & ! h2osoi_liq for urban roof and impervroad, if snl(c) == 0. do fc = 1, num_urbanc c = filter_urbanc(fc) - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then + if (.not. col%hydrologically_active(c)) then + ! Hydrologically-active urban columns (i.e., pervious roads) have qflx_surf + ! set elsewhere - ! If there are snow layers then all qflx_rain_plus_snomelt goes to surface runoff - if (snl(c) < 0) then - qflx_surf(c) = max(0._r8,qflx_rain_plus_snomelt(c)) - else - xs(c) = max(0._r8, & - h2osoi_liq(c,1)/dtime + qflx_rain_plus_snomelt(c) - qflx_evap_grnd(c) - & - pondmx_urban/dtime) - if (xs(c) > 0.) then - h2osoi_liq(c,1) = pondmx_urban + if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then + + ! If there are snow layers then all qflx_rain_plus_snomelt goes to surface runoff + if (snl(c) < 0) then + qflx_surf(c) = max(0._r8,qflx_rain_plus_snomelt(c)) else - h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & - (qflx_rain_plus_snomelt(c)-qflx_evap_grnd(c))*dtime) + ! NOTE(wjs, 2017-07-11) It looks to me like this use of xs and + ! h2osoi_liq(c,1) are roughly analogous to h2osfc in hydrologically-active + ! columns. Why not use h2osfc for urban columns, too? + xs(c) = max(0._r8, & + h2osoi_liq(c,1)/dtime + qflx_rain_plus_snomelt(c) - qflx_evap_grnd(c) - & + pondmx_urban/dtime) + if (xs(c) > 0.) then + h2osoi_liq(c,1) = pondmx_urban + else + h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & + (qflx_rain_plus_snomelt(c)-qflx_evap_grnd(c))*dtime) + end if + qflx_surf(c) = xs(c) end if - qflx_surf(c) = xs(c) + else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then + qflx_surf(c) = 0._r8 end if - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - qflx_surf(c) = 0._r8 + ! send flood water flux to runoff for all urban columns + qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) end if - ! send flood water flux to runoff for all urban columns - qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) - end do end associate @@ -438,8 +450,9 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Input: [real(r8) (:) ] net water input into soil from top (mm/s) qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm] - qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm/s) + qflx_sat_surf => waterflux_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) + qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) @@ -491,8 +504,8 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f endif !1. partition surface inputs between soil and h2osfc - qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_surf(c)) - qflx_in_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_surf(c)) + qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_surf(c)) + qflx_in_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_surf(c)) !2. remove evaporation (snow treated in SnowHydrology) qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) @@ -523,7 +536,13 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f !4. soil infiltration and h2osfc "run-on" qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) + qflx_infl_excess(c) + if (h2osfcflag /= 0) then + qflx_in_h2osfc(c) = qflx_in_h2osfc(c) + qflx_infl_excess(c) + qflx_infl_excess_surf(c) = 0._r8 + else + ! No h2osfc pool, so qflx_infl_excess goes directly to surface runoff + qflx_infl_excess_surf(c) = qflx_infl_excess(c) + end if !5. surface runoff from h2osfc if (h2osfcflag==1) then @@ -549,15 +568,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f ! cutoff lower limit if ( qflx_h2osfc_surf(c) < 1.0e-8) qflx_h2osfc_surf(c) = 0._r8 - ! use this for non-h2osfc code - if(h2osfcflag==0) then - qflx_h2osfc_surf(c)= 0._r8 - ! shift infiltration excess from h2osfc input to surface runoff - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_infl_excess(c) - qflx_surf(c)= qflx_surf(c) + qflx_infl_excess(c) - qflx_infl_excess(c) = 0._r8 - endif - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_h2osfc_surf(c) !6. update h2osfc prior to calculating bottom drainage from h2osfc @@ -583,12 +593,13 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f ! non-vegetated landunits (i.e. urban) use original CLM4 code if (snl(c) >= 0) then ! when no snow present, sublimation is removed in Drainage - qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) - qflx_evap_grnd(c) + qflx_infl(c) = qflx_top_soil(c) - qflx_sat_surf(c) - qflx_evap_grnd(c) else - qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) & + qflx_infl(c) = qflx_top_soil(c) - qflx_sat_surf(c) & - (1.0_r8 - frac_sno(c)) * qflx_ev_soil(c) end if qflx_h2osfc_surf(c) = 0._r8 + qflx_infl_excess_surf(c) = 0._r8 endif enddo @@ -606,6 +617,68 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f end subroutine Infiltration + !----------------------------------------------------------------------- + subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst) + ! + ! !DESCRIPTION: + ! Calculate total surface runoff + ! + ! For hydrologically-active columns, this is the sum of some already-computed terms + ! + ! In addition, computes total surface runoff for non-hydrologically-active urban + ! columns + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(waterflux_type) , intent(inout) :: waterflux_inst + ! + ! !LOCAL VARIABLES: + integer :: fc, c + + character(len=*), parameter :: subname = 'TotalSurfaceRunoff' + !----------------------------------------------------------------------- + + associate( & + qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] total surface runoff (mm H2O /s) + qflx_surf_for_bgc => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s) + qflx_sat_surf => waterflux_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) + qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col & ! Input: [real(r8) (:) ] surface water runoff (mm H2O /s) + ) + + ! ------------------------------------------------------------------------ + ! Set qflx_surf for hydrologically-active columns + ! ------------------------------------------------------------------------ + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + ! Depending on whether h2osfcflag is 0 or 1, one of qflx_infl_excess or + ! qflx_h2osfc_surf will always be 0. But it's safe to just add them both. + qflx_surf(c) = qflx_sat_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c) + + ! TODO(wjs, 2017-07-11) I'm distinguishing between qflx_surf and qflx_surf_for_bgc + ! simply to maintain answers as they were before. But I have a feeling that the + ! BGC code should really be using the total qflx_surf in its calculations. Once + ! Dave Lawrence or someone else signs off on this change, we should change the BGC + ! code to use qflx_surf and remove this qflx_surf_for_bgc variable. + ! Alternatively, if we deem the current implementation correct, we should + ! consider renaming this something better than qflx_surf_for_bgc, or simply + ! making the BGC code depend on qflx_sat_surf, if that's what's intended. + qflx_surf_for_bgc(c) = qflx_sat_surf(c) + qflx_infl_excess_surf(c) + end do + + ! ------------------------------------------------------------------------ + ! Set qflx_surf for non-hydrologically-active urban columns + ! ------------------------------------------------------------------------ + + end associate + + end subroutine TotalSurfaceRunoff + + !----------------------------------------------------------------------- subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & soilhydrology_inst, soilstate_inst, temperature_inst, waterstate_inst, waterflux_inst) @@ -1566,7 +1639,6 @@ subroutine CLMVICMap(bounds, numf, filter, & end do ! Set values related to top VIC layers - ! FIXME(wjs, 2017-07-09) Probably extract the following into its own routine do fc = 1, numf c = filter(fc) diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index ff8d9f661f..eae5bd00b4 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -73,12 +73,15 @@ module WaterfluxType real(r8), pointer :: qflx_adv_col (:,:) ! col advective flux across different soil layer interfaces [mm H2O/s] [+ downward] real(r8), pointer :: qflx_rootsoi_col (:,:) ! col root and soil water exchange [mm H2O/s] [+ into root] real(r8), pointer :: qflx_infl_col (:) ! col infiltration (mm H2O /s) - real(r8), pointer :: qflx_surf_col (:) ! col surface runoff (mm H2O /s) + real(r8), pointer :: qflx_sat_surf_col (:) ! col surface runoff due to saturated surface (mm H2O /s) + real(r8), pointer :: qflx_infl_excess_surf_col(:) ! col surface runoff due to infiltration excess (mm H2O /s) + real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff (mm H2O /s) + real(r8), pointer :: qflx_surf_col (:) ! col total surface runoff (mm H2O /s) + real(r8), pointer :: qflx_surf_for_bgc_col (:) ! col total surface runoff for input into BGC code (mm H2O /s) real(r8), pointer :: qflx_drain_col (:) ! col sub-surface runoff (mm H2O /s) real(r8), pointer :: qflx_rain_plus_snomelt_col(:) ! col rain plus snow melt falling on the soil (mm/s) real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) real(r8), pointer :: qflx_h2osfc_to_ice_col (:) ! col conversion of h2osfc to ice - real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff real(r8), pointer :: qflx_snow_h2osfc_col (:) ! col snow falling on surface water real(r8), pointer :: qflx_drain_perched_col (:) ! col sub-surface runoff from perched wt (mm H2O /s) real(r8), pointer :: qflx_deficit_col (:) ! col water deficit to keep non-negative liquid water content (mm H2O) @@ -215,11 +218,14 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_adv_col (begc:endc,0:nlevsoi)) ; this%qflx_adv_col (:,:) = nan allocate(this%qflx_rootsoi_col (begc:endc,1:nlevsoi)) ; this%qflx_rootsoi_col (:,:) = nan allocate(this%qflx_infl_col (begc:endc)) ; this%qflx_infl_col (:) = nan + allocate(this%qflx_sat_surf_col (begc:endc)) ; this%qflx_sat_surf_col (:) = nan allocate(this%qflx_surf_col (begc:endc)) ; this%qflx_surf_col (:) = nan + allocate(this%qflx_surf_for_bgc_col (begc:endc)) ; this%qflx_surf_for_bgc_col (:) = nan allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan allocate(this%qflx_rain_plus_snomelt_col(begc:endc)) ; this%qflx_rain_plus_snomelt_col(:) = nan allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan allocate(this%qflx_h2osfc_to_ice_col (begc:endc)) ; this%qflx_h2osfc_to_ice_col (:) = nan + allocate(this%qflx_infl_excess_surf_col(begc:endc)) ; this%qflx_infl_excess_surf_col(:) = nan allocate(this%qflx_h2osfc_surf_col (begc:endc)) ; this%qflx_h2osfc_surf_col (:) = nan allocate(this%qflx_snow_h2osfc_col (begc:endc)) ; this%qflx_snow_h2osfc_col (:) = nan allocate(this%qflx_snomelt_col (begc:endc)) ; this%qflx_snomelt_col (:) = nan @@ -292,7 +298,7 @@ subroutine InitHistory(this, bounds) this%qflx_surf_col(begc:endc) = spval call hist_addfld1d (fname='QOVER', units='mm/s', & - avgflag='A', long_name='surface runoff', & + avgflag='A', long_name='total surface runoff (includes QH2OSFC)', & ptr_col=this%qflx_surf_col, c2l_scale_type='urbanf') this%qflx_qrgwl_col(begc:endc) = spval diff --git a/src/cpl/lnd_import_export.F90 b/src/cpl/lnd_import_export.F90 index 0b39274155..c07f9e5f58 100644 --- a/src/cpl/lnd_import_export.F90 +++ b/src/cpl/lnd_import_export.F90 @@ -340,9 +340,7 @@ subroutine lnd_export( bounds, lnd2atm_inst, lnd2glc_inst, l2x) ! hierarchy of atm/glc/lnd/rof/ice/ocn. ! I.e. water sent from land to rof is positive - ! surface runoff is the sum of qflx_over, qflx_h2osfc_surf - l2x(index_l2x_Flrl_rofsur,i) = lnd2atm_inst%qflx_rofliq_qsur_grc(g) & - + lnd2atm_inst%qflx_rofliq_h2osfc_grc(g) + l2x(index_l2x_Flrl_rofsur,i) = lnd2atm_inst%qflx_rofliq_qsur_grc(g) ! subsurface runoff is the sum of qflx_drain and qflx_perched_drain l2x(index_l2x_Flrl_rofsub,i) = lnd2atm_inst%qflx_rofliq_qsub_grc(g) & diff --git a/src/main/ColumnType.F90 b/src/main/ColumnType.F90 index b8ca3f0adc..b2f0190402 100644 --- a/src/main/ColumnType.F90 +++ b/src/main/ColumnType.F90 @@ -67,6 +67,7 @@ module ColumnType ! other column characteristics logical , pointer :: hydrologically_active(:) ! true if this column is a hydrologically active type + logical , pointer :: urbpoi (:) ! true=>urban point ! levgrnd_class gives the class in which each layer falls. This is relevant for ! columns where there are 2 or more fundamentally different layer types. For @@ -131,6 +132,7 @@ subroutine Init(this, begc, endc) allocate(this%topo_std (begc:endc)) ; this%topo_std (:) = nan allocate(this%hydrologically_active(begc:endc)) ; this%hydrologically_active(:) = .false. + allocate(this%urbpoi (begc:endc)) ; this%urbpoi (:) = .false. end subroutine Init @@ -166,6 +168,7 @@ subroutine Clean(this) deallocate(this%nbedrock ) deallocate(this%levgrnd_class) deallocate(this%hydrologically_active) + deallocate(this%urbpoi) end subroutine Clean @@ -194,6 +197,8 @@ subroutine update_itype(this, c, itype) col%hydrologically_active(c) = is_hydrologically_active( & col_itype = itype, & lun_itype = lun%itype(l)) + ! Properties that are tied to the landunit's properties (like urbpoi) are assumed + ! not to change here. else write(iulog,*) subname//' ERROR: attempt to update itype when type_is_dynamic is false' write(iulog,*) 'c, col%itype(c), itype = ', c, col%itype(c), itype diff --git a/src/main/initSubgridMod.F90 b/src/main/initSubgridMod.F90 index 57384dc461..0d06208eb4 100644 --- a/src/main/initSubgridMod.F90 +++ b/src/main/initSubgridMod.F90 @@ -416,6 +416,7 @@ subroutine add_column(ci, li, ctype, wtlunit, type_is_dynamic) col%hydrologically_active(ci) = is_hydrologically_active( & col_itype = ctype, & lun_itype = lun%itype(li)) + col%urbpoi(ci) = lun%urbpoi(li) end subroutine add_column diff --git a/src/main/lnd2atmMod.F90 b/src/main/lnd2atmMod.F90 index 2a4a00d5cd..05a0e42a7b 100644 --- a/src/main/lnd2atmMod.F90 +++ b/src/main/lnd2atmMod.F90 @@ -360,11 +360,6 @@ subroutine lnd2atm(bounds, & lnd2atm_inst%qflx_rofliq_grc(g) = lnd2atm_inst%qflx_rofliq_grc(g) - waterflux_inst%qflx_liq_dynbal_grc(g) enddo - call c2g( bounds, & - waterflux_inst%qflx_h2osfc_surf_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofliq_h2osfc_grc(bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - call c2g( bounds, & waterflux_inst%qflx_drain_perched_col (bounds%begc:bounds%endc), & lnd2atm_inst%qflx_rofliq_drain_perched_grc(bounds%begg:bounds%endg), & diff --git a/src/main/lnd2atmType.F90 b/src/main/lnd2atmType.F90 index 023608a4a7..e0c4263d01 100644 --- a/src/main/lnd2atmType.F90 +++ b/src/main/lnd2atmType.F90 @@ -66,7 +66,6 @@ module lnd2atmType real(r8), pointer :: qflx_rofliq_qsur_grc (:) => null() ! rof liq -- surface runoff component real(r8), pointer :: qflx_rofliq_qsub_grc (:) => null() ! rof liq -- subsurface runoff component real(r8), pointer :: qflx_rofliq_qgwl_grc (:) => null() ! rof liq -- glacier, wetland and lakes water balance residual component - real(r8), pointer :: qflx_rofliq_h2osfc_grc (:) => null() ! rof liq -- surface water runoff component real(r8), pointer :: qflx_rofliq_drain_perched_grc (:) => null() ! rof liq -- perched water table runoff component real(r8), pointer :: qflx_rofice_grc (:) => null() ! rof ice forcing real(r8), pointer :: qflx_liq_from_ice_col(:) => null() ! liquid runoff from converted ice runoff @@ -172,7 +171,6 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_rofliq_qsur_grc (begg:endg)) ; this%qflx_rofliq_qsur_grc (:) =ival allocate(this%qflx_rofliq_qsub_grc (begg:endg)) ; this%qflx_rofliq_qsub_grc (:) =ival allocate(this%qflx_rofliq_qgwl_grc (begg:endg)) ; this%qflx_rofliq_qgwl_grc (:) =ival - allocate(this%qflx_rofliq_h2osfc_grc (begg:endg)) ; this%qflx_rofliq_h2osfc_grc (:) =ival allocate(this%qflx_rofliq_drain_perched_grc (begg:endg)) ; this%qflx_rofliq_drain_perched_grc (:) =ival allocate(this%qflx_rofice_grc (begg:endg)) ; this%qflx_rofice_grc (:) =ival allocate(this%qflx_liq_from_ice_col(begc:endc)) ; this%qflx_liq_from_ice_col(:) = ival diff --git a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 index 3a0cb0c91b..2cc77aef17 100644 --- a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 @@ -109,7 +109,7 @@ subroutine SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, & h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) qflx_drain => waterflux_inst%qflx_drain_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) + qflx_surf => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s) sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral N smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ] From 46e334198b22d1cf9fcb081fe143775b40e40878 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 17 Jul 2017 15:00:42 -0600 Subject: [PATCH 004/144] 'pull ctsm_n04_clm4_5_16_r249 tags from svn' --- src/biogeochem/CNDriverMod.F90 | 8 +- src/biogeochem/CNFireBaseMod.F90 | 6 +- src/biogeochem/CNFireLi2014Mod.F90 | 8 +- src/biogeochem/CNFireLi2016Mod.F90 | 8 +- src/biogeochem/CNFireMethodMod.F90 | 6 +- src/biogeochem/CNFireNoFireMod.F90 | 6 +- src/biogeochem/CNVegetationFacade.F90 | 8 +- src/biogeophys/HydrologyNoDrainageMod.F90 | 24 +- src/biogeophys/SoilHydrologyMod.F90 | 297 +++++++---------- src/biogeophys/SoilHydrologyType.F90 | 16 +- src/biogeophys/SurfRunoffSatMod.F90 | 369 ++++++++++++++++++++++ src/biogeophys/WaterfluxType.F90 | 2 - src/main/clm_driver.F90 | 6 +- src/main/clm_instMod.F90 | 6 +- 14 files changed, 533 insertions(+), 237 deletions(-) create mode 100644 src/biogeophys/SurfRunoffSatMod.F90 diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index c883867b1e..05c68c757a 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -36,7 +36,7 @@ module CNDriverMod use PhotosynthesisMod , only : photosyns_type use ch4Mod , only : ch4_type use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type ! ! !PUBLIC TYPES: implicit none @@ -91,7 +91,7 @@ subroutine CNDriverNoLeaching(bounds, soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & + dgvs_inst, photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & nutrient_competition_method, cnfire_method) ! ! !DESCRIPTION: @@ -175,7 +175,7 @@ subroutine CNDriverNoLeaching(bounds, type(ch4_type) , intent(in) :: ch4_inst type(dgvs_type) , intent(inout) :: dgvs_inst type(photosyns_type) , intent(in) :: photosyns_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method class(cnfire_method_type) , intent(inout) :: cnfire_method @@ -737,7 +737,7 @@ subroutine CNDriverNoLeaching(bounds, call t_startf('CNFire') call cnfire_method%CNFireArea(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, & totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 4cc1004bd7..77911d8f29 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -35,7 +35,7 @@ module CNFireBaseMod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -263,7 +263,7 @@ end subroutine CNFireInterp !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -280,7 +280,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index 3e023a68a8..847eedaa54 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -34,7 +34,7 @@ module CNFireLi2014Mod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -83,7 +83,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -106,7 +106,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst @@ -164,7 +164,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fd_pft => pftcon%fd_pft , & ! Input: btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf => waterstate_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index e108462244..8d492909d4 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -34,7 +34,7 @@ module CNFireLi2016Mod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -84,7 +84,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -108,7 +108,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst @@ -171,7 +171,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fd_pft => pftcon%fd_pft , & ! Input: btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool diff --git a/src/biogeochem/CNFireMethodMod.F90 b/src/biogeochem/CNFireMethodMod.F90 index d3c9afe1f8..99f3f19f63 100644 --- a/src/biogeochem/CNFireMethodMod.F90 +++ b/src/biogeochem/CNFireMethodMod.F90 @@ -96,7 +96,7 @@ end subroutine CNFireInterp_interface !----------------------------------------------------------------------- subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -107,7 +107,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil use decompMod , only : bounds_type use atm2lndType , only : atm2lnd_type use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use WaterstateType , only : waterstate_type use CNVegStateType , only : cnveg_state_type use CNVegCarbonStateType , only : cnveg_carbonstate_type @@ -122,7 +122,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNFireNoFireMod.F90 b/src/biogeochem/CNFireNoFireMod.F90 index e752bc9a2f..11252013cf 100644 --- a/src/biogeochem/CNFireNoFireMod.F90 +++ b/src/biogeochem/CNFireNoFireMod.F90 @@ -16,7 +16,7 @@ module CNFireNoFireMod use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use WaterstateType , only : waterstate_type use CNFireMethodMod , only : cnfire_method_type use CNFireBaseMod , only : cnfire_base_type @@ -58,7 +58,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -76,7 +76,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 87123a5fe2..42fd8df962 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -72,7 +72,7 @@ module CNVegetationFacade use CNDVType , only : dgvs_type use CNDVDriverMod , only : CNDVDriver, CNDVHIST use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use FrictionVelocityMod , only : frictionvel_type use SoilBiogeochemStateType , only : soilBiogeochem_state_type use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type @@ -783,7 +783,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, soilhydrology_inst, energyflux_inst, & + photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) ! ! !DESCRIPTION: @@ -822,7 +822,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & type(crop_type) , intent(inout) :: crop_inst type(ch4_type) , intent(in) :: ch4_inst type(photosyns_type) , intent(in) :: photosyns_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method type(fireemis_type) , intent(inout) :: fireemis_inst @@ -852,7 +852,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - this%dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & + this%dgvs_inst, photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & nutrient_competition_method, this%cnfire_method) ! fire carbon emissions diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index df09613d55..d6af54d91a 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -14,8 +14,9 @@ Module HydrologyNoDrainageMod use AerosolMod , only : aerosol_type use EnergyFluxType , only : energyflux_type use TemperatureType , only : temperature_type - use SoilHydrologyType , only : soilhydrology_type + use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type use CanopyStateType , only : canopystate_type @@ -42,7 +43,7 @@ subroutine HydrologyNoDrainage(bounds, & clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & waterflux_inst, waterstate_inst, & - soilhydrology_inst, aerosol_inst, & + soilhydrology_inst, surf_runoff_sat_inst, aerosol_inst, & canopystate_inst, soil_water_retention_curve) ! ! !DESCRIPTION: @@ -59,8 +60,9 @@ subroutine HydrologyNoDrainage(bounds, & use clm_time_manager , only : get_step_size, get_nstep use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter - use SoilHydrologyMod , only : CLMVICMap, SetFracIce, SurfaceRunoff + use SoilHydrologyMod , only : CLMVICMap, SetFracIce use SoilHydrologyMod , only : SetQflxTopSoil, Infiltration, TotalSurfaceRunoff + use SoilHydrologyMod , only : UpdateUrbanPonding use SoilHydrologyMod , only : WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation use SoilWaterMovementMod , only : SoilWater @@ -90,6 +92,7 @@ subroutine HydrologyNoDrainage(bounds, & type(waterstate_type) , intent(inout) :: waterstate_inst type(aerosol_type) , intent(inout) :: aerosol_inst type(soilhydrology_type) , intent(inout) :: soilhydrology_inst + type(surf_runoff_sat_type), intent(inout) :: surf_runoff_sat_inst type(canopystate_type) , intent(inout) :: canopystate_inst class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve ! @@ -177,17 +180,22 @@ subroutine HydrologyNoDrainage(bounds, & call SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & soilhydrology_inst, soilstate_inst, waterstate_inst) - call SurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - soilhydrology_inst, soilstate_inst, waterflux_inst, waterstate_inst) + call surf_runoff_sat_inst%SaturatedSurfaceRunoff(& + bounds, num_hydrologyc, filter_hydrologyc, col, & + soilhydrology_inst, soilstate_inst, waterflux_inst) call SetQflxTopSoil(bounds, num_hydrologyc, filter_hydrologyc, waterflux_inst) call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& - energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & - waterflux_inst, waterstate_inst) + energyflux_inst, soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, & + temperature_inst, waterflux_inst, waterstate_inst) call TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst) + num_urbanc, filter_urbanc, & + waterflux_inst, soilhydrology_inst, surf_runoff_sat_inst, waterstate_inst) + + call UpdateUrbanPonding(bounds, num_urbanc, filter_urbanc, & + waterstate_inst, soilhydrology_inst, waterflux_inst) call Compute_EffecRootFrac_And_VertTranSink(bounds, num_hydrologyc, & filter_hydrologyc, soilstate_inst, canopystate_inst, waterflux_inst, energyflux_inst) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 783e357b18..e82b9f76a8 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -10,10 +10,15 @@ module SoilHydrologyMod use decompMod , only : bounds_type use clm_varctl , only : iulog, use_vichydro use clm_varcon , only : e_ice, denh2o, denice, rpi, aquifer_water_baseline + use clm_varcon , only : pondmx_urban use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert + use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall + use column_varcon , only : icol_road_imperv + use clm_time_manager , only : get_step_size use EnergyFluxType , only : energyflux_type use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type use TemperatureType , only : temperature_type @@ -28,10 +33,10 @@ module SoilHydrologyMod ! !PUBLIC MEMBER FUNCTIONS: public :: SoilHydReadNML ! Read in the Soil hydrology namelist public :: SetFracIce ! Set diagnostic variables related to the fraction of ice in each layer - public :: SurfaceRunoff ! Calculate surface runoff public :: SetQflxTopSoil ! Set the flux of water into the soil from the top public :: Infiltration ! Calculate infiltration into surface soil layer public :: TotalSurfaceRunoff ! Calculate total surface runoff + public :: UpdateUrbanPonding ! Update the state variable representing ponding on urban surfaces public :: WaterTable ! Calculate water table before imposing drainage public :: Drainage ! Calculate subsurface drainage public :: CLMVICMap @@ -166,175 +171,6 @@ subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & end subroutine SetFracIce - !----------------------------------------------------------------------- - subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, waterflux_inst, & - waterstate_inst) - ! - ! !DESCRIPTION: - ! Calculate surface runoff - ! - ! !USES: - use clm_varcon , only : pondmx_urban - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_imperv - use clm_time_manager, only : get_step_size - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,fc,g,l,i !indices - real(r8) :: dtime !land model time step (sec) - real(r8) :: xs(bounds%begc:bounds%endc) !excess soil water above urban ponding limit - real(r8) :: fff !decay factor (m-1) - real(r8) :: s1 !variable to calculate qinmax - real(r8) :: su !variable to calculate qinmax - real(r8) :: v !variable to calculate qinmax - real(r8) :: qinmax !maximum infiltration capacity (mm/s) - real(r8) :: ex(bounds%begc:bounds%endc) !temporary variable (exponent) - character(len=32) :: subname = 'SurfaceRunoff' !subroutine name - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - - wtfact => soilstate_inst%wtfact_col , & ! Input: [real(r8) (:) ] maximum saturated fraction for a gridcell - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) - qflx_sat_surf => waterflux_inst%qflx_sat_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) - - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter - origflag => soilhydrology_inst%origflag , & ! Input: logical - fcov => soilhydrology_inst%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area - fsat => soilhydrology_inst%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface - fracice => soilhydrology_inst%fracice_col , & ! Input: [real(r8) (:,:) ] fractional impermeability (-) - top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers - top_moist_limited => soilhydrology_inst%top_moist_limited_col & ! Input: [real(r8) (:) ] soil moisture in top layers, limited to no greater than top_max_moist - ) - - ! Get time step - - dtime = get_step_size() - - ! Saturated fraction - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (use_vichydro) then - ex(c) = b_infil(c) / (1._r8 + b_infil(c)) - ! fsat is equivalent to A in VIC papers - fsat(c) = 1._r8 - (1._r8 - top_moist_limited(c) / top_max_moist(c))**ex(c) - else - fff = 0.5_r8 - if (frost_table(c) > zwt_perched(c) .and. frost_table(c) <= zwt(c)) then - ! use perched water table to determine fsat (if present) - fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt_perched(c)) - else - fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt(c)) - end if - end if - - if (origflag == 1) then - if (use_vichydro) then - call endrun(msg="VICHYDRO is not available for origflag=1"//errmsg(sourcefile, __LINE__)) - else - fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1) - end if - else - fcov(c) = fsat(c) - endif - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! assume qinmax large relative to qflx_rain_plus_snomelt in control - if (origflag == 1) then - qflx_sat_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) - else - ! FIXME(wjs, 2017-07-09) If origflag /= 1, then fcov = fsat. So let's remove - ! this origflag conditional and just use fcov. (First, though, make sure - ! origflag /= 1 is covered by at least one test.) - ! only send fast runoff directly to streams - qflx_sat_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) - endif - - if (col%urbpoi(c)) then - ! send flood water flux to runoff for all urban columns - qflx_sat_surf(c) = qflx_sat_surf(c) + qflx_floodc(c) - end if - end do - - ! Determine water in excess of ponding limit for urban roof and impervious road. - ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. - - ! FIXME(wjs, 2017-07-11) Put this in TotalSurfaceRunoff. - ! - ! FIXME(wjs, 2017-07-07) Remove the state updates from that routine, putting them - ! in their own routine? For now, call it immediately afterwards in order to - ! maintain bfb. To do that extraction, I think I'll need to save xs. - ! - ! FIXME(wjs, 2017-07-07) So the new urban routine will set: - ! - qflx_surf for urban points - ! - xs_urban_roof_and_impervroad - ! - ! FIXME(wjs, 2017-07-07) Then we'll have an additional routine that updates - ! h2osoi_liq for urban roof and impervroad, if snl(c) == 0. - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (.not. col%hydrologically_active(c)) then - ! Hydrologically-active urban columns (i.e., pervious roads) have qflx_surf - ! set elsewhere - - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - - ! If there are snow layers then all qflx_rain_plus_snomelt goes to surface runoff - if (snl(c) < 0) then - qflx_surf(c) = max(0._r8,qflx_rain_plus_snomelt(c)) - else - ! NOTE(wjs, 2017-07-11) It looks to me like this use of xs and - ! h2osoi_liq(c,1) are roughly analogous to h2osfc in hydrologically-active - ! columns. Why not use h2osfc for urban columns, too? - xs(c) = max(0._r8, & - h2osoi_liq(c,1)/dtime + qflx_rain_plus_snomelt(c) - qflx_evap_grnd(c) - & - pondmx_urban/dtime) - if (xs(c) > 0.) then - h2osoi_liq(c,1) = pondmx_urban - else - h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & - (qflx_rain_plus_snomelt(c)-qflx_evap_grnd(c))*dtime) - end if - qflx_surf(c) = xs(c) - end if - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - qflx_surf(c) = 0._r8 - end if - ! send flood water flux to runoff for all urban columns - qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) - end if - end do - - end associate - - end subroutine SurfaceRunoff - !----------------------------------------------------------------------- subroutine SetQflxTopSoil(bounds, num_hydrologyc, filter_hydrologyc, & waterflux_inst) @@ -373,8 +209,8 @@ end subroutine SetQflxTopSoil !----------------------------------------------------------------------- subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & - waterflux_inst, waterstate_inst) + energyflux_inst, soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, & + temperature_inst, waterflux_inst, waterstate_inst) ! ! !DESCRIPTION: ! Calculate infiltration into surface soil layer (minus the evaporation) @@ -384,7 +220,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f use clm_varcon , only : denh2o, denice, roverg, wimp, pc, mu, tfrz use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv use landunit_varcon , only : istsoil, istcrop - use clm_time_manager , only : get_step_size ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -395,6 +230,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f type(energyflux_type) , intent(in) :: energyflux_inst type(soilhydrology_type) , intent(inout) :: soilhydrology_inst type(soilstate_type) , intent(inout) :: soilstate_inst + type(surf_runoff_sat_type), intent(in) :: surf_runoff_sat_inst type(temperature_type) , intent(in) :: temperature_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst @@ -450,7 +286,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Input: [real(r8) (:) ] net water input into soil from top (mm/s) qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm] - qflx_sat_surf => waterflux_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) @@ -462,12 +297,14 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) eff_porosity => soilstate_inst%eff_porosity_col , & ! Output: [real(r8) (:,:) ] effective porosity = porosity - vol_ice + qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface top_moist => soilhydrology_inst%top_moist_col , & ! Input: [real(r8) (:) ] soil moisture in top VIC layers top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers top_ice => soilhydrology_inst%top_ice_col , & ! Input: [real(r8) (:) ] ice len in top VIC layers @@ -619,7 +456,8 @@ end subroutine Infiltration !----------------------------------------------------------------------- subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst) + num_urbanc, filter_urbanc, & + waterflux_inst, soilhydrology_inst, surf_runoff_sat_inst, waterstate_inst) ! ! !DESCRIPTION: ! Calculate total surface runoff @@ -633,22 +471,40 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + integer , intent(in) :: num_urbanc ! number of column urban points in column filter + integer , intent(in) :: filter_urbanc(:) ! column filter for urban points type(waterflux_type) , intent(inout) :: waterflux_inst + type(soilhydrology_type) , intent(inout) :: soilhydrology_inst + type(surf_runoff_sat_type), intent(in) :: surf_runoff_sat_inst + type(waterstate_type), intent(in) :: waterstate_inst ! ! !LOCAL VARIABLES: - integer :: fc, c + integer :: fc, c + real(r8) :: dtime ! land model time step (sec) character(len=*), parameter :: subname = 'TotalSurfaceRunoff' !----------------------------------------------------------------------- associate( & + snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] total surface runoff (mm H2O /s) qflx_surf_for_bgc => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s) - qflx_sat_surf => waterflux_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col & ! Input: [real(r8) (:) ] surface water runoff (mm H2O /s) + qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col, & ! Input: [real(r8) (:) ] surface water runoff (mm H2O /s) + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) + qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] + qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM + + xs_urban => soilhydrology_inst%xs_urban_col , & ! Output: [real(r8) (:) ] excess soil water above urban ponding limit + + qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + + h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) ) + dtime = get_step_size() + ! ------------------------------------------------------------------------ ! Set qflx_surf for hydrologically-active columns ! ------------------------------------------------------------------------ @@ -672,12 +528,90 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & ! ------------------------------------------------------------------------ ! Set qflx_surf for non-hydrologically-active urban columns + ! + ! Determine water in excess of ponding limit for urban roof and impervious road. + ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. ! ------------------------------------------------------------------------ + do fc = 1, num_urbanc + c = filter_urbanc(fc) + if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then + ! If there are snow layers then all qflx_rain_plus_snomelt goes to surface runoff + if (snl(c) < 0) then + qflx_surf(c) = max(0._r8,qflx_rain_plus_snomelt(c)) + else + ! NOTE(wjs, 2017-07-11) It looks to me like this use of xs_urban and + ! h2osoi_liq(c,1) are roughly analogous to h2osfc in hydrologically-active + ! columns. Why not use h2osfc for urban columns, too? + xs_urban(c) = max(0._r8, & + h2osoi_liq(c,1)/dtime + qflx_rain_plus_snomelt(c) - qflx_evap_grnd(c) - & + pondmx_urban/dtime) + qflx_surf(c) = xs_urban(c) + end if + ! send flood water flux to runoff for all urban columns + qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) + else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then + qflx_surf(c) = 0._r8 + end if + end do + end associate end subroutine TotalSurfaceRunoff + !----------------------------------------------------------------------- + subroutine UpdateUrbanPonding(bounds, num_urbanc, filter_urbanc, & + waterstate_inst, soilhydrology_inst, waterflux_inst) + ! + ! !DESCRIPTION: + ! Update the state variable representing ponding on urban surfaces + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_urbanc ! number of column urban points in column filter + integer , intent(in) :: filter_urbanc(:) ! column filter for urban points + type(waterstate_type) , intent(inout) :: waterstate_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(waterflux_type) , intent(in) :: waterflux_inst + ! + ! !LOCAL VARIABLES: + integer :: fc, c + real(r8) :: dtime ! land model time step (sec) + + character(len=*), parameter :: subname = 'UpdateUrbanPonding' + !----------------------------------------------------------------------- + + associate( & + snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + + h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) + + xs_urban => soilhydrology_inst%xs_urban_col , & ! Input: [real(r8) (:) ] excess soil water above urban ponding limit + + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) + qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] + ) + + dtime = get_step_size() + + do fc = 1, num_urbanc + c = filter_urbanc(fc) + + if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then + if (snl(c) >= 0) then + if (xs_urban(c) > 0.) then + h2osoi_liq(c,1) = pondmx_urban + else + h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & + (qflx_rain_plus_snomelt(c)-qflx_evap_grnd(c))*dtime) + end if + end if + end if + end do + + end associate + + end subroutine UpdateUrbanPonding !----------------------------------------------------------------------- subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & @@ -687,7 +621,6 @@ subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, fil ! Calculate watertable, considering aquifer recharge but no drainage. ! ! !USES: - use clm_time_manager , only : get_step_size use clm_varcon , only : pondmx, tfrz, watmin,denice,denh2o use column_varcon , only : icol_roof, icol_road_imperv ! @@ -994,7 +927,6 @@ subroutine Drainage(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filte ! Calculate subsurface drainage ! ! !USES: - use clm_time_manager , only : get_step_size use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv ! @@ -1797,7 +1729,6 @@ subroutine PerchedLateralFlow(bounds, num_hydrologyc, filter_hydrologyc, & ! Calculate subsurface drainage from perched saturated zone ! ! !USES: - use clm_time_manager , only : get_step_size use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv @@ -2055,7 +1986,6 @@ subroutine LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & ! Calculate subsurface drainage ! ! !USES: - use clm_time_manager , only : get_step_size use clm_varcon , only : pondmx, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv use GridcellType , only : grc @@ -2383,7 +2313,6 @@ subroutine RenewCondensation(bounds, num_hydrologyc, filter_hydrologyc, & ! Calculate watertable, considering aquifer recharge but no drainage. ! ! !USES: - use clm_time_manager , only : get_step_size use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: diff --git a/src/biogeophys/SoilHydrologyType.F90 b/src/biogeophys/SoilHydrologyType.F90 index e867e9f28f..8c99e8d750 100644 --- a/src/biogeophys/SoilHydrologyType.F90 +++ b/src/biogeophys/SoilHydrologyType.F90 @@ -29,9 +29,8 @@ Module SoilHydrologyType real(r8), pointer :: qcharge_col (:) ! col aquifer recharge rate (mm/s) real(r8), pointer :: fracice_col (:,:) ! col fractional impermeability (-) real(r8), pointer :: icefrac_col (:,:) ! col fraction of ice - real(r8), pointer :: fcov_col (:) ! col fractional impermeable area - real(r8), pointer :: fsat_col (:) ! col fractional area with water table at surface real(r8), pointer :: h2osfc_thresh_col (:) ! col level at which h2osfc "percolates" (time constant) + real(r8), pointer :: xs_urban_col (:) ! col excess soil water above urban ponding limit ! VIC real(r8), pointer :: hkdepth_col (:) ! col VIC decay factor (m) (time constant) @@ -122,9 +121,8 @@ subroutine InitAllocate(this, bounds) allocate(this%qcharge_col (begc:endc)) ; this%qcharge_col (:) = nan allocate(this%fracice_col (begc:endc,nlevgrnd)) ; this%fracice_col (:,:) = nan allocate(this%icefrac_col (begc:endc,nlevgrnd)) ; this%icefrac_col (:,:) = nan - allocate(this%fcov_col (begc:endc)) ; this%fcov_col (:) = nan - allocate(this%fsat_col (begc:endc)) ; this%fsat_col (:) = nan allocate(this%h2osfc_thresh_col (begc:endc)) ; this%h2osfc_thresh_col (:) = nan + allocate(this%xs_urban_col (begc:endc)) ; this%xs_urban_col (:) = nan allocate(this%hkdepth_col (begc:endc)) ; this%hkdepth_col (:) = nan allocate(this%b_infil_col (begc:endc)) ; this%b_infil_col (:) = nan @@ -177,16 +175,6 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='aquifer recharge rate (vegetated landunits only)', & ptr_col=this%qcharge_col, l2g_scale_type='veg') - this%fcov_col(begc:endc) = spval - call hist_addfld1d (fname='FCOV', units='unitless', & - avgflag='A', long_name='fractional impermeable area', & - ptr_col=this%fcov_col, l2g_scale_type='veg') - - this%fsat_col(begc:endc) = spval - call hist_addfld1d (fname='FSAT', units='unitless', & - avgflag='A', long_name='fractional area with water table at surface', & - ptr_col=this%fsat_col, l2g_scale_type='veg') - this%num_substeps_col(begc:endc) = spval call hist_addfld1d (fname='NSUBSTEPS', units='unitless', & avgflag='A', long_name='number of adaptive timesteps in CLM timestep', & diff --git a/src/biogeophys/SurfRunoffSatMod.F90 b/src/biogeophys/SurfRunoffSatMod.F90 new file mode 100644 index 0000000000..203bf82c04 --- /dev/null +++ b/src/biogeophys/SurfRunoffSatMod.F90 @@ -0,0 +1,369 @@ +module SurfRunoffSatMod + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Type and associated routines for calculating surface runoff due to saturated surface + ! + ! This also includes calculations of fsat (fraction of each column that is saturated) + ! + ! !USES: +#include "shr_assert.h" + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_log_mod , only : errMsg => shr_log_errMsg + use decompMod , only : bounds_type + use abortutils , only : endrun + use clm_varctl , only : iulog, use_vichydro + use clm_varcon , only : spval + use ColumnType , only : column_type + use SoilHydrologyType, only : soilhydrology_type + use SoilStateType, only : soilstate_type + use WaterfluxType, only : waterflux_type + + implicit none + save + private + + ! !PUBLIC TYPES: + + type, public :: surf_runoff_sat_type + private + ! Public data members + ! Note: these should be treated as read-only by other modules + real(r8), pointer, public :: qflx_sat_surf_col(:) ! surface runoff due to saturated surface (mm H2O /s) + real(r8), pointer, public :: fsat_col(:) ! fractional area with water table at surface + + ! Private data members + integer :: fsat_method + real(r8), pointer :: fcov_col(:) ! fractional impermeable area + contains + ! Public routines + procedure, public :: Init + + procedure, public :: SaturatedSurfaceRunoff ! Calculate surface runoff due to saturated surface + + ! Private routines + procedure, private :: InitAllocate + procedure, private :: InitHistory + procedure, private :: InitCold + + procedure, private, nopass :: ComputeFsatTopmodel + procedure, private, nopass :: ComputeFsatVic + end type surf_runoff_sat_type + + ! !PRIVATE DATA MEMBERS: + + integer, parameter :: FSAT_METHOD_TOPMODEL = 1 + integer, parameter :: FSAT_METHOD_VIC = 2 + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + ! ======================================================================== + ! Infrastructure routines + ! ======================================================================== + + !----------------------------------------------------------------------- + subroutine Init(this, bounds) + ! + ! !DESCRIPTION: + ! Initialize this surf_runoff_sat_type object + ! + ! !ARGUMENTS: + class(surf_runoff_sat_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'Init' + !----------------------------------------------------------------------- + + call this%InitAllocate(bounds) + call this%InitHistory(bounds) + call this%InitCold(bounds) + + end subroutine Init + + !----------------------------------------------------------------------- + subroutine InitAllocate(this, bounds) + ! + ! !DESCRIPTION: + ! Allocate memory for this surf_runoff_sat_type object + ! + ! !USES: + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + ! + ! !ARGUMENTS: + class(surf_runoff_sat_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: begc, endc + + character(len=*), parameter :: subname = 'InitAllocate' + !----------------------------------------------------------------------- + + begc = bounds%begc; endc= bounds%endc + + allocate(this%qflx_sat_surf_col(begc:endc)); this%qflx_sat_surf_col(:) = nan + allocate(this%fsat_col (begc:endc)); this%fsat_col (:) = nan + allocate(this%fcov_col (begc:endc)); this%fcov_col (:) = nan + + end subroutine InitAllocate + + !----------------------------------------------------------------------- + subroutine InitHistory(this, bounds) + ! + ! !DESCRIPTION: + ! Initialize surf_runoff_sat_type history variables + ! + ! !USES: + use histFileMod , only : hist_addfld1d + ! + ! !ARGUMENTS: + class(surf_runoff_sat_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: begc, endc + + character(len=*), parameter :: subname = 'InitHistory' + !----------------------------------------------------------------------- + + begc = bounds%begc; endc= bounds%endc + + this%fcov_col(begc:endc) = spval + call hist_addfld1d (fname='FCOV', units='unitless', & + avgflag='A', long_name='fractional impermeable area', & + ptr_col=this%fcov_col, l2g_scale_type='veg') + + this%fsat_col(begc:endc) = spval + call hist_addfld1d (fname='FSAT', units='unitless', & + avgflag='A', long_name='fractional area with water table at surface', & + ptr_col=this%fsat_col, l2g_scale_type='veg') + + end subroutine InitHistory + + !----------------------------------------------------------------------- + subroutine InitCold(this, bounds) + ! + ! !DESCRIPTION: + ! Perform cold-start initialization for surf_runoff_sat_type + ! + ! !ARGUMENTS: + class(surf_runoff_sat_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'InitCold' + !----------------------------------------------------------------------- + + ! TODO(wjs, 2017-07-12) We'll read fsat_method from namelist. + if (use_vichydro) then + this%fsat_method = FSAT_METHOD_VIC + else + this%fsat_method = FSAT_METHOD_TOPMODEL + end if + + end subroutine InitCold + + ! ======================================================================== + ! Science routines + ! ======================================================================== + + !----------------------------------------------------------------------- + subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrologyc, & + col, soilhydrology_inst, soilstate_inst, waterflux_inst) + ! + ! !DESCRIPTION: + ! Calculate surface runoff due to saturated surface + ! + ! !ARGUMENTS: + class(surf_runoff_sat_type), intent(inout) :: this + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(column_type) , intent(in) :: col + type(soilhydrology_type) , intent(inout) :: soilhydrology_inst + type(soilstate_type) , intent(in) :: soilstate_inst + type(waterflux_type) , intent(inout) :: waterflux_inst + ! + ! !LOCAL VARIABLES: + integer :: fc, c + + character(len=*), parameter :: subname = 'SaturatedSurfaceRunoff' + !----------------------------------------------------------------------- + + associate( & + fcov => this%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area + fsat => this%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface + qflx_sat_surf => this%qflx_sat_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + + snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + + qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) + + origflag => soilhydrology_inst%origflag , & ! Input: logical + fracice => soilhydrology_inst%fracice_col & ! Input: [real(r8) (:,:) ] fractional impermeability (-) + ) + + ! ------------------------------------------------------------------------ + ! Compute fsat + ! ------------------------------------------------------------------------ + + select case (this%fsat_method) + case (FSAT_METHOD_TOPMODEL) + call this%ComputeFsatTopmodel(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, & + fsat = fsat(bounds%begc:bounds%endc)) + case (FSAT_METHOD_VIC) + call this%ComputeFsatVic(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, & + fsat = fsat(bounds%begc:bounds%endc)) + case default + write(iulog,*) subname//' ERROR: Unrecognized fsat_method: ', this%fsat_method + call endrun(subname//' ERROR: Unrecognized fsat_method') + end select + + ! ------------------------------------------------------------------------ + ! Compute qflx_sat_surf + ! + ! assume qinmax (maximum infiltration capacity) is large relative to + ! qflx_rain_plus_snomelt in control + ! ------------------------------------------------------------------------ + + if (origflag == 1) then + if (this%fsat_method == FSAT_METHOD_VIC) then + ! NOTE(wjs, 2017-07-12) I'm not sure if it's the VIC fsat method per se that + ! is incompatible with origflag, or some other aspect of VIC: The original + ! check was for origflag == 1 and use_vichydro, which also appears in error + ! checks elsewhere. + call endrun(msg="VICHYDRO is not available for origflag=1"//errmsg(sourcefile, __LINE__)) + end if + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1) + qflx_sat_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) + end do + else + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + ! only send fast runoff directly to streams + qflx_sat_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) + + ! Set fcov just to have it on the history file + fcov(c) = fsat(c) + end do + end if + + ! ------------------------------------------------------------------------ + ! For urban columns, send flood water flux to runoff + ! ------------------------------------------------------------------------ + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + if (col%urbpoi(c)) then + ! send flood water flux to runoff for all urban columns + qflx_sat_surf(c) = qflx_sat_surf(c) + qflx_floodc(c) + end if + end do + + end associate + + end subroutine SaturatedSurfaceRunoff + + !----------------------------------------------------------------------- + subroutine ComputeFsatTopmodel(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, fsat) + ! + ! !DESCRIPTION: + ! Compute fsat using the TOPModel-based parameterization + ! + ! This is the CLM default parameterization + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(soilstate_type), intent(in) :: soilstate_inst + real(r8), intent(inout) :: fsat( bounds%begc: ) ! fractional area with water table at surface + ! + ! !LOCAL VARIABLES: + integer :: fc, c + real(r8) :: fff ! decay factor (m-1) + + character(len=*), parameter :: subname = 'ComputeFsatTopmodel' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL((ubound(fsat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + + associate( & + frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) + zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + + wtfact => soilstate_inst%wtfact_col & ! Input: [real(r8) (:) ] maximum saturated fraction for a gridcell + ) + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + fff = 0.5_r8 + if (frost_table(c) > zwt_perched(c) .and. frost_table(c) <= zwt(c)) then + ! use perched water table to determine fsat (if present) + fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt_perched(c)) + else + fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt(c)) + end if + end do + + end associate + + end subroutine ComputeFsatTopmodel + + !----------------------------------------------------------------------- + subroutine ComputeFsatVic(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, fsat) + ! + ! !DESCRIPTION: + ! Compute fsat using the VIC-based parameterization + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + real(r8), intent(inout) :: fsat( bounds%begc: ) ! fractional area with water table at surface + ! + ! !LOCAL VARIABLES: + integer :: fc, c + real(r8) :: ex(bounds%begc:bounds%endc) ! exponent + + character(len=*), parameter :: subname = 'ComputeFsatVic' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL((ubound(fsat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + + associate( & + b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter + top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers + top_moist_limited => soilhydrology_inst%top_moist_limited_col & ! Input: [real(r8) (:) ] soil moisture in top layers, limited to no greater than top_max_moist + ) + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + ex(c) = b_infil(c) / (1._r8 + b_infil(c)) + ! fsat is equivalent to A in VIC papers + fsat(c) = 1._r8 - (1._r8 - top_moist_limited(c) / top_max_moist(c))**ex(c) + end do + + end associate + + end subroutine ComputeFsatVic + + + +end module SurfRunoffSatMod diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index eae5bd00b4..e18065ec31 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -73,7 +73,6 @@ module WaterfluxType real(r8), pointer :: qflx_adv_col (:,:) ! col advective flux across different soil layer interfaces [mm H2O/s] [+ downward] real(r8), pointer :: qflx_rootsoi_col (:,:) ! col root and soil water exchange [mm H2O/s] [+ into root] real(r8), pointer :: qflx_infl_col (:) ! col infiltration (mm H2O /s) - real(r8), pointer :: qflx_sat_surf_col (:) ! col surface runoff due to saturated surface (mm H2O /s) real(r8), pointer :: qflx_infl_excess_surf_col(:) ! col surface runoff due to infiltration excess (mm H2O /s) real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff (mm H2O /s) real(r8), pointer :: qflx_surf_col (:) ! col total surface runoff (mm H2O /s) @@ -218,7 +217,6 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_adv_col (begc:endc,0:nlevsoi)) ; this%qflx_adv_col (:,:) = nan allocate(this%qflx_rootsoi_col (begc:endc,1:nlevsoi)) ; this%qflx_rootsoi_col (:,:) = nan allocate(this%qflx_infl_col (begc:endc)) ; this%qflx_infl_col (:) = nan - allocate(this%qflx_sat_surf_col (begc:endc)) ; this%qflx_sat_surf_col (:) = nan allocate(this%qflx_surf_col (begc:endc)) ; this%qflx_surf_col (:) = nan allocate(this%qflx_surf_for_bgc_col (begc:endc)) ; this%qflx_surf_for_bgc_col (:) = nan allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 4c4125b1cb..2e4599aa86 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -696,8 +696,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro filter(nc)%num_nosnowc, filter(nc)%nosnowc, & clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & - waterflux_inst, waterstate_inst, soilhydrology_inst, aerosol_inst, & - canopystate_inst, soil_water_retention_curve) + waterflux_inst, waterstate_inst, soilhydrology_inst, surf_runoff_sat_inst, & + aerosol_inst, canopystate_inst, soil_water_retention_curve) ! The following needs to be done after HydrologyNoDrainage (because it needs ! waterflux_inst%qflx_snwcp_ice_col), but before HydrologyDrainage (because @@ -811,7 +811,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, soilhydrology_inst, energyflux_inst, & + photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) call t_stopf('ecosysdyn') diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index b4b3ecbb08..66c71daa5b 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -49,7 +49,8 @@ module clm_instMod use OzoneBaseMod , only : ozone_base_type use OzoneFactoryMod , only : create_and_init_ozone_type use PhotosynthesisMod , only : photosyns_type - use SoilHydrologyType , only : soilhydrology_type + use SoilHydrologyType , only : soilhydrology_type + use SurfRunoffSatMod , only : surf_runoff_sat_type use SoilStateType , only : soilstate_type use SolarAbsorbedType , only : solarabs_type use SurfaceRadiationMod , only : surfrad_type @@ -100,6 +101,7 @@ module clm_instMod type(photosyns_type) :: photosyns_inst type(soilstate_type) :: soilstate_inst type(soilhydrology_type) :: soilhydrology_inst + type(surf_runoff_sat_type) :: surf_runoff_sat_inst type(solarabs_type) :: solarabs_inst type(surfalb_type) :: surfalb_inst type(surfrad_type) :: surfrad_inst @@ -308,6 +310,8 @@ subroutine clm_instInit(bounds) call soilhydrology_inst%Init(bounds, nlfilename) call SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) ! sets time constant properties + call surf_runoff_sat_inst%Init(bounds) + call solarabs_inst%Init(bounds) call surfalb_inst%Init(bounds) From 88c92b4978278f979b7dc61def0b349347799619 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 17 Aug 2017 11:21:59 -0600 Subject: [PATCH 005/144] Update ChangeLog_branch I'm not sure why these updates were dropped when converting from svn to git, but this commit restores them --- ChangeLog_branch | 275 ++++++++++++++++++++++++++++++++++++++ ChangeLog_branch_template | 2 + 2 files changed, 277 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index 74c338f66a..2c17e65609 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,4 +1,279 @@ =============================================================== +Tag name: ctsm_n04_clm4_5_16_r249 +Originator(s): sacks +Date: July 14, 2017 +One-line Summary: Extract SurfaceRunoff to its own module and related modularization + +Up-to-date with branch tag: modularize_surface_runoff_n02_ctsm_n02_clm4_5_16_r249 + +Purpose of changes +------------------ + +Major change is extracting SurfaceRunoff to its own module, SurfRunoffSatMod.F90 + +Also, some related modularization: +- Move urban surface runoff code into different routines +- Extract a subroutine for each fsat method +- Other minor refactoring + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - pass + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - pass + yellowstone_pgi - pass + yellowstone_gnu - pass + cheyenne_intel - pass + hobart_nag - pass + hobart_pgi - pass + hobart_intel - pass + +CLM tag used for the baseline comparisons: ctsm_n03_clm4_5_16_r249 +Answer changes +-------------- + +Changes answers relative to baseline: NO - bfb + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: + +========= New class containing what used to be the core of subroutine + SurfaceRunoff +A components/clm/src/biogeophys/SurfRunoffSatMod.F90 + +List all existing files that have been modified, and describe the changes: + +M components/clm/src/biogeophys/SoilHydrologyMod.F90 +M components/clm/src/biogeophys/SoilHydrologyType.F90 +M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 +M components/clm/src/biogeophys/WaterfluxType.F90 +M components/clm/src/biogeochem/CNDriverMod.F90 +M components/clm/src/biogeochem/CNVegetationFacade.F90 +M components/clm/src/biogeochem/CNFireLi2016Mod.F90 +M components/clm/src/biogeochem/CNFireBaseMod.F90 +M components/clm/src/biogeochem/CNFireMethodMod.F90 +M components/clm/src/biogeochem/CNFireLi2014Mod.F90 +M components/clm/src/biogeochem/CNFireNoFireMod.F90 +M components/clm/src/main/clm_instMod.F90 +M components/clm/src/main/clm_driver.F90 + +=============================================================== +=============================================================== +Tag name: ctsm_n03_clm4_5_16_r249 +Originator(s): sacks +Date: July 13, 2017 +One-line Summary: Separate qflx_surf updates into two steps + +Up-to-date with branch tag: modularize_surface_runoff_n01_ctsm_n02_clm4_5_16_r249 + +Purpose of changes +------------------ + +Separate qflx_surf updates into two steps + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - not run + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - ok + yellowstone_pgi - ok + yellowstone_gnu - ok + cheyenne_intel - ok + hobart_nag - ok + hobart_pgi - ok + hobart_intel - ok + + ok means tests pass, answers change as expected + +CLM tag used for the baseline comparisons: ctsm_n02_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: All + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + roundoff + + There are greater than roundoff-level changes in the diagnostic field + QOVER, because this field now includes QH2OSFC. Other than that, there are + just roundoff-level differences in runoff. Sometimes, these roundoff-level + runoff changes can feed back to create greater-than-roundoff level changes + over time. This happens for ch4-related fields, and for many fields in + this test with flooding: + ERP_P180x2_D.f19_g17.I2000Clm50SpRtmFl.yellowstone_pgi.clm-default + + Note that the oldhyd test is bit-for-bit: + SMS_D_Ld1_P24x1.f10_f10_musgs.I2000Clm45BgcCrop.hobart_nag.clm-oldhyd + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +M components/clm/src/biogeochem/ch4Mod.F90 +M components/clm/src/main/ColumnType.F90 +M components/clm/src/main/lnd2atmType.F90 +M components/clm/src/main/initSubgridMod.F90 +M components/clm/src/main/lnd2atmMod.F90 +M components/clm/src/biogeophys/HydrologyDrainageMod.F90 +M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 +M components/clm/src/biogeophys/WaterfluxType.F90 +M components/clm/src/biogeophys/BalanceCheckMod.F90 +M components/clm/src/biogeophys/SoilHydrologyMod.F90 +M components/clm/src/biogeophys/LakeHydrologyMod.F90 +M components/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 +M components/clm/src/cpl/lnd_import_export.F90 + +=============================================================== +=============================================================== +Tag name: ctsm_n02_clm4_5_16_r249 +Originator(s): sacks +Date: July 11, 2017 +One-line Summary: BFB refactorings towards modularization of SurfaceRunoff + +Purpose of changes +------------------ + +BFB refactorings towards modularization of SurfaceRunoff + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - not run + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - pass + yellowstone_pgi - pass + yellowstone_gnu - pass + cheyenne_intel - pass + hobart_nag - pass + hobart_pgi - pass + hobart_intel - pass + +CLM tag used for the baseline comparisons: ctsm_n01_clm4_5_16_r249 for VIC +tests, clm4_5_16_r249 for non-VIC tests + + +Answer changes +-------------- + +Changes answers relative to baseline: NO - bfb + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +M components/clm/src/biogeophys/SnowHydrologyMod.F90 +M components/clm/src/biogeophys/SoilHydrologyType.F90 +M components/clm/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 +M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 +M components/clm/src/biogeophys/WaterfluxType.F90 +M components/clm/src/biogeophys/SoilHydrologyMod.F90 +M components/clm/src/biogeophys/LakeHydrologyMod.F90 + +=============================================================== +=============================================================== Tag name: ctsm_n01_clm4_5_16_r249 Originator(s): sacks Date: July 7, 2017 diff --git a/ChangeLog_branch_template b/ChangeLog_branch_template index eb2375df86..498520f204 100644 --- a/ChangeLog_branch_template +++ b/ChangeLog_branch_template @@ -4,6 +4,8 @@ Originator(s): Date: One-line Summary: +Up-to-date with branch tag: + Purpose of changes ------------------ From ad679280469ea07416b929602cf777f9828ecfd8 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 17 Aug 2017 11:22:57 -0600 Subject: [PATCH 006/144] Remove message from ChangeLog_branch_template that is not important for git --- ChangeLog_branch_template | 2 -- 1 file changed, 2 deletions(-) diff --git a/ChangeLog_branch_template b/ChangeLog_branch_template index 498520f204..eb2375df86 100644 --- a/ChangeLog_branch_template +++ b/ChangeLog_branch_template @@ -4,8 +4,6 @@ Originator(s): Date: One-line Summary: -Up-to-date with branch tag: - Purpose of changes ------------------ From 112ea33372d8032ac094f35c67f6c0f7adcdc3cf Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 16 Aug 2017 14:12:24 -0600 Subject: [PATCH 007/144] Re-parenthesize vic equation This changes answers for vic Point is so that later refactoring can remain bit-for-bit --- src/biogeophys/SoilHydrologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index e82b9f76a8..804115ee5c 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -365,7 +365,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f + top_max_moist(c) * basis**(1._r8 + b_infil(c)))/dtime end if rsurf_vic = min(qflx_in_soil(c), rsurf_vic) - qinmax = (1._r8 - fsat(c)) * 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) + qinmax = (1._r8 - fsat(c)) * (10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic)) else qinmax=(1._r8 - fsat(c)) * minval(10._r8**(-e_ice*(icefrac(c,1:3)))*hksat(c,1:3)) end if From 82915358b3ccbe7d16ae49209b3f5e60d36a55a5 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 17 Aug 2017 14:23:41 -0600 Subject: [PATCH 008/144] Update ChangeLog_branch --- ChangeLog_branch | 99 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index 2c17e65609..5ea2019c30 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,4 +1,103 @@ =============================================================== +Tag name: ctsm_n05_clm4_5_16_r249 +Originator(s): sacks +Date: Aug 17, 2017 +One-line Summary: Re-parenthesize a VIC equation + +Purpose of changes +------------------ + +With an upcoming refactoring, answers change for VIC. The minor change here +forces the answer change to happen with this simple re-parenthesization, which I +think will allow us to avoid the answer changes in the upcoming refactoring. + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - not run + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - just ran vic tests + yellowstone_pgi - just ran vic tests + yellowstone_gnu - not run + cheyenne_intel - just ran vic tests + hobart_nag - not run + hobart_pgi - not run + hobart_intel - not run + + Just ran the following vic tests (all of the vic tests in the test list): + + ERP_D_Ld5.f09_g17.I2000Clm50Vic.yellowstone_intel.clm-vrtlay + ERP_Ld5.f09_g17.I2000Clm50Vic.yellowstone_pgi.clm-vrtlay + ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_intel.clm-vrtlay + ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_pgi.clm-decStart + SMS_Ld1.f19_g17.I2000Clm50Vic.yellowstone_intel.clm-default + ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay + ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_intel.clm-vrtlay + SMS_Ld1.f19_g17.I2000Clm50Vic.cheyenne_intel.clm-default + +CLM tag used for the baseline comparisons: ctsm_n04_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: Vic configurations + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + not investigated closely, but should just be roundoff-level + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +M components/clm/src/biogeophys/SoilHydrologyMod.F90 + +=============================================================== +=============================================================== Tag name: ctsm_n04_clm4_5_16_r249 Originator(s): sacks Date: July 14, 2017 From 4f621931d40b0798d186e9c312e07e6514ea32ee Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 17 Jul 2017 16:18:34 -0600 Subject: [PATCH 009/144] Refactor setting of icefrac and fracice in SetFracIce It looks safe to make this change because (1) fracice is only used in code with origflag == 1, and (2) icefrac is overwritten in Infiltration before it is used (other than for the setting of fracice) --- src/biogeophys/SoilHydrologyMod.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index e82b9f76a8..460ca71073 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -132,6 +132,7 @@ subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & ! !LOCAL VARIABLES: integer :: j, fc, c real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) !partial volume of ice lens in layer + real(r8) :: icefrac_orig ! original formulation for icefrac character(len=*), parameter :: subname = 'SetFracIce' !----------------------------------------------------------------------- @@ -157,13 +158,12 @@ subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & ! fractional impermeability vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - if (origflag == 1) then - icefrac(c,j) = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) - else - icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - endif + icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac(c,j)))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) + ! fracice is only used in code with origflag == 1. For this calculation, we use + ! the version of icefrac that was used in this original hydrology code. + icefrac_orig = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) + fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac_orig))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) end do end do From 222c2af46a7574fc5133b4bd9af4193639b9fafd Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 17 Jul 2017 16:22:16 -0600 Subject: [PATCH 010/144] Move / remove redundant initial settings in Infiltration --- src/biogeophys/HydrologyNoDrainageMod.F90 | 4 +-- src/biogeophys/SoilHydrologyMod.F90 | 34 ++++++++--------------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index d6af54d91a..27340057e8 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -60,7 +60,7 @@ subroutine HydrologyNoDrainage(bounds, & use clm_time_manager , only : get_step_size, get_nstep use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter - use SoilHydrologyMod , only : CLMVICMap, SetFracIce + use SoilHydrologyMod , only : CLMVICMap, SetSoilWaterFractions use SoilHydrologyMod , only : SetQflxTopSoil, Infiltration, TotalSurfaceRunoff use SoilHydrologyMod , only : UpdateUrbanPonding use SoilHydrologyMod , only : WaterTable, PerchedWaterTable @@ -177,7 +177,7 @@ subroutine HydrologyNoDrainage(bounds, & soilhydrology_inst, waterstate_inst) end if - call SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & + call SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, & soilhydrology_inst, soilstate_inst, waterstate_inst) call surf_runoff_sat_inst%SaturatedSurfaceRunoff(& diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 460ca71073..4267d845ff 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -32,7 +32,7 @@ module SoilHydrologyMod ! ! !PUBLIC MEMBER FUNCTIONS: public :: SoilHydReadNML ! Read in the Soil hydrology namelist - public :: SetFracIce ! Set diagnostic variables related to the fraction of ice in each layer + public :: SetSoilWaterFractions ! Set diagnostic variables related to the fraction of water and ice in each layer public :: SetQflxTopSoil ! Set the flux of water into the soil from the top public :: Infiltration ! Calculate infiltration into surface soil layer public :: TotalSurfaceRunoff ! Calculate total surface runoff @@ -112,11 +112,11 @@ subroutine soilHydReadNML( NLFilename ) end subroutine soilhydReadNML !----------------------------------------------------------------------- - subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & + subroutine SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, & soilhydrology_inst, soilstate_inst, waterstate_inst) ! ! !DESCRIPTION: - ! Set diagnostic variables related to the fraction of ice in each layer + ! Set diagnostic variables related to the fraction of water and ice in each layer ! ! !USES: use clm_varcon, only : denice @@ -126,7 +126,7 @@ subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst + type(soilstate_type) , intent(inout) :: soilstate_inst type(waterstate_type) , intent(in) :: waterstate_inst ! ! !LOCAL VARIABLES: @@ -134,13 +134,14 @@ subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) !partial volume of ice lens in layer real(r8) :: icefrac_orig ! original formulation for icefrac - character(len=*), parameter :: subname = 'SetFracIce' + character(len=*), parameter :: subname = 'SetSoilWaterFractions' !----------------------------------------------------------------------- associate( & dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + eff_porosity => soilstate_inst%eff_porosity_col , & ! Output: [real(r8) (:,:) ] effective porosity = porosity - vol_ice h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) @@ -156,8 +157,8 @@ subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & ! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer, ! fractional impermeability - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) + eff_porosity(c,j) = max(0.01_r8,watsat(c,j)-vol_ice(c,j)) icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) ! fracice is only used in code with origflag == 1. For this calculation, we use @@ -169,7 +170,7 @@ subroutine SetFracIce(bounds, num_hydrologyc, filter_hydrologyc, & end associate - end subroutine SetFracIce + end subroutine SetSoilWaterFractions !----------------------------------------------------------------------- subroutine SetQflxTopSoil(bounds, num_hydrologyc, filter_hydrologyc, & @@ -228,19 +229,18 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f integer , intent(in) :: num_urbanc ! number of column urban points in column filter integer , intent(in) :: filter_urbanc(:) ! column filter for urban points type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(inout) :: soilstate_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(soilstate_type) , intent(in) :: soilstate_inst type(surf_runoff_sat_type), intent(in) :: surf_runoff_sat_inst type(temperature_type) , intent(in) :: temperature_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst ! ! !LOCAL VARIABLES: - integer :: c,j,l,fc ! indices + integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) real(r8) :: s1,su,v ! variable to calculate qinmax real(r8) :: qinmax ! maximum infiltration capacity (mm/s) - real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) ! partial volume of ice lens in layer real(r8) :: alpha_evap(bounds%begc:bounds%endc) ! fraction of total evap from h2osfc real(r8) :: qflx_evap(bounds%begc:bounds%endc) ! local evaporation array real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc @@ -295,7 +295,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Output: [real(r8) (:,:) ] effective porosity = porosity - vol_ice qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface @@ -309,21 +308,12 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers top_ice => soilhydrology_inst%top_ice_col , & ! Input: [real(r8) (:) ] ice len in top VIC layers h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical - icefrac => soilhydrology_inst%icefrac_col & ! Output: [real(r8) (:,:) ] fraction of ice + icefrac => soilhydrology_inst%icefrac_col & ! Input: [real(r8) (:,:) ] fraction of ice ) dtime = get_step_size() ! Infiltration into surface soil layer (minus the evaporation) - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! Porosity of soil, partial volume of ice and liquid - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity(c,j) = max(0.01_r8,watsat(c,j)-vol_ice(c,j)) - icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - end do - end do do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) From 80808601cbf37bf38c5e310a5ee69dbf5aa04995 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 20 Jul 2017 13:27:35 -0600 Subject: [PATCH 011/144] Add citation for vic method --- src/biogeophys/SurfRunoffSatMod.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/biogeophys/SurfRunoffSatMod.F90 b/src/biogeophys/SurfRunoffSatMod.F90 index 203bf82c04..ce342aabdb 100644 --- a/src/biogeophys/SurfRunoffSatMod.F90 +++ b/src/biogeophys/SurfRunoffSatMod.F90 @@ -331,6 +331,9 @@ subroutine ComputeFsatVic(bounds, num_hydrologyc, filter_hydrologyc, & ! !DESCRIPTION: ! Compute fsat using the VIC-based parameterization ! + ! Citation: Wood et al. 1992, "A land-surface hydrology parameterization with subgrid + ! variability for general circulation models", JGR 97(D3), 2717-2728. + ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter From fb26584b447c4155495b1466ff036415f6f8f815 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 21 Jul 2017 12:22:45 -0600 Subject: [PATCH 012/144] Move calculation of qflx_in_soil and qflx_in_h2osfc out of Infiltration Point is: I want to start making Infiltration be just about calculation infiltration --- src/biogeophys/HydrologyNoDrainageMod.F90 | 5 +- src/biogeophys/SoilHydrologyMod.F90 | 107 +++++++++++++--------- src/biogeophys/WaterfluxType.F90 | 4 + 3 files changed, 71 insertions(+), 45 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 27340057e8..7df30532fe 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -61,7 +61,7 @@ subroutine HydrologyNoDrainage(bounds, & use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter use SoilHydrologyMod , only : CLMVICMap, SetSoilWaterFractions - use SoilHydrologyMod , only : SetQflxTopSoil, Infiltration, TotalSurfaceRunoff + use SoilHydrologyMod , only : SetQflxInputs, Infiltration, TotalSurfaceRunoff use SoilHydrologyMod , only : UpdateUrbanPonding use SoilHydrologyMod , only : WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation @@ -184,7 +184,8 @@ subroutine HydrologyNoDrainage(bounds, & bounds, num_hydrologyc, filter_hydrologyc, col, & soilhydrology_inst, soilstate_inst, waterflux_inst) - call SetQflxTopSoil(bounds, num_hydrologyc, filter_hydrologyc, waterflux_inst) + call SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst, surf_runoff_sat_inst, waterstate_inst) call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& energyflux_inst, soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, & diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 4267d845ff..a2381a78b0 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -14,6 +14,7 @@ module SoilHydrologyMod use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_imperv + use landunit_varcon , only : istsoil, istcrop use clm_time_manager , only : get_step_size use EnergyFluxType , only : energyflux_type use SoilHydrologyType , only : soilhydrology_type @@ -33,7 +34,7 @@ module SoilHydrologyMod ! !PUBLIC MEMBER FUNCTIONS: public :: SoilHydReadNML ! Read in the Soil hydrology namelist public :: SetSoilWaterFractions ! Set diagnostic variables related to the fraction of water and ice in each layer - public :: SetQflxTopSoil ! Set the flux of water into the soil from the top + public :: SetQflxInputs ! Set the flux of water into the soil from the top public :: Infiltration ! Calculate infiltration into surface soil layer public :: TotalSurfaceRunoff ! Calculate total surface runoff public :: UpdateUrbanPonding ! Update the state variable representing ponding on urban surfaces @@ -173,39 +174,81 @@ subroutine SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, & end subroutine SetSoilWaterFractions !----------------------------------------------------------------------- - subroutine SetQflxTopSoil(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst) + subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst, surf_runoff_sat_inst, waterstate_inst) ! ! !DESCRIPTION: - ! Set the flux of water into the soil from the top + ! Set various input fluxes of water ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(waterflux_type) , intent(inout) :: waterflux_inst + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(waterflux_type) , intent(inout) :: waterflux_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(waterstate_type) , intent(in) :: waterstate_inst ! ! !LOCAL VARIABLES: integer :: fc, c + real(r8) :: qflx_evap(bounds%begc:bounds%endc) ! local evaporation array + real(r8) :: fsno ! copy of frac_sno - character(len=*), parameter :: subname = 'SetQflxTopSoil' + character(len=*), parameter :: subname = 'SetQflxInputs' !----------------------------------------------------------------------- associate( & - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:)] net water input into soil from top (mm/s) - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:)] rain plus snow melt falling on the soil (mm/s) - qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:)] snow falling on surface water (mm/s) - qflx_floodc => waterflux_inst%qflx_floodc_col & ! Input: [real(r8) (:)] column flux of flood water from RTM - ) + snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + + qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:)] net water input into soil from top (mm/s) + qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Output: [real(r8) (:)] surface input to soil (mm/s) + qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col , & ! Output: [real(r8) (:)] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:)] rain plus snow melt falling on the soil (mm/s) + qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:)] snow falling on surface water (mm/s) + qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:)] column flux of flood water from RTM + qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:) ] evaporation flux from soil (W/m**2) [+ to atm] + qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] + qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm] + + qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + + frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) + frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) + ) do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) qflx_top_soil(c) = qflx_rain_plus_snomelt(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) + + ! Partition surface inputs between soil and h2osfc + ! + ! This is only done for soil & crop landunits, because other + ! hydrologically-active landunits (in particular, urban pervious road) do not use + ! h2osfc. + if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then + + ! explicitly use frac_sno=0 if snl=0 + if (snl(c) >= 0) then + fsno=0._r8 + ! if no snow layers, sublimation is removed from h2osoi_ice in drainage + qflx_evap(c)=qflx_evap_grnd(c) + else + fsno=frac_sno(c) + qflx_evap(c)=qflx_ev_soil(c) + endif + + qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_surf(c)) + qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_surf(c)) + + ! remove evaporation (snow treated in SnowHydrology) + qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) + qflx_top_soil_to_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) + + end if end do end associate - end subroutine SetQflxTopSoil + end subroutine SetQflxInputs !----------------------------------------------------------------------- @@ -220,7 +263,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f use shr_const_mod , only : shr_const_pi use clm_varcon , only : denh2o, denice, roverg, wimp, pc, mu, tfrz use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv - use landunit_varcon , only : istsoil, istcrop ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -242,13 +284,10 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f real(r8) :: s1,su,v ! variable to calculate qinmax real(r8) :: qinmax ! maximum infiltration capacity (mm/s) real(r8) :: alpha_evap(bounds%begc:bounds%endc) ! fraction of total evap from h2osfc - real(r8) :: qflx_evap(bounds%begc:bounds%endc) ! local evaporation array real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc - real(r8) :: qflx_in_h2osfc(bounds%begc:bounds%endc) ! surface input to h2osfc - real(r8) :: qflx_in_soil(bounds%begc:bounds%endc) ! surface input to soil + real(r8) :: qflx_in_h2osfc(bounds%begc:bounds%endc) ! net surface input to h2osfc real(r8) :: qflx_infl_excess(bounds%begc:bounds%endc) ! infiltration excess runoff -> h2osfc real(r8) :: frac_infclust ! fraction of submerged area that is connected - real(r8) :: fsno ! copy of frac_sno real(r8) :: k_wet ! linear reservoir coefficient for h2osfc real(r8) :: fac ! soil wetness of surface layer real(r8) :: psit ! negative potential of soil @@ -281,11 +320,11 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) - qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:) ] evaporation flux from soil (W/m**2) [+ to atm] - qflx_evap_soi => waterflux_inst%qflx_evap_soi_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] + qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) + qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col, & ! Input: [real(r8) (:)] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) + qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:) ] evaporation flux from soil (W/m**2) [+ to atm] qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Input: [real(r8) (:) ] net water input into soil from top (mm/s) - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm] qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) @@ -317,27 +356,8 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - ! partition moisture fluxes between soil and h2osfc if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then - ! explicitly use frac_sno=0 if snl=0 - if (snl(c) >= 0) then - fsno=0._r8 - ! if no snow layers, sublimation is removed from h2osoi_ice in drainage - qflx_evap(c)=qflx_evap_grnd(c) - else - fsno=frac_sno(c) - qflx_evap(c)=qflx_ev_soil(c) - endif - - !1. partition surface inputs between soil and h2osfc - qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_surf(c)) - qflx_in_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_surf(c)) - - !2. remove evaporation (snow treated in SnowHydrology) - qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) - !3. determine maximum infiltration rate if (use_vichydro) then top_icefrac = min(1._r8,top_ice(c)/top_max_moist(c)) @@ -364,10 +384,11 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f !4. soil infiltration and h2osfc "run-on" qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) if (h2osfcflag /= 0) then - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) + qflx_infl_excess(c) + qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) + qflx_infl_excess(c) qflx_infl_excess_surf(c) = 0._r8 else ! No h2osfc pool, so qflx_infl_excess goes directly to surface runoff + qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) qflx_infl_excess_surf(c) = qflx_infl_excess(c) end if diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index e18065ec31..33c84bf908 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -80,6 +80,8 @@ module WaterfluxType real(r8), pointer :: qflx_drain_col (:) ! col sub-surface runoff (mm H2O /s) real(r8), pointer :: qflx_rain_plus_snomelt_col(:) ! col rain plus snow melt falling on the soil (mm/s) real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) + real(r8), pointer :: qflx_in_soil_col (:) ! col surface input to soil (mm/s) + real(r8), pointer :: qflx_top_soil_to_h2osfc_col(:) ! col portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) real(r8), pointer :: qflx_h2osfc_to_ice_col (:) ! col conversion of h2osfc to ice real(r8), pointer :: qflx_snow_h2osfc_col (:) ! col snow falling on surface water real(r8), pointer :: qflx_drain_perched_col (:) ! col sub-surface runoff from perched wt (mm H2O /s) @@ -222,6 +224,8 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan allocate(this%qflx_rain_plus_snomelt_col(begc:endc)) ; this%qflx_rain_plus_snomelt_col(:) = nan allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan + allocate(this%qflx_in_soil_col (begc:endc)) ; this%qflx_in_soil_col (:) = nan + allocate(this%qflx_top_soil_to_h2osfc_col(begc:endc)) ; this%qflx_top_soil_to_h2osfc_col(:) = nan allocate(this%qflx_h2osfc_to_ice_col (begc:endc)) ; this%qflx_h2osfc_to_ice_col (:) = nan allocate(this%qflx_infl_excess_surf_col(begc:endc)) ; this%qflx_infl_excess_surf_col(:) = nan allocate(this%qflx_h2osfc_surf_col (begc:endc)) ; this%qflx_h2osfc_surf_col (:) = nan From f9c279175690ad389e48c4af6f03f0133ce82f77 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 15 Aug 2017 08:30:17 -0600 Subject: [PATCH 013/144] Separate calculation of infiltraation excess runoff into its own module --- src/biogeophys/HydrologyNoDrainageMod.F90 | 16 +- .../InfiltrationExcessRunoffMod.F90 | 342 ++++++++++++++++++ src/biogeophys/SoilHydrologyMod.F90 | 81 +---- src/main/clm_driver.F90 | 1 + src/main/clm_instMod.F90 | 3 + 5 files changed, 369 insertions(+), 74 deletions(-) create mode 100644 src/biogeophys/InfiltrationExcessRunoffMod.F90 diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 7df30532fe..ef84b76e98 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -17,6 +17,7 @@ Module HydrologyNoDrainageMod use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type use SurfRunoffSatMod , only : surf_runoff_sat_type + use InfiltrationExcessRunoffMod, only : infiltration_excess_runoff_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type use CanopyStateType , only : canopystate_type @@ -43,8 +44,8 @@ subroutine HydrologyNoDrainage(bounds, & clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & waterflux_inst, waterstate_inst, & - soilhydrology_inst, surf_runoff_sat_inst, aerosol_inst, & - canopystate_inst, soil_water_retention_curve) + soilhydrology_inst, surf_runoff_sat_inst, infiltration_excess_runoff_inst, & + aerosol_inst, canopystate_inst, soil_water_retention_curve) ! ! !DESCRIPTION: ! This is the main subroutine to execute the calculation of soil/snow @@ -93,6 +94,7 @@ subroutine HydrologyNoDrainage(bounds, & type(aerosol_type) , intent(inout) :: aerosol_inst type(soilhydrology_type) , intent(inout) :: soilhydrology_inst type(surf_runoff_sat_type), intent(inout) :: surf_runoff_sat_inst + type(infiltration_excess_runoff_type), intent(inout) :: infiltration_excess_runoff_inst type(canopystate_type) , intent(inout) :: canopystate_inst class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve ! @@ -187,9 +189,15 @@ subroutine HydrologyNoDrainage(bounds, & call SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & waterflux_inst, surf_runoff_sat_inst, waterstate_inst) + call infiltration_excess_runoff_inst%InfiltrationExcessRunoff( & + bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, waterflux_inst, & + waterstate_inst) + call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& - energyflux_inst, soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, & - temperature_inst, waterflux_inst, waterstate_inst) + infiltration_excess_runoff_inst, & + energyflux_inst, soilhydrology_inst, surf_runoff_sat_inst, & + waterflux_inst, waterstate_inst) call TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & num_urbanc, filter_urbanc, & diff --git a/src/biogeophys/InfiltrationExcessRunoffMod.F90 b/src/biogeophys/InfiltrationExcessRunoffMod.F90 new file mode 100644 index 0000000000..4d969d8abe --- /dev/null +++ b/src/biogeophys/InfiltrationExcessRunoffMod.F90 @@ -0,0 +1,342 @@ +module InfiltrationExcessRunoffMod + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Type and associated routines for computing infiltration excess runoff and related + ! variables + ! + ! !USES: +#include "shr_assert.h" + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_log_mod , only : errMsg => shr_log_errMsg + use decompMod , only : bounds_type + use abortutils , only : endrun + use clm_varctl , only : iulog, use_vichydro + use clm_varcon , only : spval, e_ice + use clm_time_manager , only : get_step_size + use SoilHydrologyType, only : soilhydrology_type + use SoilStateType , only : soilstate_type + use SurfRunoffSatMod , only : surf_runoff_sat_type + use WaterfluxType , only : waterflux_type + use WaterstateType , only : waterstate_type + + implicit none + save + private + + ! !PUBLIC TYPES: + + type, public :: infiltration_excess_runoff_type + private + ! Public data members + ! Note: these should be treated as read-only by other modules + + ! These are valid within the hydrology filter. + ! + ! Both of these give averages over the entire column. However, qinmax is implicitly + ! 0 over the fraction of the column given by fsat, and qflx_infl_excess is + ! implicitly 0 over both fsat and frac_h2osfc. + real(r8), pointer, public :: qinmax_col(:) ! maximum infiltration capacity (mm H2O /s) + real(r8), pointer, public :: qflx_infl_excess_col(:) ! infiltration excess runoff (mm H2O /s) + + ! Private data members + integer :: qinmax_method + contains + ! Public routines + procedure, public :: Init + + procedure, public :: InfiltrationExcessRunoff ! Calculate surface runoff due to infiltration excess + + ! Private routines + procedure, private :: InitAllocate + procedure, private :: InitHistory + procedure, private :: InitCold + + procedure, private, nopass :: ComputeQinmaxHksat + procedure, private, nopass :: ComputeQinmaxVic + end type infiltration_excess_runoff_type + + ! !PRIVATE DATA MEMBERS: + + integer, parameter :: QINMAX_METHOD_HKSAT = 1 + integer, parameter :: QINMAX_METHOD_VIC = 2 + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + ! ======================================================================== + ! Infrastructure routines + ! ======================================================================== + + !----------------------------------------------------------------------- + subroutine Init(this, bounds) + ! + ! !DESCRIPTION: + ! Initialize this infiltration_excess_runoff_type object + ! + ! !ARGUMENTS: + class(infiltration_excess_runoff_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'Init' + !----------------------------------------------------------------------- + + call this%InitAllocate(bounds) + call this%InitHistory(bounds) + call this%InitCold(bounds) + + end subroutine Init + + !----------------------------------------------------------------------- + subroutine InitAllocate(this, bounds) + ! + ! !DESCRIPTION: + ! Allocate memory for this infiltration_excess_runoff_type object + ! + ! !USES: + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + ! + ! !ARGUMENTS: + class(infiltration_excess_runoff_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: begc, endc + + character(len=*), parameter :: subname = 'InitAllocate' + !----------------------------------------------------------------------- + + begc = bounds%begc; endc= bounds%endc + allocate(this%qinmax_col (begc:endc)); this%qinmax_col (:) = nan + allocate(this%qflx_infl_excess_col(begc:endc)); this%qflx_infl_excess_col(:) = nan + + end subroutine InitAllocate + + !----------------------------------------------------------------------- + subroutine InitHistory(this, bounds) + ! + ! !DESCRIPTION: + ! Initialize infiltration_excess_runoff_type history variables + ! + ! !USES: + use histFileMod , only : hist_addfld1d + ! + ! !ARGUMENTS: + class(infiltration_excess_runoff_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'InitHistory' + !----------------------------------------------------------------------- + + ! Nothing to do for now + + end subroutine InitHistory + + !----------------------------------------------------------------------- + subroutine InitCold(this, bounds) + ! + ! !DESCRIPTION: + ! Perform cold-start initialization for infiltration_excess_runoff_type + ! + ! !ARGUMENTS: + class(infiltration_excess_runoff_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'InitCold' + !----------------------------------------------------------------------- + + ! TODO(wjs, 2017-08-14) We'll read qinmax_method from namelist. + if (use_vichydro) then + this%qinmax_method = QINMAX_METHOD_VIC + else + this%qinmax_method = QINMAX_METHOD_HKSAT + end if + + end subroutine InitCold + + ! ======================================================================== + ! Science routines + ! ======================================================================== + + !----------------------------------------------------------------------- + subroutine InfiltrationExcessRunoff(this, bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, waterflux_inst, waterstate_inst) + ! + ! !DESCRIPTION: + ! Calculate surface runoff due to infiltration excess + ! + ! !ARGUMENTS: + class(infiltration_excess_runoff_type) , intent(inout) :: this + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(soilstate_type) , intent(in) :: soilstate_inst + type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(waterflux_type) , intent(in) :: waterflux_inst + type(waterstate_type) , intent(in) :: waterstate_inst + ! + ! !LOCAL VARIABLES: + integer :: fc, c + real(r8) :: qinmax_on_unsaturated_area(bounds%begc:bounds%endc) ! maximum infiltration capacity on the unsaturated fraction of the column (mm H2O /s) + + character(len=*), parameter :: subname = 'InfiltrationExcessRunoff' + !----------------------------------------------------------------------- + + associate( & + qinmax => this%qinmax_col , & ! Output: [real(r8) (:) ] maximum infiltration capacity (mm H2O /s) + qflx_infl_excess => this%qflx_infl_excess_col , & ! Output: [real(r8) (:) ] infiltration excess runoff (mm H2O /s) + + fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + + qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) + + frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) + ) + + select case (this%qinmax_method) + case (QINMAX_METHOD_HKSAT) + call this%ComputeQinmaxHksat(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, & + qinmax_on_unsaturated_area = qinmax_on_unsaturated_area(bounds%begc:bounds%endc)) + case (QINMAX_METHOD_VIC) + call this%ComputeQinmaxVic(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, & + fsat = fsat(bounds%begc:bounds%endc), & + qflx_in_soil = qflx_in_soil(bounds%begc:bounds%endc), & + qinmax_on_unsaturated_area = qinmax_on_unsaturated_area(bounds%begc:bounds%endc)) + case default + write(iulog,*) subname//' ERROR: Unrecognized qinmax_method: ', this%qinmax_method + call endrun(subname//' ERROR: Unrecognized qinmax_method') + end select + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + qinmax(c) = (1._r8 - fsat(c)) * qinmax_on_unsaturated_area(c) + qflx_infl_excess(c) = max(0._r8, & + (qflx_in_soil(c) - (1.0_r8 - frac_h2osfc(c))*qinmax(c))) + end do + + end associate + + end subroutine InfiltrationExcessRunoff + + !----------------------------------------------------------------------- + subroutine ComputeQinmaxHksat(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, soilstate_inst, & + qinmax_on_unsaturated_area) + ! + ! !DESCRIPTION: + ! Compute qinmax using a parameterization based on hksat + ! + ! This is the CLM default parameterization + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(soilstate_type), intent(in) :: soilstate_inst + real(r8), intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration capacity on the unsaturated fraction of the column (mm H2O /s) + ! + ! !LOCAL VARIABLES: + integer :: fc, c + + character(len=*), parameter :: subname = 'ComputeQinmaxHksat' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL((ubound(qinmax_on_unsaturated_area) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + + associate( & + icefrac => soilhydrology_inst%icefrac_col , & ! Input: [real(r8) (:,:) ] fraction of ice + + hksat => soilstate_inst%hksat_col & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) + ) + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + qinmax_on_unsaturated_area(c) = minval(10._r8**(-e_ice*(icefrac(c,1:3)))*hksat(c,1:3)) + end do + + end associate + + end subroutine ComputeQinmaxHksat + + !----------------------------------------------------------------------- + subroutine ComputeQinmaxVic(bounds, num_hydrologyc, filter_hydrologyc, & + soilhydrology_inst, & + fsat, qflx_in_soil, qinmax_on_unsaturated_area) + ! + ! !DESCRIPTION: + ! Compute qinmax using the VIC parameterization + ! + ! Citation: Wood et al. 1992, "A land-surface hydrology parameterization with subgrid + ! variability for general circulation models", JGR 97(D3), 2717-2728. + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + real(r8) , intent(in) :: fsat( bounds%begc: ) ! fractional area with water table at surface + real(r8) , intent(in) :: qflx_in_soil( bounds%begc: ) ! surface input to soil (mm/s) + real(r8) , intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration capacity on the unsaturated fraction of the column (mm H2O /s) + ! + ! !LOCAL VARIABLES: + integer :: fc, c + real(r8) :: dtime ! land model time step (sec) + real(r8) :: top_icefrac ! ice fraction in top VIC layers + real(r8) :: max_infil ! max infiltration capacity in VIC (mm) + real(r8) :: i_0 ! average soil moisture in top VIC layers (mm) + real(r8) :: rsurf_vic ! VIC surface runoff + real(r8) :: basis ! variable soil moisture holding capacity in top VIC layers for runoff calculation + + character(len=*), parameter :: subname = 'ComputeQinmaxVic' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL((ubound(fsat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(qflx_in_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(qinmax_on_unsaturated_area) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + + associate( & + top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers + top_moist => soilhydrology_inst%top_moist_col , & ! Input: [real(r8) (:) ] soil moisture in top VIC layers + top_ice => soilhydrology_inst%top_ice_col , & ! Input: [real(r8) (:) ] ice len in top VIC layers + b_infil => soilhydrology_inst%b_infil_col & ! Input: [real(r8) (:) ] VIC b infiltration parameter + ) + + dtime = get_step_size() + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + top_icefrac = min(1._r8,top_ice(c)/top_max_moist(c)) + max_infil = (1._r8+b_infil(c)) * top_max_moist(c) + i_0 = max_infil * (1._r8 - (1._r8 - fsat(c))**(1._r8/b_infil(c))) + if(qflx_in_soil(c) <= 0._r8) then + rsurf_vic = 0._r8 + else if(max_infil <= 0._r8) then + rsurf_vic = qflx_in_soil(c) + else if((i_0 + qflx_in_soil(c)*dtime) > max_infil) then !(Eq.(3a) Wood et al. 1992) + rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c))/dtime + else !(Eq.(3b) Wood et al. 1992) + basis = 1._r8 - (i_0 + qflx_in_soil(c)*dtime)/max_infil + rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c) & + + top_max_moist(c) * basis**(1._r8 + b_infil(c)))/dtime + end if + rsurf_vic = min(qflx_in_soil(c), rsurf_vic) + qinmax_on_unsaturated_area(c) = (1._r8 - fsat(c)) * 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) + end do + + end associate + + end subroutine ComputeQinmaxVic + +end module InfiltrationExcessRunoffMod diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index a2381a78b0..96a729e7b4 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -17,6 +17,7 @@ module SoilHydrologyMod use landunit_varcon , only : istsoil, istcrop use clm_time_manager , only : get_step_size use EnergyFluxType , only : energyflux_type + use InfiltrationExcessRunoffMod, only : infiltration_excess_runoff_type use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type use SurfRunoffSatMod , only : surf_runoff_sat_type @@ -253,8 +254,9 @@ end subroutine SetQflxInputs !----------------------------------------------------------------------- subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - energyflux_inst, soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, & - temperature_inst, waterflux_inst, waterstate_inst) + infiltration_excess_runoff_inst, & + energyflux_inst, soilhydrology_inst, surf_runoff_sat_inst, & + waterflux_inst, waterstate_inst) ! ! !DESCRIPTION: ! Calculate infiltration into surface soil layer (minus the evaporation) @@ -270,54 +272,31 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points integer , intent(in) :: num_urbanc ! number of column urban points in column filter integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(energyflux_type) , intent(in) :: energyflux_inst + type(infiltration_excess_runoff_type), intent(in) :: infiltration_excess_runoff_inst + type(energyflux_type) , intent(in) :: energyflux_inst type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst type(surf_runoff_sat_type), intent(in) :: surf_runoff_sat_inst - type(temperature_type) , intent(in) :: temperature_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst ! ! !LOCAL VARIABLES: integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) - real(r8) :: s1,su,v ! variable to calculate qinmax - real(r8) :: qinmax ! maximum infiltration capacity (mm/s) - real(r8) :: alpha_evap(bounds%begc:bounds%endc) ! fraction of total evap from h2osfc real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc real(r8) :: qflx_in_h2osfc(bounds%begc:bounds%endc) ! net surface input to h2osfc - real(r8) :: qflx_infl_excess(bounds%begc:bounds%endc) ! infiltration excess runoff -> h2osfc real(r8) :: frac_infclust ! fraction of submerged area that is connected real(r8) :: k_wet ! linear reservoir coefficient for h2osfc - real(r8) :: fac ! soil wetness of surface layer - real(r8) :: psit ! negative potential of soil - real(r8) :: hr ! relative humidity - real(r8) :: wx ! partial volume of ice and water of surface layer - real(r8) :: z_avg - real(r8) :: rho_avg - real(r8) :: fmelt - real(r8) :: f_sno - real(r8) :: imped - real(r8) :: d - real(r8) :: h2osoi_vol - real(r8) :: basis ! temporary, variable soil moisture holding capacity - ! in top VIC layers for runoff calculation - real(r8) :: rsurf_vic ! temp VIC surface runoff - real(r8) :: i_0(bounds%begc:bounds%endc) ! average soil moisture in top VIC layers (mm) - real(r8) :: max_infil(bounds%begc:bounds%endc) ! max infiltration capacity in VIC (mm) - real(r8) :: top_icefrac ! temporary, ice fraction in top VIC layers !----------------------------------------------------------------------- associate( & snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) + qflx_infl_excess => infiltration_excess_runoff_inst%qflx_infl_excess_col , & ! Input: [real(r8) (:)] infiltration excess runoff (mm H2O /s) + qinmax => infiltration_excess_runoff_inst%qinmax_col , & ! Input: [real(r8) (:)] maximum infiltration capacity (mm H2O /s) frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Output: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) + frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Input: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) @@ -329,25 +308,10 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) - smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) - fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - top_moist => soilhydrology_inst%top_moist_col , & ! Input: [real(r8) (:) ] soil moisture in top VIC layers - top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers - top_ice => soilhydrology_inst%top_ice_col , & ! Input: [real(r8) (:) ] ice len in top VIC layers - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical - icefrac => soilhydrology_inst%icefrac_col & ! Input: [real(r8) (:,:) ] fraction of ice + h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical ) dtime = get_step_size() @@ -358,29 +322,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f c = filter_hydrologyc(fc) if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then - !3. determine maximum infiltration rate - if (use_vichydro) then - top_icefrac = min(1._r8,top_ice(c)/top_max_moist(c)) - max_infil(c) = (1._r8+b_infil(c)) * top_max_moist(c) - i_0(c) = max_infil(c) * (1._r8 - (1._r8 - fsat(c))**(1._r8/b_infil(c))) - if(qflx_in_soil(c) <= 0._r8) then - rsurf_vic = 0._r8 - else if(max_infil(c) <= 0._r8) then - rsurf_vic = qflx_in_soil(c) - else if((i_0(c) + qflx_in_soil(c)*dtime) > max_infil(c)) then !(Eq.(3a) Wood et al. 1992) - rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c))/dtime - else !(Eq.(3b) Wood et al. 1992) - basis = 1._r8 - (i_0(c) + qflx_in_soil(c)*dtime)/max_infil(c) - rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c) & - + top_max_moist(c) * basis**(1._r8 + b_infil(c)))/dtime - end if - rsurf_vic = min(qflx_in_soil(c), rsurf_vic) - qinmax = (1._r8 - fsat(c)) * 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) - else - qinmax=(1._r8 - fsat(c)) * minval(10._r8**(-e_ice*(icefrac(c,1:3)))*hksat(c,1:3)) - end if - qflx_infl_excess(c) = max(0._r8,qflx_in_soil(c) - (1.0_r8 - frac_h2osfc(c))*qinmax) - !4. soil infiltration and h2osfc "run-on" qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) if (h2osfcflag /= 0) then @@ -427,7 +368,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f h2osfc(c) = 0.0 qflx_h2osfc_drain(c)= 0._r8 else - qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax,h2osfc(c)/dtime) + qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax(c),h2osfc(c)/dtime) endif if(h2osfcflag==0) then diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 2e4599aa86..0b23e5d572 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -697,6 +697,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & waterflux_inst, waterstate_inst, soilhydrology_inst, surf_runoff_sat_inst, & + infiltration_excess_runoff_inst, & aerosol_inst, canopystate_inst, soil_water_retention_curve) ! The following needs to be done after HydrologyNoDrainage (because it needs diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 66c71daa5b..a683f02e8a 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -44,6 +44,7 @@ module clm_instMod use EnergyFluxType , only : energyflux_type use FrictionVelocityMod , only : frictionvel_type use GlacierSurfaceMassBalanceMod , only : glacier_smb_type + use InfiltrationExcessRunoffMod , only : infiltration_excess_runoff_type use IrrigationMod , only : irrigation_type use LakeStateType , only : lakestate_type use OzoneBaseMod , only : ozone_base_type @@ -95,6 +96,7 @@ module clm_instMod type(energyflux_type) :: energyflux_inst type(frictionvel_type) :: frictionvel_inst type(glacier_smb_type) :: glacier_smb_inst + type(infiltration_excess_runoff_type) :: infiltration_excess_runoff_inst type(irrigation_type) :: irrigation_inst type(lakestate_type) :: lakestate_inst class(ozone_base_type), allocatable :: ozone_inst @@ -311,6 +313,7 @@ subroutine clm_instInit(bounds) call SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) ! sets time constant properties call surf_runoff_sat_inst%Init(bounds) + call infiltration_excess_runoff_inst%Init(bounds) call solarabs_inst%Init(bounds) From 6c81f0e9d08c6aded03a2913521fa6864de422c1 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 15 Aug 2017 12:55:57 -0600 Subject: [PATCH 014/144] Temporary kludgey fix to fix runtime error This is needed to avoid a FPE (or something like that) in this line of code: qflx_infl_excess(c) = max(0._r8, & (qflx_in_soil(c) - (1.0_r8 - frac_h2osfc(c))*qinmax(c))) A more robust fix would be to set qflx_in_soil appropriately for all hydrologically-active columns (including urban hydrology columns). --- src/biogeophys/SoilHydrologyMod.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 96a729e7b4..cb3513d7c3 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -244,6 +244,10 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) qflx_top_soil_to_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) + else + ! FIXME(wjs, 2017-08-15) Rather than this kludge, instead set qflx_in_soil and + ! qflx_top_soil_to_h2osfc to reasonable values for other landunits + qflx_in_soil(c) = 0._r8 end if end do From 1627b5dd0dec730defecc3e7fa532a65da538fe5 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 15 Aug 2017 13:19:50 -0600 Subject: [PATCH 015/144] Fix accidental double-counting of (1-fsat) for vic --- src/biogeophys/InfiltrationExcessRunoffMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/InfiltrationExcessRunoffMod.F90 b/src/biogeophys/InfiltrationExcessRunoffMod.F90 index 4d969d8abe..e4392f2b91 100644 --- a/src/biogeophys/InfiltrationExcessRunoffMod.F90 +++ b/src/biogeophys/InfiltrationExcessRunoffMod.F90 @@ -332,7 +332,7 @@ subroutine ComputeQinmaxVic(bounds, num_hydrologyc, filter_hydrologyc, & + top_max_moist(c) * basis**(1._r8 + b_infil(c)))/dtime end if rsurf_vic = min(qflx_in_soil(c), rsurf_vic) - qinmax_on_unsaturated_area(c) = (1._r8 - fsat(c)) * 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) + qinmax_on_unsaturated_area(c) = 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) end do end associate From 4885e6914789c51efe48d8371ccaa9af2d8e736b Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 21 Aug 2017 12:33:04 -0600 Subject: [PATCH 016/144] Avoid divide by zero This should only affect tests with the oldhyd test mod. However, it is needed in order for these tests to pass: ERP_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.yellowstone_intel.clm-allActive ERP_D_P15x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.yellowstone_intel.clm-cropColdStart ERP_P180x2_D_Ld5.f19_g17.I2000Clm50BgcDvCrop.yellowstone_pgi.clm-crop ERP_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-allActive ERP_D_P15x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-cropColdStart --- src/biogeophys/SoilHydrologyMod.F90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index cb3513d7c3..c14e3e7233 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -165,7 +165,12 @@ subroutine SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, & ! fracice is only used in code with origflag == 1. For this calculation, we use ! the version of icefrac that was used in this original hydrology code. - icefrac_orig = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) + if (h2osoi_ice(c,j) == 0._r8) then + ! Avoid possible divide by zero (in case h2osoi_liq(c,j) is also 0) + icefrac_orig = 0._r8 + else + icefrac_orig = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) + end if fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac_orig))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) end do end do From 192c84e41772f66f2696afbeaa490473856b5b82 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 21 Aug 2017 14:54:20 -0600 Subject: [PATCH 017/144] Update ChangeLog --- ChangeLog_branch | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index 5ea2019c30..1534d4caeb 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,4 +1,102 @@ =============================================================== +Tag name: ctsm_n06_clm4_5_16_r249 +Originator(s): sacks +Date: Aug 21, 2017 +One-line Summary: Modularization of Infiltration - first stage + +Purpose of changes +------------------ + +Separate out the first 3 steps of subroutine Infiltration into more modular +homes. The biggest piece of this is to introduce a new +InfiltrationExcessRunoffMod.F90; this will be where alternative +parameterizations of infiltration excess runoff can be put. + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - not run + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - pass + yellowstone_pgi - pass + yellowstone_gnu - pass + cheyenne_intel - pass + hobart_nag - pass + hobart_pgi - pass + hobart_intel - pass + + NOTE: Most tests were run on 24913d0. On the final commit (afdbcf7), I ran + only the following tests: + + These test failed without the fix in afdbcf7, so I reran them with that fix: + + ERP_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.yellowstone_intel.clm-allActive + ERP_D_P15x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.yellowstone_intel.clm-cropColdStart + ERP_P180x2_D_Ld5.f19_g17.I2000Clm50BgcDvCrop.yellowstone_pgi.clm-crop + ERP_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-allActive + ERP_D_P15x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-cropColdStart + + This is the only oldhyd test, and so is the only test that should be + affected by this change: + + SMS_D_Ld1_P24x1.f10_f10_musgs.I2000Clm45BgcCrop.hobart_nag.clm-oldhyd + +CLM tag used for the baseline comparisons: ctsm_n05_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: + +========= Holds the portion of subroutine Infiltration that actually computes + the infiltration excess runoff flux. New parameterizations of + infiltration excess runoff should be put here. +A components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 + +List all existing files that have been modified, and describe the changes: + +========= Main changes, as described above +M components/clm/src/biogeophys/SoilHydrologyMod.F90 +M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 +M components/clm/src/biogeophys/WaterfluxType.F90 +M components/clm/src/main/clm_driver.F90 +M components/clm/src/main/clm_instMod.F90 + +========= Just add a comment +M components/clm/src/biogeophys/SurfRunoffSatMod.F90 + +=============================================================== +=============================================================== Tag name: ctsm_n05_clm4_5_16_r249 Originator(s): sacks Date: Aug 17, 2017 From 89519c5d4cb3e6160fa2dab95a5954d2c2d619cb Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 21 Aug 2017 15:23:45 -0600 Subject: [PATCH 018/144] Rename qflx_sat_surf to qflx_sat_excess_surf This was suggested at a ctsm meeting, in order to have more symmetry with qflx_infl_excess --- src/biogeophys/SoilHydrologyMod.F90 | 20 +++++++++---------- src/biogeophys/SurfRunoffSatMod.F90 | 30 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index c14e3e7233..c16a831bca 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -215,7 +215,7 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm] - qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) @@ -242,8 +242,8 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & qflx_evap(c)=qflx_ev_soil(c) endif - qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_surf(c)) - qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_surf(c)) + qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) + qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) ! remove evaporation (snow treated in SnowHydrology) qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) @@ -317,7 +317,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) - qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical @@ -391,9 +391,9 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f ! non-vegetated landunits (i.e. urban) use original CLM4 code if (snl(c) >= 0) then ! when no snow present, sublimation is removed in Drainage - qflx_infl(c) = qflx_top_soil(c) - qflx_sat_surf(c) - qflx_evap_grnd(c) + qflx_infl(c) = qflx_top_soil(c) - qflx_sat_excess_surf(c) - qflx_evap_grnd(c) else - qflx_infl(c) = qflx_top_soil(c) - qflx_sat_surf(c) & + qflx_infl(c) = qflx_top_soil(c) - qflx_sat_excess_surf(c) & - (1.0_r8 - frac_sno(c)) * qflx_ev_soil(c) end if qflx_h2osfc_surf(c) = 0._r8 @@ -459,7 +459,7 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & xs_urban => soilhydrology_inst%xs_urban_col , & ! Output: [real(r8) (:) ] excess soil water above urban ponding limit - qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) ) @@ -474,7 +474,7 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & c = filter_hydrologyc(fc) ! Depending on whether h2osfcflag is 0 or 1, one of qflx_infl_excess or ! qflx_h2osfc_surf will always be 0. But it's safe to just add them both. - qflx_surf(c) = qflx_sat_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c) + qflx_surf(c) = qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c) ! TODO(wjs, 2017-07-11) I'm distinguishing between qflx_surf and qflx_surf_for_bgc ! simply to maintain answers as they were before. But I have a feeling that the @@ -483,8 +483,8 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & ! code to use qflx_surf and remove this qflx_surf_for_bgc variable. ! Alternatively, if we deem the current implementation correct, we should ! consider renaming this something better than qflx_surf_for_bgc, or simply - ! making the BGC code depend on qflx_sat_surf, if that's what's intended. - qflx_surf_for_bgc(c) = qflx_sat_surf(c) + qflx_infl_excess_surf(c) + ! making the BGC code depend on qflx_sat_excess_surf, if that's what's intended. + qflx_surf_for_bgc(c) = qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c) end do ! ------------------------------------------------------------------------ diff --git a/src/biogeophys/SurfRunoffSatMod.F90 b/src/biogeophys/SurfRunoffSatMod.F90 index ce342aabdb..3bce63425a 100644 --- a/src/biogeophys/SurfRunoffSatMod.F90 +++ b/src/biogeophys/SurfRunoffSatMod.F90 @@ -29,7 +29,7 @@ module SurfRunoffSatMod private ! Public data members ! Note: these should be treated as read-only by other modules - real(r8), pointer, public :: qflx_sat_surf_col(:) ! surface runoff due to saturated surface (mm H2O /s) + real(r8), pointer, public :: qflx_sat_excess_surf_col(:) ! surface runoff due to saturated surface (mm H2O /s) real(r8), pointer, public :: fsat_col(:) ! fractional area with water table at surface ! Private data members @@ -106,9 +106,9 @@ subroutine InitAllocate(this, bounds) begc = bounds%begc; endc= bounds%endc - allocate(this%qflx_sat_surf_col(begc:endc)); this%qflx_sat_surf_col(:) = nan - allocate(this%fsat_col (begc:endc)); this%fsat_col (:) = nan - allocate(this%fcov_col (begc:endc)); this%fcov_col (:) = nan + allocate(this%qflx_sat_excess_surf_col(begc:endc)) ; this%qflx_sat_excess_surf_col(:) = nan + allocate(this%fsat_col(begc:endc)) ; this%fsat_col(:) = nan + allocate(this%fcov_col(begc:endc)) ; this%fcov_col(:) = nan end subroutine InitAllocate @@ -197,17 +197,17 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog !----------------------------------------------------------------------- associate( & - fcov => this%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area - fsat => this%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface - qflx_sat_surf => this%qflx_sat_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + fcov => this%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area + fsat => this%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface + qflx_sat_excess_surf => this%qflx_sat_excess_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM + qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) - origflag => soilhydrology_inst%origflag , & ! Input: logical - fracice => soilhydrology_inst%fracice_col & ! Input: [real(r8) (:,:) ] fractional impermeability (-) + origflag => soilhydrology_inst%origflag , & ! Input: logical + fracice => soilhydrology_inst%fracice_col & ! Input: [real(r8) (:,:) ] fractional impermeability (-) ) ! ------------------------------------------------------------------------ @@ -229,7 +229,7 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog end select ! ------------------------------------------------------------------------ - ! Compute qflx_sat_surf + ! Compute qflx_sat_excess_surf ! ! assume qinmax (maximum infiltration capacity) is large relative to ! qflx_rain_plus_snomelt in control @@ -246,13 +246,13 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1) - qflx_sat_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) + qflx_sat_excess_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) end do else do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) ! only send fast runoff directly to streams - qflx_sat_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) + qflx_sat_excess_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) ! Set fcov just to have it on the history file fcov(c) = fsat(c) @@ -267,7 +267,7 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog c = filter_hydrologyc(fc) if (col%urbpoi(c)) then ! send flood water flux to runoff for all urban columns - qflx_sat_surf(c) = qflx_sat_surf(c) + qflx_floodc(c) + qflx_sat_excess_surf(c) = qflx_sat_excess_surf(c) + qflx_floodc(c) end if end do From 4188c58a6a3330b3e1fb23e19a1443a11448449f Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 21 Aug 2017 15:51:36 -0600 Subject: [PATCH 019/144] Rename SurfRunoffSatMod to SaturatedExcessRunoffMod Also similar renames of the derived type, main science method, etc. Reasons: (1) I found the old name unintuitive and could never remember it; (2) for consistency with InfiltrationExcessRunoffMod --- src/biogeochem/CNDriverMod.F90 | 8 ++--- src/biogeochem/CNFireBaseMod.F90 | 6 ++-- src/biogeochem/CNFireLi2014Mod.F90 | 8 ++--- src/biogeochem/CNFireLi2016Mod.F90 | 8 ++--- src/biogeochem/CNFireMethodMod.F90 | 6 ++-- src/biogeochem/CNFireNoFireMod.F90 | 6 ++-- src/biogeochem/CNVegetationFacade.F90 | 8 ++--- src/biogeophys/HydrologyNoDrainageMod.F90 | 16 ++++----- .../InfiltrationExcessRunoffMod.F90 | 8 ++--- ...atMod.F90 => SaturatedExcessRunoffMod.F90} | 35 +++++++++---------- src/biogeophys/SoilHydrologyMod.F90 | 20 +++++------ src/main/clm_driver.F90 | 4 +-- src/main/clm_instMod.F90 | 6 ++-- 13 files changed, 69 insertions(+), 70 deletions(-) rename src/biogeophys/{SurfRunoffSatMod.F90 => SaturatedExcessRunoffMod.F90} (93%) diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index 05c68c757a..f61d1f6b23 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -36,7 +36,7 @@ module CNDriverMod use PhotosynthesisMod , only : photosyns_type use ch4Mod , only : ch4_type use EnergyFluxType , only : energyflux_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type ! ! !PUBLIC TYPES: implicit none @@ -91,7 +91,7 @@ subroutine CNDriverNoLeaching(bounds, soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - dgvs_inst, photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & + dgvs_inst, photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, cnfire_method) ! ! !DESCRIPTION: @@ -175,7 +175,7 @@ subroutine CNDriverNoLeaching(bounds, type(ch4_type) , intent(in) :: ch4_inst type(dgvs_type) , intent(inout) :: dgvs_inst type(photosyns_type) , intent(in) :: photosyns_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method class(cnfire_method_type) , intent(inout) :: cnfire_method @@ -737,7 +737,7 @@ subroutine CNDriverNoLeaching(bounds, call t_startf('CNFire') call cnfire_method%CNFireArea(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, & totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 77911d8f29..26249cd76d 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -35,7 +35,7 @@ module CNFireBaseMod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -263,7 +263,7 @@ end subroutine CNFireInterp !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -280,7 +280,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index 847eedaa54..ec90ee438d 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -34,7 +34,7 @@ module CNFireLi2014Mod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -83,7 +83,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -106,7 +106,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst @@ -164,7 +164,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fd_pft => pftcon%fd_pft , & ! Input: btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf => waterstate_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 8d492909d4..dd2c6c393f 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -34,7 +34,7 @@ module CNFireLi2016Mod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -84,7 +84,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -108,7 +108,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst @@ -171,7 +171,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fd_pft => pftcon%fd_pft , & ! Input: btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool diff --git a/src/biogeochem/CNFireMethodMod.F90 b/src/biogeochem/CNFireMethodMod.F90 index 99f3f19f63..e98114ba76 100644 --- a/src/biogeochem/CNFireMethodMod.F90 +++ b/src/biogeochem/CNFireMethodMod.F90 @@ -96,7 +96,7 @@ end subroutine CNFireInterp_interface !----------------------------------------------------------------------- subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -107,7 +107,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil use decompMod , only : bounds_type use atm2lndType , only : atm2lnd_type use EnergyFluxType , only : energyflux_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use WaterstateType , only : waterstate_type use CNVegStateType , only : cnveg_state_type use CNVegCarbonStateType , only : cnveg_carbonstate_type @@ -122,7 +122,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNFireNoFireMod.F90 b/src/biogeochem/CNFireNoFireMod.F90 index 11252013cf..9f779be9cd 100644 --- a/src/biogeochem/CNFireNoFireMod.F90 +++ b/src/biogeochem/CNFireNoFireMod.F90 @@ -16,7 +16,7 @@ module CNFireNoFireMod use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use EnergyFluxType , only : energyflux_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use WaterstateType , only : waterstate_type use CNFireMethodMod , only : cnfire_method_type use CNFireBaseMod , only : cnfire_base_type @@ -58,7 +58,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, surf_runoff_sat_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -76,7 +76,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 42fd8df962..2fdbf691da 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -72,7 +72,7 @@ module CNVegetationFacade use CNDVType , only : dgvs_type use CNDVDriverMod , only : CNDVDriver, CNDVHIST use EnergyFluxType , only : energyflux_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use FrictionVelocityMod , only : frictionvel_type use SoilBiogeochemStateType , only : soilBiogeochem_state_type use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type @@ -783,7 +783,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & + photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) ! ! !DESCRIPTION: @@ -822,7 +822,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & type(crop_type) , intent(inout) :: crop_inst type(ch4_type) , intent(in) :: ch4_inst type(photosyns_type) , intent(in) :: photosyns_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method type(fireemis_type) , intent(inout) :: fireemis_inst @@ -852,7 +852,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - this%dgvs_inst, photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & + this%dgvs_inst, photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, this%cnfire_method) ! fire carbon emissions diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index ef84b76e98..5cfca79a6a 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -16,7 +16,7 @@ Module HydrologyNoDrainageMod use TemperatureType , only : temperature_type use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod, only : saturated_excess_runoff_type use InfiltrationExcessRunoffMod, only : infiltration_excess_runoff_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type @@ -44,7 +44,7 @@ subroutine HydrologyNoDrainage(bounds, & clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & waterflux_inst, waterstate_inst, & - soilhydrology_inst, surf_runoff_sat_inst, infiltration_excess_runoff_inst, & + soilhydrology_inst, saturated_excess_runoff_inst, infiltration_excess_runoff_inst, & aerosol_inst, canopystate_inst, soil_water_retention_curve) ! ! !DESCRIPTION: @@ -93,7 +93,7 @@ subroutine HydrologyNoDrainage(bounds, & type(waterstate_type) , intent(inout) :: waterstate_inst type(aerosol_type) , intent(inout) :: aerosol_inst type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(surf_runoff_sat_type), intent(inout) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type), intent(inout) :: saturated_excess_runoff_inst type(infiltration_excess_runoff_type), intent(inout) :: infiltration_excess_runoff_inst type(canopystate_type) , intent(inout) :: canopystate_inst class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve @@ -182,26 +182,26 @@ subroutine HydrologyNoDrainage(bounds, & call SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, & soilhydrology_inst, soilstate_inst, waterstate_inst) - call surf_runoff_sat_inst%SaturatedSurfaceRunoff(& + call saturated_excess_runoff_inst%SaturatedExcessRunoff(& bounds, num_hydrologyc, filter_hydrologyc, col, & soilhydrology_inst, soilstate_inst, waterflux_inst) call SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst, surf_runoff_sat_inst, waterstate_inst) + waterflux_inst, saturated_excess_runoff_inst, waterstate_inst) call infiltration_excess_runoff_inst%InfiltrationExcessRunoff( & bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, waterflux_inst, & + soilhydrology_inst, soilstate_inst, saturated_excess_runoff_inst, waterflux_inst, & waterstate_inst) call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& infiltration_excess_runoff_inst, & - energyflux_inst, soilhydrology_inst, surf_runoff_sat_inst, & + energyflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, & waterflux_inst, waterstate_inst) call TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & num_urbanc, filter_urbanc, & - waterflux_inst, soilhydrology_inst, surf_runoff_sat_inst, waterstate_inst) + waterflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, waterstate_inst) call UpdateUrbanPonding(bounds, num_urbanc, filter_urbanc, & waterstate_inst, soilhydrology_inst, waterflux_inst) diff --git a/src/biogeophys/InfiltrationExcessRunoffMod.F90 b/src/biogeophys/InfiltrationExcessRunoffMod.F90 index e4392f2b91..1d482f1d84 100644 --- a/src/biogeophys/InfiltrationExcessRunoffMod.F90 +++ b/src/biogeophys/InfiltrationExcessRunoffMod.F90 @@ -16,7 +16,7 @@ module InfiltrationExcessRunoffMod use clm_time_manager , only : get_step_size use SoilHydrologyType, only : soilhydrology_type use SoilStateType , only : soilstate_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod, only : saturated_excess_runoff_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type @@ -168,7 +168,7 @@ end subroutine InitCold !----------------------------------------------------------------------- subroutine InfiltrationExcessRunoff(this, bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, surf_runoff_sat_inst, waterflux_inst, waterstate_inst) + soilhydrology_inst, soilstate_inst, saturated_excess_runoff_inst, waterflux_inst, waterstate_inst) ! ! !DESCRIPTION: ! Calculate surface runoff due to infiltration excess @@ -180,7 +180,7 @@ subroutine InfiltrationExcessRunoff(this, bounds, num_hydrologyc, filter_hydrolo integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(soilstate_type) , intent(in) :: soilstate_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(waterflux_type) , intent(in) :: waterflux_inst type(waterstate_type) , intent(in) :: waterstate_inst ! @@ -195,7 +195,7 @@ subroutine InfiltrationExcessRunoff(this, bounds, num_hydrologyc, filter_hydrolo qinmax => this%qinmax_col , & ! Output: [real(r8) (:) ] maximum infiltration capacity (mm H2O /s) qflx_infl_excess => this%qflx_infl_excess_col , & ! Output: [real(r8) (:) ] infiltration excess runoff (mm H2O /s) - fsat => surf_runoff_sat_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + fsat => saturated_excess_runoff_inst%fsat_col, & ! Input: [real(r8) (:) ] fractional area with water table at surface qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) diff --git a/src/biogeophys/SurfRunoffSatMod.F90 b/src/biogeophys/SaturatedExcessRunoffMod.F90 similarity index 93% rename from src/biogeophys/SurfRunoffSatMod.F90 rename to src/biogeophys/SaturatedExcessRunoffMod.F90 index 3bce63425a..bb24aea1d6 100644 --- a/src/biogeophys/SurfRunoffSatMod.F90 +++ b/src/biogeophys/SaturatedExcessRunoffMod.F90 @@ -1,4 +1,4 @@ -module SurfRunoffSatMod +module SaturatedExcessRunoffMod !----------------------------------------------------------------------- ! !DESCRIPTION: @@ -25,7 +25,7 @@ module SurfRunoffSatMod ! !PUBLIC TYPES: - type, public :: surf_runoff_sat_type + type, public :: saturated_excess_runoff_type private ! Public data members ! Note: these should be treated as read-only by other modules @@ -39,7 +39,7 @@ module SurfRunoffSatMod ! Public routines procedure, public :: Init - procedure, public :: SaturatedSurfaceRunoff ! Calculate surface runoff due to saturated surface + procedure, public :: SaturatedExcessRunoff ! Calculate surface runoff due to saturated surface ! Private routines procedure, private :: InitAllocate @@ -48,7 +48,7 @@ module SurfRunoffSatMod procedure, private, nopass :: ComputeFsatTopmodel procedure, private, nopass :: ComputeFsatVic - end type surf_runoff_sat_type + end type saturated_excess_runoff_type ! !PRIVATE DATA MEMBERS: @@ -68,10 +68,10 @@ module SurfRunoffSatMod subroutine Init(this, bounds) ! ! !DESCRIPTION: - ! Initialize this surf_runoff_sat_type object + ! Initialize this saturated_excess_runoff_type object ! ! !ARGUMENTS: - class(surf_runoff_sat_type), intent(inout) :: this + class(saturated_excess_runoff_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: @@ -89,13 +89,13 @@ end subroutine Init subroutine InitAllocate(this, bounds) ! ! !DESCRIPTION: - ! Allocate memory for this surf_runoff_sat_type object + ! Allocate memory for this saturated_excess_runoff_type object ! ! !USES: use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) ! ! !ARGUMENTS: - class(surf_runoff_sat_type), intent(inout) :: this + class(saturated_excess_runoff_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: @@ -116,13 +116,13 @@ end subroutine InitAllocate subroutine InitHistory(this, bounds) ! ! !DESCRIPTION: - ! Initialize surf_runoff_sat_type history variables + ! Initialize saturated_excess_runoff_type history variables ! ! !USES: use histFileMod , only : hist_addfld1d ! ! !ARGUMENTS: - class(surf_runoff_sat_type), intent(inout) :: this + class(saturated_excess_runoff_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: @@ -149,10 +149,10 @@ end subroutine InitHistory subroutine InitCold(this, bounds) ! ! !DESCRIPTION: - ! Perform cold-start initialization for surf_runoff_sat_type + ! Perform cold-start initialization for saturated_excess_runoff_type ! ! !ARGUMENTS: - class(surf_runoff_sat_type), intent(inout) :: this + class(saturated_excess_runoff_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: @@ -174,14 +174,14 @@ end subroutine InitCold ! ======================================================================== !----------------------------------------------------------------------- - subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrologyc, & + subroutine SaturatedExcessRunoff (this, bounds, num_hydrologyc, filter_hydrologyc, & col, soilhydrology_inst, soilstate_inst, waterflux_inst) ! ! !DESCRIPTION: ! Calculate surface runoff due to saturated surface ! ! !ARGUMENTS: - class(surf_runoff_sat_type), intent(inout) :: this + class(saturated_excess_runoff_type), intent(inout) :: this type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points @@ -193,7 +193,7 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog ! !LOCAL VARIABLES: integer :: fc, c - character(len=*), parameter :: subname = 'SaturatedSurfaceRunoff' + character(len=*), parameter :: subname = 'SaturatedExcessRunoff' !----------------------------------------------------------------------- associate( & @@ -273,7 +273,7 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog end associate - end subroutine SaturatedSurfaceRunoff + end subroutine SaturatedExcessRunoff !----------------------------------------------------------------------- subroutine ComputeFsatTopmodel(bounds, num_hydrologyc, filter_hydrologyc, & @@ -368,5 +368,4 @@ subroutine ComputeFsatVic(bounds, num_hydrologyc, filter_hydrologyc, & end subroutine ComputeFsatVic - -end module SurfRunoffSatMod +end module SaturatedExcessRunoffMod diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index c16a831bca..cf300064eb 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -20,7 +20,7 @@ module SoilHydrologyMod use InfiltrationExcessRunoffMod, only : infiltration_excess_runoff_type use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod, only : saturated_excess_runoff_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type use TemperatureType , only : temperature_type @@ -181,7 +181,7 @@ end subroutine SetSoilWaterFractions !----------------------------------------------------------------------- subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst, surf_runoff_sat_inst, waterstate_inst) + waterflux_inst, saturated_excess_runoff_inst, waterstate_inst) ! ! !DESCRIPTION: ! Set various input fluxes of water @@ -191,7 +191,7 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points type(waterflux_type) , intent(inout) :: waterflux_inst - type(surf_runoff_sat_type) , intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(in) :: waterstate_inst ! ! !LOCAL VARIABLES: @@ -215,7 +215,7 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm] - qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_sat_excess_surf => saturated_excess_runoff_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) @@ -264,7 +264,7 @@ end subroutine SetQflxInputs !----------------------------------------------------------------------- subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & infiltration_excess_runoff_inst, & - energyflux_inst, soilhydrology_inst, surf_runoff_sat_inst, & + energyflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, & waterflux_inst, waterstate_inst) ! ! !DESCRIPTION: @@ -284,7 +284,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f type(infiltration_excess_runoff_type), intent(in) :: infiltration_excess_runoff_inst type(energyflux_type) , intent(in) :: energyflux_inst type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(surf_runoff_sat_type), intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type), intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst ! @@ -317,7 +317,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) - qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_sat_excess_surf => saturated_excess_runoff_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical @@ -418,7 +418,7 @@ end subroutine Infiltration !----------------------------------------------------------------------- subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & num_urbanc, filter_urbanc, & - waterflux_inst, soilhydrology_inst, surf_runoff_sat_inst, waterstate_inst) + waterflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, waterstate_inst) ! ! !DESCRIPTION: ! Calculate total surface runoff @@ -436,7 +436,7 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & integer , intent(in) :: filter_urbanc(:) ! column filter for urban points type(waterflux_type) , intent(inout) :: waterflux_inst type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(surf_runoff_sat_type), intent(in) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type), intent(in) :: saturated_excess_runoff_inst type(waterstate_type), intent(in) :: waterstate_inst ! ! !LOCAL VARIABLES: @@ -459,7 +459,7 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & xs_urban => soilhydrology_inst%xs_urban_col , & ! Output: [real(r8) (:) ] excess soil water above urban ponding limit - qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + qflx_sat_excess_surf => saturated_excess_runoff_inst%qflx_sat_excess_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) ) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 0b23e5d572..95fabab4b5 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -696,7 +696,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro filter(nc)%num_nosnowc, filter(nc)%nosnowc, & clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & - waterflux_inst, waterstate_inst, soilhydrology_inst, surf_runoff_sat_inst, & + waterflux_inst, waterstate_inst, soilhydrology_inst, saturated_excess_runoff_inst, & infiltration_excess_runoff_inst, & aerosol_inst, canopystate_inst, soil_water_retention_curve) @@ -812,7 +812,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, surf_runoff_sat_inst, energyflux_inst, & + photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) call t_stopf('ecosysdyn') diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index a683f02e8a..57e19d2c42 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -51,7 +51,7 @@ module clm_instMod use OzoneFactoryMod , only : create_and_init_ozone_type use PhotosynthesisMod , only : photosyns_type use SoilHydrologyType , only : soilhydrology_type - use SurfRunoffSatMod , only : surf_runoff_sat_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use SoilStateType , only : soilstate_type use SolarAbsorbedType , only : solarabs_type use SurfaceRadiationMod , only : surfrad_type @@ -103,7 +103,7 @@ module clm_instMod type(photosyns_type) :: photosyns_inst type(soilstate_type) :: soilstate_inst type(soilhydrology_type) :: soilhydrology_inst - type(surf_runoff_sat_type) :: surf_runoff_sat_inst + type(saturated_excess_runoff_type) :: saturated_excess_runoff_inst type(solarabs_type) :: solarabs_inst type(surfalb_type) :: surfalb_inst type(surfrad_type) :: surfrad_inst @@ -312,7 +312,7 @@ subroutine clm_instInit(bounds) call soilhydrology_inst%Init(bounds, nlfilename) call SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) ! sets time constant properties - call surf_runoff_sat_inst%Init(bounds) + call saturated_excess_runoff_inst%Init(bounds) call infiltration_excess_runoff_inst%Init(bounds) call solarabs_inst%Init(bounds) From db5e8d6ed835da0566819c634835547dfa750855 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 09:23:38 -0600 Subject: [PATCH 020/144] Remove long yellowstone test, change PE count for cheyenne Removing this long test that sometimes exceeds the 2-hour limit I give it (other times it takes just slightly less than 2 hours): ERS_Ly5_P60x1.f10_f10_musgs.IHistClm50BgcCrop.yellowstone_intel.clm-cropMonthOutput We still have an identical test on cheyenne. Also, increase the PE count on cheyenne to use two full nodes, rather than a partial node. --- cime_config/testdefs/testlist_clm.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9b51ed4a1c..53e942b2d0 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1088,9 +1088,8 @@ cheyenne - + cheyenne - yellowstone From 8797b0ccc2d40259a0a45a523499c200ecea2611 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 09:31:18 -0600 Subject: [PATCH 021/144] Update ChangeLog_branch --- ChangeLog_branch | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index 1534d4caeb..0a2617eef8 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,4 +1,100 @@ =============================================================== +Tag name: ctsm_n07_clm4_5_16_r249 +Originator(s): sacks +Date: Aug 22, 2017 +One-line Summary: Rename things related to saturated surface runoff + +Purpose of changes +------------------ + +Renames the module, derived type, variables and methods related to saturated +surface runoff. The rename qflx_sat_surf -> qflx_sat_excess_surf was suggested +at a ctsm meeting. The other renames are to be consistent with that and +consistent with InfiltrationExcessRunoffMod. + +Also, remove a long yellowstone test, change PE count for cheyenne: Removing +this long test that sometimes exceeds the 2-hour limit I give it (other times it +takes just slightly less than 2 hours): +ERS_Ly5_P60x1.f10_f10_musgs.IHistClm50BgcCrop.yellowstone_intel.clm-cropMonthOutput. We +still have an identical test on cheyenne. Also, increase the PE count on +cheyenne to use two full nodes, rather than a partial node. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - not run + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - pass + yellowstone_pgi - pass + yellowstone_gnu - pass + cheyenne_intel - pass + hobart_nag - pass + hobart_pgi - pass + hobart_intel - pass + +CLM tag used for the baseline comparisons: ctsm_n06_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: + +========= Renamed +D components/clm/src/biogeophys/SurfRunoffSatMod.F90 + +List all files added and what they do: + +========= Renamed +A components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 + +List all existing files that have been modified, and describe the changes: + +========= Renames +M components/clm/src/biogeochem/CNDriverMod.F90 +M components/clm/src/biogeochem/CNFireBaseMod.F90 +M components/clm/src/biogeochem/CNFireLi2014Mod.F90 +M components/clm/src/biogeochem/CNFireLi2016Mod.F90 +M components/clm/src/biogeochem/CNFireMethodMod.F90 +M components/clm/src/biogeochem/CNFireNoFireMod.F90 +M components/clm/src/biogeochem/CNVegetationFacade.F90 +M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 +M components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 +M components/clm/src/biogeophys/SoilHydrologyMod.F90 +M components/clm/src/main/clm_driver.F90 +M components/clm/src/main/clm_instMod.F90 + +========= Remove a yellowstone test, tweak a cheyenne test, as described above +M components/clm/cime_config/testdefs/testlist_clm.xml + +=============================================================== +=============================================================== Tag name: ctsm_n06_clm4_5_16_r249 Originator(s): sacks Date: Aug 21, 2017 From 44183112cc55b30e5940f78b2d56a59654c528c5 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 10:07:02 -0600 Subject: [PATCH 022/144] Merge effectively identical code for calculation of qflx_in_soil Previously, hydrologically-active urban columns were doing their own calculation of what is essentially qflx_in_soil. But it turns out that they were doing essentially the same thing as other landunits (once you note that frac_h2osfc is 0 for urban). So I'm removing this duplication. --- src/biogeophys/HydrologyNoDrainageMod.F90 | 2 +- src/biogeophys/SoilHydrologyMod.F90 | 59 +++++++---------------- 2 files changed, 19 insertions(+), 42 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 5cfca79a6a..c5bf0d6320 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -196,7 +196,7 @@ subroutine HydrologyNoDrainage(bounds, & call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& infiltration_excess_runoff_inst, & - energyflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, & + energyflux_inst, soilhydrology_inst, & waterflux_inst, waterstate_inst) call TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index cf300064eb..832ffe8bca 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -223,37 +223,29 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) + qflx_top_soil(c) = qflx_rain_plus_snomelt(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) + ! ------------------------------------------------------------------------ ! Partition surface inputs between soil and h2osfc - ! - ! This is only done for soil & crop landunits, because other - ! hydrologically-active landunits (in particular, urban pervious road) do not use - ! h2osfc. - if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then + ! ------------------------------------------------------------------------ - ! explicitly use frac_sno=0 if snl=0 - if (snl(c) >= 0) then - fsno=0._r8 - ! if no snow layers, sublimation is removed from h2osoi_ice in drainage - qflx_evap(c)=qflx_evap_grnd(c) - else - fsno=frac_sno(c) - qflx_evap(c)=qflx_ev_soil(c) - endif + if (snl(c) >= 0) then + fsno=0._r8 + ! if no snow layers, sublimation is removed from h2osoi_ice in drainage + qflx_evap(c)=qflx_evap_grnd(c) + else + fsno=frac_sno(c) + qflx_evap(c)=qflx_ev_soil(c) + endif - qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) - qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) + qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) + qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) - ! remove evaporation (snow treated in SnowHydrology) - qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) - qflx_top_soil_to_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) + ! remove evaporation (snow treated in SnowHydrology) + qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) + qflx_top_soil_to_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) - else - ! FIXME(wjs, 2017-08-15) Rather than this kludge, instead set qflx_in_soil and - ! qflx_top_soil_to_h2osfc to reasonable values for other landunits - qflx_in_soil(c) = 0._r8 - end if end do end associate @@ -264,7 +256,7 @@ end subroutine SetQflxInputs !----------------------------------------------------------------------- subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & infiltration_excess_runoff_inst, & - energyflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, & + energyflux_inst, soilhydrology_inst, & waterflux_inst, waterstate_inst) ! ! !DESCRIPTION: @@ -284,7 +276,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f type(infiltration_excess_runoff_type), intent(in) :: infiltration_excess_runoff_inst type(energyflux_type) , intent(in) :: energyflux_inst type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(saturated_excess_runoff_type), intent(in) :: saturated_excess_runoff_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst ! @@ -298,27 +289,19 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f !----------------------------------------------------------------------- associate( & - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - qflx_infl_excess => infiltration_excess_runoff_inst%qflx_infl_excess_col , & ! Input: [real(r8) (:)] infiltration excess runoff (mm H2O /s) qinmax => infiltration_excess_runoff_inst%qinmax_col , & ! Input: [real(r8) (:)] maximum infiltration capacity (mm H2O /s) frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Input: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col, & ! Input: [real(r8) (:)] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) - qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:) ] evaporation flux from soil (W/m**2) [+ to atm] - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Input: [real(r8) (:) ] net water input into soil from top (mm/s) qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) - qflx_sat_excess_surf => saturated_excess_runoff_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) - h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical ) @@ -389,13 +372,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) else ! non-vegetated landunits (i.e. urban) use original CLM4 code - if (snl(c) >= 0) then - ! when no snow present, sublimation is removed in Drainage - qflx_infl(c) = qflx_top_soil(c) - qflx_sat_excess_surf(c) - qflx_evap_grnd(c) - else - qflx_infl(c) = qflx_top_soil(c) - qflx_sat_excess_surf(c) & - - (1.0_r8 - frac_sno(c)) * qflx_ev_soil(c) - end if + qflx_infl(c) = qflx_in_soil(c) qflx_h2osfc_surf(c) = 0._r8 qflx_infl_excess_surf(c) = 0._r8 endif From d69be4ec5d0d1a5b16b841fabf4db3bb21e17595 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 11:42:13 -0600 Subject: [PATCH 023/144] Turn an array into a scalar Also add some fixme notes --- src/biogeophys/SoilHydrologyMod.F90 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 832ffe8bca..c316e61fad 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -196,8 +196,8 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !LOCAL VARIABLES: integer :: fc, c - real(r8) :: qflx_evap(bounds%begc:bounds%endc) ! local evaporation array - real(r8) :: fsno ! copy of frac_sno + real(r8) :: qflx_evap ! evaporation for this column + real(r8) :: fsno ! copy of frac_sno character(len=*), parameter :: subname = 'SetQflxInputs' !----------------------------------------------------------------------- @@ -233,17 +233,17 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & if (snl(c) >= 0) then fsno=0._r8 ! if no snow layers, sublimation is removed from h2osoi_ice in drainage - qflx_evap(c)=qflx_evap_grnd(c) + qflx_evap=qflx_evap_grnd(c) else fsno=frac_sno(c) - qflx_evap(c)=qflx_ev_soil(c) + qflx_evap=qflx_ev_soil(c) endif qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) ! remove evaporation (snow treated in SnowHydrology) - qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) + qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap qflx_top_soil_to_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) end do @@ -336,6 +336,10 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f endif ! limit runoff to value of storage above S(pc) + + ! FIXME(wjs, 2017-08-22) Change >= to >: in the equals case, + ! qflx_h2osfc_surf will end up being 0 anyway. (This will avoid doing these + ! calculations for points with h2osfc = h2osfc_thresh = 0.) if(h2osfc(c) >= h2osfc_thresh(c) .and. h2osfcflag/=0) then ! spatially variable k_wet k_wet=1.0e-4_r8 * sin((rpi/180.) * col%topo_slope(c)) @@ -380,6 +384,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f enddo ! No infiltration for impervious urban surfaces + ! FIXME(wjs, 2017-08-22) Move the following to initialization? do fc = 1, num_urbanc c = filter_urbanc(fc) From feb92ef908f097258ba9f0fcc92729f7cc8430aa Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 14:47:10 -0600 Subject: [PATCH 024/144] Add routine, RouteInfiltrationExcess --- src/biogeophys/HydrologyNoDrainageMod.F90 | 5 +- src/biogeophys/SoilHydrologyMod.F90 | 83 +++++++++++++++++------ src/biogeophys/WaterfluxType.F90 | 2 + 3 files changed, 68 insertions(+), 22 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index c5bf0d6320..9cb0e1d6ef 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -62,7 +62,7 @@ subroutine HydrologyNoDrainage(bounds, & use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter use SoilHydrologyMod , only : CLMVICMap, SetSoilWaterFractions - use SoilHydrologyMod , only : SetQflxInputs, Infiltration, TotalSurfaceRunoff + use SoilHydrologyMod , only : SetQflxInputs, RouteInfiltrationExcess, Infiltration, TotalSurfaceRunoff use SoilHydrologyMod , only : UpdateUrbanPonding use SoilHydrologyMod , only : WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation @@ -194,6 +194,9 @@ subroutine HydrologyNoDrainage(bounds, & soilhydrology_inst, soilstate_inst, saturated_excess_runoff_inst, waterflux_inst, & waterstate_inst) + call RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst, infiltration_excess_runoff_inst, soilhydrology_inst) + call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& infiltration_excess_runoff_inst, & energyflux_inst, soilhydrology_inst, & diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index c316e61fad..e71c4a5979 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -252,6 +252,64 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & end subroutine SetQflxInputs + !----------------------------------------------------------------------- + subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst, infiltration_excess_runoff_inst, soilhydrology_inst) + ! + ! !DESCRIPTION: + ! Route the infiltration excess runoff flux + ! + ! This adjusts infiltration, input to h2osfc, and the associated surface runoff flux. + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(waterflux_type) , intent(inout) :: waterflux_inst + type(infiltration_excess_runoff_type), intent(in) :: infiltration_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + ! + ! !LOCAL VARIABLES: + integer :: fc, c + + character(len=*), parameter :: subname = 'RouteInfiltrationExcess' + !----------------------------------------------------------------------- + + associate( & + qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) + qflx_in_h2osfc => waterflux_inst%qflx_in_h2osfc_col , & ! Output: [real(r8) (:) ] total surface input to h2osfc + qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) + qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) + qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col , & ! Input: [real(r8) (:) ] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) + + qflx_infl_excess => infiltration_excess_runoff_inst%qflx_infl_excess_col , & ! Input: [real(r8) (:) ] infiltration excess runoff (mm H2O /s) + + h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical + ) + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then + qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) + if (h2osfcflag /= 0) then + qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) + qflx_infl_excess(c) + qflx_infl_excess_surf(c) = 0._r8 + else + ! No h2osfc pool, so qflx_infl_excess goes directly to surface runoff + qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) + qflx_infl_excess_surf(c) = qflx_infl_excess(c) + end if + else + ! non-vegetated landunits (i.e. urban) use original CLM4 code + qflx_infl(c) = qflx_in_soil(c) + qflx_in_h2osfc(c) = 0._r8 + qflx_infl_excess_surf(c) = 0._r8 + end if + end do + + end associate + + end subroutine RouteInfiltrationExcess !----------------------------------------------------------------------- subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & @@ -283,22 +341,18 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc - real(r8) :: qflx_in_h2osfc(bounds%begc:bounds%endc) ! net surface input to h2osfc real(r8) :: frac_infclust ! fraction of submerged area that is connected real(r8) :: k_wet ! linear reservoir coefficient for h2osfc !----------------------------------------------------------------------- associate( & - qflx_infl_excess => infiltration_excess_runoff_inst%qflx_infl_excess_col , & ! Input: [real(r8) (:)] infiltration excess runoff (mm H2O /s) qinmax => infiltration_excess_runoff_inst%qinmax_col , & ! Input: [real(r8) (:)] maximum infiltration capacity (mm H2O /s) frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Input: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) - qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) - qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col, & ! Input: [real(r8) (:)] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) - qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) + qflx_in_h2osfc => waterflux_inst%qflx_in_h2osfc_col , & ! Input: [real(r8) (:) ] total surface input to h2osfc qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) @@ -312,19 +366,9 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) + ! FIXME(wjs, 2017-08-22) Remove this conditional if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then - !4. soil infiltration and h2osfc "run-on" - qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) - if (h2osfcflag /= 0) then - qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) + qflx_infl_excess(c) - qflx_infl_excess_surf(c) = 0._r8 - else - ! No h2osfc pool, so qflx_infl_excess goes directly to surface runoff - qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - qflx_infl_excess_surf(c) = qflx_infl_excess(c) - end if - !5. surface runoff from h2osfc if (h2osfcflag==1) then ! calculate runoff from h2osfc ------------------------------------- @@ -353,10 +397,8 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f ! cutoff lower limit if ( qflx_h2osfc_surf(c) < 1.0e-8) qflx_h2osfc_surf(c) = 0._r8 - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_h2osfc_surf(c) - !6. update h2osfc prior to calculating bottom drainage from h2osfc - h2osfc(c) = h2osfc(c) + qflx_in_h2osfc(c) * dtime + h2osfc(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime !-- if all water evaporates, there will be no bottom drainage if (h2osfc(c) < 0.0) then @@ -376,9 +418,8 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) else ! non-vegetated landunits (i.e. urban) use original CLM4 code - qflx_infl(c) = qflx_in_soil(c) + ! FIXME(wjs, 2017-08-22) Remove this qflx_h2osfc_surf(c) = 0._r8 - qflx_infl_excess_surf(c) = 0._r8 endif enddo diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index 33c84bf908..2398763a35 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -82,6 +82,7 @@ module WaterfluxType real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) real(r8), pointer :: qflx_in_soil_col (:) ! col surface input to soil (mm/s) real(r8), pointer :: qflx_top_soil_to_h2osfc_col(:) ! col portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) + real(r8), pointer :: qflx_in_h2osfc_col(:) ! col total surface input to h2osfc real(r8), pointer :: qflx_h2osfc_to_ice_col (:) ! col conversion of h2osfc to ice real(r8), pointer :: qflx_snow_h2osfc_col (:) ! col snow falling on surface water real(r8), pointer :: qflx_drain_perched_col (:) ! col sub-surface runoff from perched wt (mm H2O /s) @@ -226,6 +227,7 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan allocate(this%qflx_in_soil_col (begc:endc)) ; this%qflx_in_soil_col (:) = nan allocate(this%qflx_top_soil_to_h2osfc_col(begc:endc)) ; this%qflx_top_soil_to_h2osfc_col(:) = nan + allocate(this%qflx_in_h2osfc_col (begc:endc)) ; this%qflx_in_h2osfc_col(:) = nan allocate(this%qflx_h2osfc_to_ice_col (begc:endc)) ; this%qflx_h2osfc_to_ice_col (:) = nan allocate(this%qflx_infl_excess_surf_col(begc:endc)) ; this%qflx_infl_excess_surf_col(:) = nan allocate(this%qflx_h2osfc_surf_col (begc:endc)) ; this%qflx_h2osfc_surf_col (:) = nan From f5abae2f8a5c8438594bd573833ea9ae223ece3b Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 14:57:31 -0600 Subject: [PATCH 025/144] Move setting of qflx_infl for urban Main point is so that subroutine Infiltration doesn't need to bother with an urban filter --- src/biogeophys/HydrologyDrainageMod.F90 | 1 + src/biogeophys/HydrologyNoDrainageMod.F90 | 2 +- src/biogeophys/SoilHydrologyMod.F90 | 14 +------------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/biogeophys/HydrologyDrainageMod.F90 b/src/biogeophys/HydrologyDrainageMod.F90 index 226d85dd40..e6b1b8ee27 100644 --- a/src/biogeophys/HydrologyDrainageMod.F90 +++ b/src/biogeophys/HydrologyDrainageMod.F90 @@ -185,6 +185,7 @@ subroutine HydrologyDrainage(bounds, & qflx_drain_perched(c) = 0._r8 qflx_rsub_sat(c) = spval + qflx_infl(c) = 0._r8 end if diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 9cb0e1d6ef..3dce903d26 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -197,7 +197,7 @@ subroutine HydrologyNoDrainage(bounds, & call RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & waterflux_inst, infiltration_excess_runoff_inst, soilhydrology_inst) - call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& + call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & infiltration_excess_runoff_inst, & energyflux_inst, soilhydrology_inst, & waterflux_inst, waterstate_inst) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index e71c4a5979..16723f9238 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -312,7 +312,7 @@ subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & end subroutine RouteInfiltrationExcess !----------------------------------------------------------------------- - subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & + subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & infiltration_excess_runoff_inst, & energyflux_inst, soilhydrology_inst, & waterflux_inst, waterstate_inst) @@ -329,8 +329,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points type(infiltration_excess_runoff_type), intent(in) :: infiltration_excess_runoff_inst type(energyflux_type) , intent(in) :: energyflux_inst type(soilhydrology_type) , intent(in) :: soilhydrology_inst @@ -424,16 +422,6 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f enddo - ! No infiltration for impervious urban surfaces - ! FIXME(wjs, 2017-08-22) Move the following to initialization? - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (col%itype(c) /= icol_road_perv) then - qflx_infl(c) = 0._r8 - end if - end do - end associate end subroutine Infiltration From 5a8be1a4ef776a4703f3231d982b341ad59907e8 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 15:14:52 -0600 Subject: [PATCH 026/144] Treat urban like other landunits in h2osfc calculations This should give the same answers as before simply because the relevant quantities (e.g., fluxes in) are already 0. This simplifies the code, and is a step towards reconciling urban pervious road with other hydrologically-active columns. Also, change >= to > in conditional for computing qflx_h2osfc_surf: in the equals case, qflx_h2osfc_surf will end up being 0 anyway. (This will avoid doing these calculations for points with h2osfc = h2osfc_thresh = 0.) --- src/biogeophys/SoilHydrologyMod.F90 | 81 ++++++++++++----------------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 16723f9238..de7c69527e 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -360,66 +360,53 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & dtime = get_step_size() - ! Infiltration into surface soil layer (minus the evaporation) - do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - ! FIXME(wjs, 2017-08-22) Remove this conditional - if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then - - !5. surface runoff from h2osfc - if (h2osfcflag==1) then - ! calculate runoff from h2osfc ------------------------------------- - if (frac_h2osfc_nosnow(c) <= pc) then - frac_infclust=0.0_r8 - else - frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu - endif - endif - ! limit runoff to value of storage above S(pc) - - ! FIXME(wjs, 2017-08-22) Change >= to >: in the equals case, - ! qflx_h2osfc_surf will end up being 0 anyway. (This will avoid doing these - ! calculations for points with h2osfc = h2osfc_thresh = 0.) - if(h2osfc(c) >= h2osfc_thresh(c) .and. h2osfcflag/=0) then - ! spatially variable k_wet - k_wet=1.0e-4_r8 * sin((rpi/180.) * col%topo_slope(c)) - qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c)) - - qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime) + !5. surface runoff from h2osfc + if (h2osfcflag==1) then + ! calculate runoff from h2osfc ------------------------------------- + if (frac_h2osfc_nosnow(c) <= pc) then + frac_infclust=0.0_r8 else - qflx_h2osfc_surf(c)= 0._r8 + frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu endif + endif - ! cutoff lower limit - if ( qflx_h2osfc_surf(c) < 1.0e-8) qflx_h2osfc_surf(c) = 0._r8 + ! limit runoff to value of storage above S(pc) + if(h2osfc(c) > h2osfc_thresh(c) .and. h2osfcflag/=0) then + ! spatially variable k_wet + k_wet=1.0e-4_r8 * sin((rpi/180.) * col%topo_slope(c)) + qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c)) - !6. update h2osfc prior to calculating bottom drainage from h2osfc - h2osfc(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime + qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime) + else + qflx_h2osfc_surf(c)= 0._r8 + endif - !-- if all water evaporates, there will be no bottom drainage - if (h2osfc(c) < 0.0) then - qflx_infl(c) = qflx_infl(c) + h2osfc(c)/dtime - h2osfc(c) = 0.0 - qflx_h2osfc_drain(c)= 0._r8 - else - qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax(c),h2osfc(c)/dtime) - endif + ! cutoff lower limit + if ( qflx_h2osfc_surf(c) < 1.0e-8) qflx_h2osfc_surf(c) = 0._r8 - if(h2osfcflag==0) then - qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) !ensure no h2osfc - endif + !6. update h2osfc prior to calculating bottom drainage from h2osfc + h2osfc(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime - !7. remove drainage from h2osfc and add to qflx_infl - h2osfc(c) = h2osfc(c) - qflx_h2osfc_drain(c) * dtime - qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) + !-- if all water evaporates, there will be no bottom drainage + if (h2osfc(c) < 0.0) then + qflx_infl(c) = qflx_infl(c) + h2osfc(c)/dtime + h2osfc(c) = 0.0 + qflx_h2osfc_drain(c)= 0._r8 else - ! non-vegetated landunits (i.e. urban) use original CLM4 code - ! FIXME(wjs, 2017-08-22) Remove this - qflx_h2osfc_surf(c) = 0._r8 + qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax(c),h2osfc(c)/dtime) endif + if(h2osfcflag==0) then + qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) !ensure no h2osfc + endif + + !7. remove drainage from h2osfc and add to qflx_infl + h2osfc(c) = h2osfc(c) - qflx_h2osfc_drain(c) * dtime + qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) + enddo end associate From 955f4917dc0b109433cb62a378615dc2d33265ea Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 15:19:36 -0600 Subject: [PATCH 027/144] Rename Infiltration to UpdateH2osfc since that's what it does now --- src/biogeophys/HydrologyNoDrainageMod.F90 | 4 ++-- src/biogeophys/SoilHydrologyMod.F90 | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 3dce903d26..22def389ec 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -62,7 +62,7 @@ subroutine HydrologyNoDrainage(bounds, & use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter use SoilHydrologyMod , only : CLMVICMap, SetSoilWaterFractions - use SoilHydrologyMod , only : SetQflxInputs, RouteInfiltrationExcess, Infiltration, TotalSurfaceRunoff + use SoilHydrologyMod , only : SetQflxInputs, RouteInfiltrationExcess, UpdateH2osfc, TotalSurfaceRunoff use SoilHydrologyMod , only : UpdateUrbanPonding use SoilHydrologyMod , only : WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation @@ -197,7 +197,7 @@ subroutine HydrologyNoDrainage(bounds, & call RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & waterflux_inst, infiltration_excess_runoff_inst, soilhydrology_inst) - call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & + call UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & infiltration_excess_runoff_inst, & energyflux_inst, soilhydrology_inst, & waterflux_inst, waterstate_inst) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index de7c69527e..15486ab25b 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -36,7 +36,7 @@ module SoilHydrologyMod public :: SoilHydReadNML ! Read in the Soil hydrology namelist public :: SetSoilWaterFractions ! Set diagnostic variables related to the fraction of water and ice in each layer public :: SetQflxInputs ! Set the flux of water into the soil from the top - public :: Infiltration ! Calculate infiltration into surface soil layer + public :: UpdateH2osfc ! Calculate fluxes out of h2osfc and update the h2osfc state public :: TotalSurfaceRunoff ! Calculate total surface runoff public :: UpdateUrbanPonding ! Update the state variable representing ponding on urban surfaces public :: WaterTable ! Calculate water table before imposing drainage @@ -312,13 +312,13 @@ subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & end subroutine RouteInfiltrationExcess !----------------------------------------------------------------------- - subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & + subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & infiltration_excess_runoff_inst, & energyflux_inst, soilhydrology_inst, & waterflux_inst, waterstate_inst) ! ! !DESCRIPTION: - ! Calculate infiltration into surface soil layer (minus the evaporation) + ! Calculate fluxes out of h2osfc and update the h2osfc state ! ! !USES: use shr_const_mod , only : shr_const_pi @@ -411,7 +411,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & end associate - end subroutine Infiltration + end subroutine UpdateH2osfc !----------------------------------------------------------------------- subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & From b586cebd88939540863319eec542e9049e62511d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 22 Aug 2017 20:40:26 -0600 Subject: [PATCH 028/144] Separate flux calculations from state updates for h2osfc --- src/biogeophys/SoilHydrologyMod.F90 | 240 ++++++++++++++++++++++------ 1 file changed, 191 insertions(+), 49 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 15486ab25b..44d35bf3f1 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -4,6 +4,7 @@ module SoilHydrologyMod ! !DESCRIPTION: ! Calculate soil hydrology ! +#include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun @@ -48,6 +49,10 @@ module SoilHydrologyMod public :: LateralFlowPowerLaw ! Calculate lateral flow based on power law drainage function public :: RenewCondensation ! Misc. corrections + ! !PRIVATE MEMBER FUNCTIONS: + private :: QflxH2osfcSurf ! Compute qflx_h2osfc_surf + private :: QflxH2osfcDrain ! Compute qflx_h2osfc_drain + !----------------------------------------------------------------------- real(r8), private :: baseflow_scalar = 1.e-2_r8 @@ -284,7 +289,7 @@ subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & qflx_infl_excess => infiltration_excess_runoff_inst%qflx_infl_excess_col , & ! Input: [real(r8) (:) ] infiltration excess runoff (mm H2O /s) - h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical + h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: integer ) do fc = 1, num_hydrologyc @@ -322,7 +327,7 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use shr_const_mod , only : shr_const_pi - use clm_varcon , only : denh2o, denice, roverg, wimp, pc, mu, tfrz + use clm_varcon , only : denh2o, denice, roverg, wimp, tfrz use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv ! ! !ARGUMENTS: @@ -338,9 +343,11 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & ! !LOCAL VARIABLES: integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) + real(r8) :: h2osfc_partial(bounds%begc:bounds%endc) ! partially-updated h2osfc + ! FIXME(wjs, 2017-08-22) put qflx_h2osfc_drain in waterflux_type (this will be + ! needed when we move the update of qflx_infl to a separate routine) real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc - real(r8) :: frac_infclust ! fraction of submerged area that is connected - real(r8) :: k_wet ! linear reservoir coefficient for h2osfc + logical :: truncate_h2osfc_to_zero(bounds%begc:bounds%endc) !----------------------------------------------------------------------- associate( & @@ -355,63 +362,198 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" - h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical + h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: integer ) - dtime = get_step_size() + dtime = get_step_size() - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) + call QflxH2osfcSurf(bounds, num_hydrologyc, filter_hydrologyc, & + h2osfcflag = h2osfcflag, & + h2osfc = h2osfc(bounds%begc:bounds%endc), & + h2osfc_thresh = h2osfc_thresh(bounds%begc:bounds%endc), & + frac_h2osfc_nosnow = frac_h2osfc_nosnow(bounds%begc:bounds%endc), & + topo_slope = col%topo_slope(bounds%begc:bounds%endc), & + qflx_h2osfc_surf = qflx_h2osfc_surf(bounds%begc:bounds%endc)) + + ! Update h2osfc prior to calculating bottom drainage from h2osfc. + ! + ! This could be removed if we wanted to do a straight forward Euler, and/or set + ! things up for a more sophisticated solution method. In the latter, rather than + ! having h2osfc_partial, we'd have some more sophisticated state estimate here + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + h2osfc_partial(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime + end do - !5. surface runoff from h2osfc - if (h2osfcflag==1) then - ! calculate runoff from h2osfc ------------------------------------- - if (frac_h2osfc_nosnow(c) <= pc) then - frac_infclust=0.0_r8 - else - frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu - endif - endif + call QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & + h2osfcflag = h2osfcflag, & + h2osfc = h2osfc_partial(bounds%begc:bounds%endc), & + frac_h2osfc = frac_h2osfc(bounds%begc:bounds%endc), & + qinmax = qinmax(bounds%begc:bounds%endc), & + qflx_h2osfc_drain = qflx_h2osfc_drain(bounds%begc:bounds%endc), & + truncate_h2osfc_to_zero = truncate_h2osfc_to_zero(bounds%begc:bounds%endc)) - ! limit runoff to value of storage above S(pc) - if(h2osfc(c) > h2osfc_thresh(c) .and. h2osfcflag/=0) then - ! spatially variable k_wet - k_wet=1.0e-4_r8 * sin((rpi/180.) * col%topo_slope(c)) - qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c)) + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) - qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime) - else - qflx_h2osfc_surf(c)= 0._r8 - endif + ! The parenthesization of this expression is just needed to maintain bfb answers + ! in the major refactor. Note that the first parenthesized expression is + ! h2osfc_partial(c), but I'm writing it out explicitly to facilitate a possible + ! future removal of h2osfc_partial. + h2osfc(c) = (h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime) & + - qflx_h2osfc_drain(c) * dtime + + ! TODO(wjs, 2017-08-22) This is here to maintain bit-for-bit answers with the old + ! code. If we're okay changing answers, we could remove it. Or maybe we want to + ! put a more general truncation in here, like: + ! if (abs(h2osfc(c)) < 1.e-14_r8 * abs(h2osfc_orig)) h2osfc(c) = 0._r8 + ! But I'm not sure what the general philosophy is regarding whether and when we + ! want to do truncations like this. + if (truncate_h2osfc_to_zero(c)) then + h2osfc(c) = 0._r8 + end if - ! cutoff lower limit - if ( qflx_h2osfc_surf(c) < 1.0e-8) qflx_h2osfc_surf(c) = 0._r8 + end do - !6. update h2osfc prior to calculating bottom drainage from h2osfc - h2osfc(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime + ! FIXME(wjs, 2017-08-22) Move this update to a separate routine that calculations + ! qflx_infl from its components. + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) + end do - !-- if all water evaporates, there will be no bottom drainage - if (h2osfc(c) < 0.0) then - qflx_infl(c) = qflx_infl(c) + h2osfc(c)/dtime - h2osfc(c) = 0.0 - qflx_h2osfc_drain(c)= 0._r8 - else - qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax(c),h2osfc(c)/dtime) - endif + end associate - if(h2osfcflag==0) then - qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) !ensure no h2osfc - endif + end subroutine UpdateH2osfc - !7. remove drainage from h2osfc and add to qflx_infl - h2osfc(c) = h2osfc(c) - qflx_h2osfc_drain(c) * dtime - qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) + !----------------------------------------------------------------------- + subroutine QflxH2osfcSurf(bounds, num_hydrologyc, filter_hydrologyc, & + h2osfcflag, h2osfc, h2osfc_thresh, frac_h2osfc_nosnow, topo_slope, & + qflx_h2osfc_surf) + ! + ! !DESCRIPTION: + ! Compute qflx_h2osfc_surf + ! + ! !USES: + use clm_varcon, only : pc, mu + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + integer , intent(in) :: h2osfcflag ! true => surface water is active + real(r8) , intent(in) :: h2osfc( bounds%begc: ) ! surface water (mm) + real(r8) , intent(in) :: h2osfc_thresh( bounds%begc: ) ! level at which h2osfc "percolates" + real(r8) , intent(in) :: frac_h2osfc_nosnow( bounds%begc: ) ! fractional area with surface water greater than zero (if no snow present) + real(r8) , intent(in) :: topo_slope( bounds%begc: ) ! topographic slope + real(r8) , intent(inout) :: qflx_h2osfc_surf( bounds%begc: ) ! surface water runoff (mm H2O /s) + ! + ! !LOCAL VARIABLES: + integer :: fc, c + real(r8) :: dtime ! land model time step (sec) + real(r8) :: frac_infclust ! fraction of submerged area that is connected + real(r8) :: k_wet ! linear reservoir coefficient for h2osfc - enddo + character(len=*), parameter :: subname = 'QflxH2osfcSurf' + !----------------------------------------------------------------------- - end associate + SHR_ASSERT_ALL((ubound(h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(h2osfc_thresh) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(frac_h2osfc_nosnow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(topo_slope) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(qflx_h2osfc_surf) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + + dtime = get_step_size() + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + + if (h2osfcflag==1) then + if (frac_h2osfc_nosnow(c) <= pc) then + frac_infclust=0.0_r8 + else + frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu + endif + endif + + ! limit runoff to value of storage above S(pc) + if(h2osfc(c) > h2osfc_thresh(c) .and. h2osfcflag/=0) then + ! spatially variable k_wet + k_wet=1.0e-4_r8 * sin((rpi/180.) * topo_slope(c)) + qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c)) + + qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime) + else + qflx_h2osfc_surf(c)= 0._r8 + endif + + ! cutoff lower limit + if ( qflx_h2osfc_surf(c) < 1.0e-8) then + qflx_h2osfc_surf(c) = 0._r8 + end if + + end do + + end subroutine QflxH2osfcSurf + + !----------------------------------------------------------------------- + subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & + h2osfcflag, h2osfc, frac_h2osfc, qinmax, & + qflx_h2osfc_drain, truncate_h2osfc_to_zero) + ! + ! !DESCRIPTION: + ! Compute qflx_h2osfc_drain + ! + ! Note that, if h2osfc is negative, then qflx_h2osfc_drain will be negative - acting + ! to exactly restore h2osfc to 0. In this case, truncate_h2osfc_to_zero will be set + ! to true; in all other cases, truncate_h2osfc_to_zero will be set to false. This + ! particular behavior of truncate_h2osfc_to_zero is just like this to maintain + ! bit-for-bit answers with the old code (see also the TODO note in UpdateH2osfc). + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + integer , intent(in) :: h2osfcflag ! true => surface water is active + real(r8) , intent(in) :: h2osfc( bounds%begc: ) ! surface water (mm) + real(r8) , intent(in) :: frac_h2osfc( bounds%begc: ) ! fraction of ground covered by surface water (0 to 1) + real(r8) , intent(in) :: qinmax( bounds%begc: ) ! maximum infiltration capacity (mm H2O /s) + real(r8) , intent(inout) :: qflx_h2osfc_drain( bounds%begc: ) ! bottom drainage from h2osfc (mm H2O /s) + logical , intent(inout) :: truncate_h2osfc_to_zero( bounds%begc: ) ! whether h2osfc should be truncated to 0 to correct for roundoff errors, in order to maintain bit-for-bit the same answers as the old code + ! + ! !LOCAL VARIABLES: + integer :: fc, c + real(r8) :: dtime ! land model time step (sec) + + character(len=*), parameter :: subname = 'QflxH2osfcDrain' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL((ubound(h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(frac_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(qinmax) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(qflx_h2osfc_drain) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(truncate_h2osfc_to_zero) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) + + dtime = get_step_size() + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + + if (h2osfc(c) < 0.0) then + qflx_h2osfc_drain(c) = h2osfc(c)/dtime + truncate_h2osfc_to_zero(c) = .true. + else + qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax(c),h2osfc(c)/dtime) + if(h2osfcflag==0) then + ! ensure no h2osfc + qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) + end if + truncate_h2osfc_to_zero(c) = .false. + end if + end do + + end subroutine QflxH2osfcDrain - end subroutine UpdateH2osfc !----------------------------------------------------------------------- subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & @@ -986,7 +1128,7 @@ subroutine Drainage(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filte ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) origflag => soilhydrology_inst%origflag , & ! Input: logical - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical + h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: integer qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Output: [real(r8) (:) ] excess liquid h2o due to snow capping (outgoing) (mm H2O /s) [+] qflx_ice_runoff_xs => waterflux_inst%qflx_ice_runoff_xs_col , & ! Output: [real(r8) (:) ] solid runoff from excess ice in soil (mm H2O /s) [+] @@ -2032,7 +2174,7 @@ subroutine LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) origflag => soilhydrology_inst%origflag , & ! Input: logical - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical + h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: integer qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Output: [real(r8) (:) ] excess rainfall due to snow capping (mm H2O /s) [+] qflx_ice_runoff_xs => waterflux_inst%qflx_ice_runoff_xs_col , & ! Output: [real(r8) (:) ] solid runoff from excess ice in soil (mm H2O /s) [+] From 00352314ed9e23dad2bc1759a1656ff45883193d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 23 Aug 2017 14:25:53 -0600 Subject: [PATCH 029/144] Change comment for qinmax Martyn Clark points out that this is maximum infiltration rate, not maximum infiltration capacity --- src/biogeophys/InfiltrationExcessRunoffMod.F90 | 10 +++++----- src/biogeophys/SaturatedExcessRunoffMod.F90 | 2 +- src/biogeophys/SoilHydrologyMod.F90 | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/biogeophys/InfiltrationExcessRunoffMod.F90 b/src/biogeophys/InfiltrationExcessRunoffMod.F90 index 1d482f1d84..690ec7c10b 100644 --- a/src/biogeophys/InfiltrationExcessRunoffMod.F90 +++ b/src/biogeophys/InfiltrationExcessRunoffMod.F90 @@ -36,7 +36,7 @@ module InfiltrationExcessRunoffMod ! Both of these give averages over the entire column. However, qinmax is implicitly ! 0 over the fraction of the column given by fsat, and qflx_infl_excess is ! implicitly 0 over both fsat and frac_h2osfc. - real(r8), pointer, public :: qinmax_col(:) ! maximum infiltration capacity (mm H2O /s) + real(r8), pointer, public :: qinmax_col(:) ! maximum infiltration rate (mm H2O /s) real(r8), pointer, public :: qflx_infl_excess_col(:) ! infiltration excess runoff (mm H2O /s) ! Private data members @@ -186,13 +186,13 @@ subroutine InfiltrationExcessRunoff(this, bounds, num_hydrologyc, filter_hydrolo ! ! !LOCAL VARIABLES: integer :: fc, c - real(r8) :: qinmax_on_unsaturated_area(bounds%begc:bounds%endc) ! maximum infiltration capacity on the unsaturated fraction of the column (mm H2O /s) + real(r8) :: qinmax_on_unsaturated_area(bounds%begc:bounds%endc) ! maximum infiltration rate on the unsaturated fraction of the column (mm H2O /s) character(len=*), parameter :: subname = 'InfiltrationExcessRunoff' !----------------------------------------------------------------------- associate( & - qinmax => this%qinmax_col , & ! Output: [real(r8) (:) ] maximum infiltration capacity (mm H2O /s) + qinmax => this%qinmax_col , & ! Output: [real(r8) (:) ] maximum infiltration rate (mm H2O /s) qflx_infl_excess => this%qflx_infl_excess_col , & ! Output: [real(r8) (:) ] infiltration excess runoff (mm H2O /s) fsat => saturated_excess_runoff_inst%fsat_col, & ! Input: [real(r8) (:) ] fractional area with water table at surface @@ -245,7 +245,7 @@ subroutine ComputeQinmaxHksat(bounds, num_hydrologyc, filter_hydrologyc, & integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration capacity on the unsaturated fraction of the column (mm H2O /s) + real(r8), intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration rate on the unsaturated fraction of the column (mm H2O /s) ! ! !LOCAL VARIABLES: integer :: fc, c @@ -288,7 +288,7 @@ subroutine ComputeQinmaxVic(bounds, num_hydrologyc, filter_hydrologyc, & type(soilhydrology_type) , intent(in) :: soilhydrology_inst real(r8) , intent(in) :: fsat( bounds%begc: ) ! fractional area with water table at surface real(r8) , intent(in) :: qflx_in_soil( bounds%begc: ) ! surface input to soil (mm/s) - real(r8) , intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration capacity on the unsaturated fraction of the column (mm H2O /s) + real(r8) , intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration rate on the unsaturated fraction of the column (mm H2O /s) ! ! !LOCAL VARIABLES: integer :: fc, c diff --git a/src/biogeophys/SaturatedExcessRunoffMod.F90 b/src/biogeophys/SaturatedExcessRunoffMod.F90 index bb24aea1d6..21dcedd5f6 100644 --- a/src/biogeophys/SaturatedExcessRunoffMod.F90 +++ b/src/biogeophys/SaturatedExcessRunoffMod.F90 @@ -231,7 +231,7 @@ subroutine SaturatedExcessRunoff (this, bounds, num_hydrologyc, filter_hydrology ! ------------------------------------------------------------------------ ! Compute qflx_sat_excess_surf ! - ! assume qinmax (maximum infiltration capacity) is large relative to + ! assume qinmax (maximum infiltration rate) is large relative to ! qflx_rain_plus_snomelt in control ! ------------------------------------------------------------------------ diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 44d35bf3f1..a733f97212 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -351,7 +351,7 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & !----------------------------------------------------------------------- associate( & - qinmax => infiltration_excess_runoff_inst%qinmax_col , & ! Input: [real(r8) (:)] maximum infiltration capacity (mm H2O /s) + qinmax => infiltration_excess_runoff_inst%qinmax_col , & ! Input: [real(r8) (:)] maximum infiltration rate (mm H2O /s) frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Input: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) @@ -517,7 +517,7 @@ subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & integer , intent(in) :: h2osfcflag ! true => surface water is active real(r8) , intent(in) :: h2osfc( bounds%begc: ) ! surface water (mm) real(r8) , intent(in) :: frac_h2osfc( bounds%begc: ) ! fraction of ground covered by surface water (0 to 1) - real(r8) , intent(in) :: qinmax( bounds%begc: ) ! maximum infiltration capacity (mm H2O /s) + real(r8) , intent(in) :: qinmax( bounds%begc: ) ! maximum infiltration rate (mm H2O /s) real(r8) , intent(inout) :: qflx_h2osfc_drain( bounds%begc: ) ! bottom drainage from h2osfc (mm H2O /s) logical , intent(inout) :: truncate_h2osfc_to_zero( bounds%begc: ) ! whether h2osfc should be truncated to 0 to correct for roundoff errors, in order to maintain bit-for-bit the same answers as the old code ! From 6c979ad9d57e27e21b113dfa06661a2ea9d1dc5e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 23 Aug 2017 16:26:21 -0600 Subject: [PATCH 030/144] Tweak comments based on feedback from Martyn Clark --- src/biogeophys/InfiltrationExcessRunoffMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/InfiltrationExcessRunoffMod.F90 b/src/biogeophys/InfiltrationExcessRunoffMod.F90 index 690ec7c10b..ddd50136d5 100644 --- a/src/biogeophys/InfiltrationExcessRunoffMod.F90 +++ b/src/biogeophys/InfiltrationExcessRunoffMod.F90 @@ -294,9 +294,9 @@ subroutine ComputeQinmaxVic(bounds, num_hydrologyc, filter_hydrologyc, & integer :: fc, c real(r8) :: dtime ! land model time step (sec) real(r8) :: top_icefrac ! ice fraction in top VIC layers - real(r8) :: max_infil ! max infiltration capacity in VIC (mm) + real(r8) :: max_infil ! max infiltration capacity using the VIC parameterization (mm) real(r8) :: i_0 ! average soil moisture in top VIC layers (mm) - real(r8) :: rsurf_vic ! VIC surface runoff + real(r8) :: rsurf_vic ! surface runoff based on the VIC parameterization real(r8) :: basis ! variable soil moisture holding capacity in top VIC layers for runoff calculation character(len=*), parameter :: subname = 'ComputeQinmaxVic' From 5c75419d917feef8d2ef17c93d4e30ee6ff716c5 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 23 Aug 2017 20:21:28 -0600 Subject: [PATCH 031/144] Move setting of qflx_infl to its own subroutine This is cleaner and safer than having it set initially in one routine and then updated in a later routine. --- src/biogeophys/HydrologyNoDrainageMod.F90 | 6 ++- src/biogeophys/SoilHydrologyMod.F90 | 49 +++++++++++++++++------ src/biogeophys/WaterfluxType.F90 | 4 ++ 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 22def389ec..299c43b004 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -62,7 +62,8 @@ subroutine HydrologyNoDrainage(bounds, & use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter use SoilHydrologyMod , only : CLMVICMap, SetSoilWaterFractions - use SoilHydrologyMod , only : SetQflxInputs, RouteInfiltrationExcess, UpdateH2osfc, TotalSurfaceRunoff + use SoilHydrologyMod , only : SetQflxInputs, RouteInfiltrationExcess, UpdateH2osfc + use SoilHydrologyMod , only : Infiltration, TotalSurfaceRunoff use SoilHydrologyMod , only : UpdateUrbanPonding use SoilHydrologyMod , only : WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation @@ -202,6 +203,9 @@ subroutine HydrologyNoDrainage(bounds, & energyflux_inst, soilhydrology_inst, & waterflux_inst, waterstate_inst) + call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst) + call TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & num_urbanc, filter_urbanc, & waterflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, waterstate_inst) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index a733f97212..c16cef0e51 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -38,6 +38,7 @@ module SoilHydrologyMod public :: SetSoilWaterFractions ! Set diagnostic variables related to the fraction of water and ice in each layer public :: SetQflxInputs ! Set the flux of water into the soil from the top public :: UpdateH2osfc ! Calculate fluxes out of h2osfc and update the h2osfc state + public :: Infiltration ! Calculate total infiltration public :: TotalSurfaceRunoff ! Calculate total surface runoff public :: UpdateUrbanPonding ! Update the state variable representing ponding on urban surfaces public :: WaterTable ! Calculate water table before imposing drainage @@ -281,7 +282,7 @@ subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & !----------------------------------------------------------------------- associate( & - qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) + qflx_in_soil_limited => waterflux_inst%qflx_in_soil_limited_col , & ! Output: [real(r8) (:) ] surface input to soil, limited by max infiltration rate (mm H2O /s) qflx_in_h2osfc => waterflux_inst%qflx_in_h2osfc_col , & ! Output: [real(r8) (:) ] total surface input to h2osfc qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) @@ -295,7 +296,7 @@ subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then - qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) + qflx_in_soil_limited(c) = qflx_in_soil(c) - qflx_infl_excess(c) if (h2osfcflag /= 0) then qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) + qflx_infl_excess(c) qflx_infl_excess_surf(c) = 0._r8 @@ -306,7 +307,7 @@ subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & end if else ! non-vegetated landunits (i.e. urban) use original CLM4 code - qflx_infl(c) = qflx_in_soil(c) + qflx_in_soil_limited(c) = qflx_in_soil(c) qflx_in_h2osfc(c) = 0._r8 qflx_infl_excess_surf(c) = 0._r8 end if @@ -344,9 +345,6 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) real(r8) :: h2osfc_partial(bounds%begc:bounds%endc) ! partially-updated h2osfc - ! FIXME(wjs, 2017-08-22) put qflx_h2osfc_drain in waterflux_type (this will be - ! needed when we move the update of qflx_infl to a separate routine) - real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc logical :: truncate_h2osfc_to_zero(bounds%begc:bounds%endc) !----------------------------------------------------------------------- @@ -359,7 +357,7 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & qflx_in_h2osfc => waterflux_inst%qflx_in_h2osfc_col , & ! Input: [real(r8) (:) ] total surface input to h2osfc qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) - qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) + qflx_h2osfc_drain => waterflux_inst%qflx_h2osfc_drain_col , & ! Output: [real(r8) (:) ] bottom drainage from h2osfc (mm H2O /s) h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: integer @@ -415,16 +413,43 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & end do - ! FIXME(wjs, 2017-08-22) Move this update to a separate routine that calculations - ! qflx_infl from its components. + end associate + + end subroutine UpdateH2osfc + + !----------------------------------------------------------------------- + subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & + waterflux_inst) + ! + ! !DESCRIPTION: + ! Calculate total infiltration + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter + integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + type(waterflux_type) , intent(inout) :: waterflux_inst + ! + ! !LOCAL VARIABLES: + integer :: fc, c + + character(len=*), parameter :: subname = 'Infiltration' + !----------------------------------------------------------------------- + + associate( & + qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) + qflx_in_soil_limited => waterflux_inst%qflx_in_soil_limited_col , & ! Input: [real(r8) (:) ] surface input to soil, limited by max infiltration rate (mm H2O /s) + qflx_h2osfc_drain => waterflux_inst%qflx_h2osfc_drain_col & ! Input: [real(r8) (:) ] bottom drainage from h2osfc (mm H2O /s) + ) + do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) + qflx_infl(c) = qflx_in_soil_limited(c) + qflx_h2osfc_drain(c) end do - end associate + end associate - end subroutine UpdateH2osfc + end subroutine Infiltration !----------------------------------------------------------------------- subroutine QflxH2osfcSurf(bounds, num_hydrologyc, filter_hydrologyc, & diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index 2398763a35..ff55279596 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -81,6 +81,8 @@ module WaterfluxType real(r8), pointer :: qflx_rain_plus_snomelt_col(:) ! col rain plus snow melt falling on the soil (mm/s) real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) real(r8), pointer :: qflx_in_soil_col (:) ! col surface input to soil (mm/s) + real(r8), pointer :: qflx_in_soil_limited_col (:) ! col surface input to soil, limited by max infiltration rate (mm/s) + real(r8), pointer :: qflx_h2osfc_drain_col (:) ! col bottom drainage from h2osfc (mm/s) real(r8), pointer :: qflx_top_soil_to_h2osfc_col(:) ! col portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) real(r8), pointer :: qflx_in_h2osfc_col(:) ! col total surface input to h2osfc real(r8), pointer :: qflx_h2osfc_to_ice_col (:) ! col conversion of h2osfc to ice @@ -226,6 +228,8 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_rain_plus_snomelt_col(begc:endc)) ; this%qflx_rain_plus_snomelt_col(:) = nan allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan allocate(this%qflx_in_soil_col (begc:endc)) ; this%qflx_in_soil_col (:) = nan + allocate(this%qflx_in_soil_limited_col (begc:endc)) ; this%qflx_in_soil_limited_col (:) = nan + allocate(this%qflx_h2osfc_drain_col (begc:endc)) ; this%qflx_h2osfc_drain_col (:) = nan allocate(this%qflx_top_soil_to_h2osfc_col(begc:endc)) ; this%qflx_top_soil_to_h2osfc_col(:) = nan allocate(this%qflx_in_h2osfc_col (begc:endc)) ; this%qflx_in_h2osfc_col(:) = nan allocate(this%qflx_h2osfc_to_ice_col (begc:endc)) ; this%qflx_h2osfc_to_ice_col (:) = nan From 406d86bd33c6d023209670d9fe3204b65ed74032 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 24 Aug 2017 12:55:05 -0600 Subject: [PATCH 032/144] Update changelog --- ChangeLog_branch | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index 0a2617eef8..8f65aed1f1 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,4 +1,84 @@ =============================================================== +Tag name: ctsm_n08_clm4_5_16_r249 +Originator(s): sacks +Date: Aug 24, 2017 +One-line Summary: Finish Infiltration modularization - mainly h2osfc updates + +Purpose of changes +------------------ + +Finish the modularization of subroutine Infiltration. The main focus here is +modularizing the calculation of fluxes out of h2osfc and the updates of the +h2osfc state variable. Flux calculations and state updates are now done +separately. Where a flux calculation depends on a partially-updated version of +h2osfc, this is now made explicit in a way that could facilitate removing this +partial update later. + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - pass + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - pass + yellowstone_pgi - pass + yellowstone_gnu - pass + cheyenne_intel - pass + hobart_nag - pass + hobart_pgi - pass + hobart_intel - pass + +CLM tag used for the baseline comparisons: ctsm_n07_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +========= Main changes, as described above +M components/clm/src/biogeophys/SoilHydrologyMod.F90 +M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 +M components/clm/src/biogeophys/HydrologyDrainageMod.F90 +M components/clm/src/biogeophys/WaterfluxType.F90 + +========= Tweak some comments based on feedback on + https://github.com/NCAR/clm-ctsm/pull/2 +M components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 +M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 + +=============================================================== +=============================================================== Tag name: ctsm_n07_clm4_5_16_r249 Originator(s): sacks Date: Aug 22, 2017 From 96bb9cbeded73af451a333d77a5db4bdfbc6b2c7 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 28 Aug 2017 10:46:00 -0600 Subject: [PATCH 033/144] Use full qflx_surf in BGC code We had been using a separate variable to avoid changing answers. But Dave Lawrence gave his approval to change this. --- src/biogeochem/ch4Mod.F90 | 2 +- src/biogeophys/SoilHydrologyMod.F90 | 11 ----------- src/biogeophys/WaterfluxType.F90 | 2 -- src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 | 2 +- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 index 787aebbc24..575269deb9 100644 --- a/src/biogeochem/ch4Mod.F90 +++ b/src/biogeochem/ch4Mod.F90 @@ -1725,7 +1725,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) tws => waterstate_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - qflx_surf => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s) + qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] total surface runoff (mm H2O /s) conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) zwt0 => ch4_inst%zwt0_col , & ! Input: [real(r8) (:) ] decay factor for finundated (m) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index c16cef0e51..98a327a8a4 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -615,7 +615,6 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] total surface runoff (mm H2O /s) - qflx_surf_for_bgc => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s) qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col, & ! Input: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) @@ -640,16 +639,6 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & ! Depending on whether h2osfcflag is 0 or 1, one of qflx_infl_excess or ! qflx_h2osfc_surf will always be 0. But it's safe to just add them both. qflx_surf(c) = qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c) - - ! TODO(wjs, 2017-07-11) I'm distinguishing between qflx_surf and qflx_surf_for_bgc - ! simply to maintain answers as they were before. But I have a feeling that the - ! BGC code should really be using the total qflx_surf in its calculations. Once - ! Dave Lawrence or someone else signs off on this change, we should change the BGC - ! code to use qflx_surf and remove this qflx_surf_for_bgc variable. - ! Alternatively, if we deem the current implementation correct, we should - ! consider renaming this something better than qflx_surf_for_bgc, or simply - ! making the BGC code depend on qflx_sat_excess_surf, if that's what's intended. - qflx_surf_for_bgc(c) = qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c) end do ! ------------------------------------------------------------------------ diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index ff55279596..8d6e76eaa1 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -76,7 +76,6 @@ module WaterfluxType real(r8), pointer :: qflx_infl_excess_surf_col(:) ! col surface runoff due to infiltration excess (mm H2O /s) real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff (mm H2O /s) real(r8), pointer :: qflx_surf_col (:) ! col total surface runoff (mm H2O /s) - real(r8), pointer :: qflx_surf_for_bgc_col (:) ! col total surface runoff for input into BGC code (mm H2O /s) real(r8), pointer :: qflx_drain_col (:) ! col sub-surface runoff (mm H2O /s) real(r8), pointer :: qflx_rain_plus_snomelt_col(:) ! col rain plus snow melt falling on the soil (mm/s) real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) @@ -223,7 +222,6 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_rootsoi_col (begc:endc,1:nlevsoi)) ; this%qflx_rootsoi_col (:,:) = nan allocate(this%qflx_infl_col (begc:endc)) ; this%qflx_infl_col (:) = nan allocate(this%qflx_surf_col (begc:endc)) ; this%qflx_surf_col (:) = nan - allocate(this%qflx_surf_for_bgc_col (begc:endc)) ; this%qflx_surf_for_bgc_col (:) = nan allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan allocate(this%qflx_rain_plus_snomelt_col(begc:endc)) ; this%qflx_rain_plus_snomelt_col(:) = nan allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan diff --git a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 index 2cc77aef17..72db6363bb 100644 --- a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 @@ -109,7 +109,7 @@ subroutine SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, & h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) qflx_drain => waterflux_inst%qflx_drain_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_surf => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s) + qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] total surface runoff (mm H2O /s) sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral N smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ] From 90b5d5d983621f95ba008d1667c2dd2e7c9eceb9 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 7 Sep 2017 06:21:25 -0600 Subject: [PATCH 034/144] update changelog --- ChangeLog_branch | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index 8f65aed1f1..ce9f23aea7 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,6 +1,99 @@ =============================================================== Tag name: ctsm_n08_clm4_5_16_r249 Originator(s): sacks +Date: Sep 7, 2017 +One-line Summary: Use full qflx_surf in BGC code + +Purpose of changes +------------------ + +We had been using a separate variable to avoid changing answers. But +Dave Lawrence gave his approval to change this. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - not run + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - ok + yellowstone_pgi - ok + yellowstone_gnu - ok + cheyenne_intel - ok + hobart_nag - ok + hobart_pgi - ok + hobart_intel - ok + + ok means tests pass, answers change as expected + +CLM tag used for the baseline comparisons: ctsm_n08_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: All Bgc configurations + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + not investigated carefully; larger than roundoff, but expected to + be same climate + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +========= Main changes, as described above +M components/clm/src/biogeochem/ch4Mod.F90 +M components/clm/src/biogeophys/SoilHydrologyMod.F90 +M components/clm/src/biogeophys/WaterfluxType.F90 +M components/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 + +=============================================================== +=============================================================== +Tag name: ctsm_n08_clm4_5_16_r249 +Originator(s): sacks Date: Aug 24, 2017 One-line Summary: Finish Infiltration modularization - mainly h2osfc updates From 90acfaa4fb3cb63743a7a6c31796072970e79c50 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 25 Aug 2017 11:21:51 -0600 Subject: [PATCH 035/144] Fix whitespace --- src/biogeophys/SoilHydrologyMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index c16cef0e51..60a4a18b2b 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -214,12 +214,12 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:)] net water input into soil from top (mm/s) qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Output: [real(r8) (:)] surface input to soil (mm/s) qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col , & ! Output: [real(r8) (:)] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:)] rain plus snow melt falling on the soil (mm/s) + qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:)] rain plus snow melt falling on the soil (mm/s) qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:)] snow falling on surface water (mm/s) qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:)] column flux of flood water from RTM - qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:) ] evaporation flux from soil (W/m**2) [+ to atm] - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm] + qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:)] evaporation flux from soil (W/m**2) [+ to atm] + qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:)] ground surface evaporation rate (mm H2O/s) [+] + qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:)] evaporation flux from h2osfc (W/m**2) [+ to atm] qflx_sat_excess_surf => saturated_excess_runoff_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) From 1d5936484e1c1b98c5b485a3e2539d02a0c0b34e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 26 Aug 2017 06:05:35 -0600 Subject: [PATCH 036/144] Truncate small h2osfc values to zero This replaces the earlier code that only did this truncation in one particular circumstance. This seems mainly important to truncate small negative numbers to 0, but it also seems like a good idea to truncate small positive numbers that should have been 0. For now I'm leaving in some error-checking code to verify that answers change by no more than roundoff-level; I'll remove that in a later commit. --- src/biogeophys/SoilHydrologyMod.F90 | 43 +++++++++++++++++++++++------ src/main/clm_varcon.F90 | 25 +++++++++++++++++ 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 60a4a18b2b..e75b875663 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -11,7 +11,7 @@ module SoilHydrologyMod use decompMod , only : bounds_type use clm_varctl , only : iulog, use_vichydro use clm_varcon , only : e_ice, denh2o, denice, rpi, aquifer_water_baseline - use clm_varcon , only : pondmx_urban + use clm_varcon , only : pondmx_urban, rel_epsilon use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_imperv @@ -345,6 +345,9 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) real(r8) :: h2osfc_partial(bounds%begc:bounds%endc) ! partially-updated h2osfc + real(r8) :: h2osfc_orig ! h2osfc before any updates in this time step + ! FIXME(wjs, 2017-08-26) remove this variable + real(r8) :: h2osfc_old logical :: truncate_h2osfc_to_zero(bounds%begc:bounds%endc) !----------------------------------------------------------------------- @@ -391,23 +394,46 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & qflx_h2osfc_drain = qflx_h2osfc_drain(bounds%begc:bounds%endc), & truncate_h2osfc_to_zero = truncate_h2osfc_to_zero(bounds%begc:bounds%endc)) + ! Update h2osfc based on fluxes do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - ! The parenthesization of this expression is just needed to maintain bfb answers + h2osfc_orig = h2osfc(c) + + ! The parenthesization of this expression was just needed to maintain bfb answers ! in the major refactor. Note that the first parenthesized expression is ! h2osfc_partial(c), but I'm writing it out explicitly to facilitate a possible ! future removal of h2osfc_partial. h2osfc(c) = (h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime) & - qflx_h2osfc_drain(c) * dtime - ! TODO(wjs, 2017-08-22) This is here to maintain bit-for-bit answers with the old - ! code. If we're okay changing answers, we could remove it. Or maybe we want to - ! put a more general truncation in here, like: - ! if (abs(h2osfc(c)) < 1.e-14_r8 * abs(h2osfc_orig)) h2osfc(c) = 0._r8 - ! But I'm not sure what the general philosophy is regarding whether and when we - ! want to do truncations like this. + ! FIXME(wjs, 2017-08-26) Remove the following block of code + h2osfc_old = h2osfc(c) if (truncate_h2osfc_to_zero(c)) then + if (abs(h2osfc(c)) >= rel_epsilon * abs(h2osfc_orig)) then + write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large relative value' + write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig + call endrun('ERROR: truncate_h2osfc_to_zero true despite large relative value') + end if + if (abs(h2osfc(c)) > 1.e-9_r8) then + write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large absolute value' + write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig + call endrun('ERROR: truncate_h2osfc_to_zero true despite large absolute value') + end if + h2osfc_old = 0._r8 + end if + + ! Due to rounding errors, fluxes that should have brought h2osfc to exactly 0 may + ! have instead left it slightly less than or slightly greater than 0. Correct for + ! that here. + if (abs(h2osfc(c)) < rel_epsilon * abs(h2osfc_orig)) then + ! FIXME(wjs, 2017-08-26) remove this absolute check + if (abs(h2osfc(c)) > 1.e-9_r8) then + write(iulog,*) 'ERROR: new truncation triggered despite large absolute value' + write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig + call endrun('ERROR: new truncation triggered despite large absolute value') + end if + h2osfc(c) = 0._r8 end if @@ -544,6 +570,7 @@ subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & real(r8) , intent(in) :: frac_h2osfc( bounds%begc: ) ! fraction of ground covered by surface water (0 to 1) real(r8) , intent(in) :: qinmax( bounds%begc: ) ! maximum infiltration rate (mm H2O /s) real(r8) , intent(inout) :: qflx_h2osfc_drain( bounds%begc: ) ! bottom drainage from h2osfc (mm H2O /s) + ! FIXME(wjs, 2017-08-26) remove truncate_h2osfc_to_zero logical , intent(inout) :: truncate_h2osfc_to_zero( bounds%begc: ) ! whether h2osfc should be truncated to 0 to correct for roundoff errors, in order to maintain bit-for-bit the same answers as the old code ! ! !LOCAL VARIABLES: diff --git a/src/main/clm_varcon.F90 b/src/main/clm_varcon.F90 index d0a2053568..b0858e523e 100644 --- a/src/main/clm_varcon.F90 +++ b/src/main/clm_varcon.F90 @@ -91,6 +91,31 @@ module clm_varcon integer, public, parameter :: fun_period = 1 ! A FUN parameter, and probably needs to be changed for testing real(r8),public, parameter :: smallValue = 1.e-12_r8 ! A small values used by FUN + ! ------------------------------------------------------------------------ + ! Constants related to model numerics + ! ------------------------------------------------------------------------ + + ! Relative differences below rel_epsilon are considered to be zero. + ! + ! Note that double precision machine epsilon is approximately 1e-16, so this value of + ! 1e-13 allows for 3 orders of magnitude of "slop". + ! + ! Examples of how to use this: + ! + ! (1) Rather than checking + ! if (x == y) + ! instead check + ! if (abs(x - y) < rel_epsilon * x) + ! or + ! if (abs(x - y) < rel_epsilon * y) + ! + ! (2) After a state update, you can truncate the state to 0 based on this condition: + ! if (abs(some_state) < rel_epsilon * abs(some_state_orig)) then + ! some_state = 0._r8 + ! end if + ! where some_state_orig is the value of the state variable before the update + real(r8), public, parameter :: rel_epsilon = 1.e-13_r8 ! Relative differences below this are considered to be zero + ! ------------------------------------------------------------------------ ! Special value flags ! ------------------------------------------------------------------------ From 9a0a5968ada74668d0a045192a045c67315748d5 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 26 Aug 2017 09:22:19 -0600 Subject: [PATCH 037/144] Prevent check from failing when h2osfc = 0 --- src/biogeophys/SoilHydrologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index e75b875663..5534e20c0f 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -410,7 +410,7 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & ! FIXME(wjs, 2017-08-26) Remove the following block of code h2osfc_old = h2osfc(c) if (truncate_h2osfc_to_zero(c)) then - if (abs(h2osfc(c)) >= rel_epsilon * abs(h2osfc_orig)) then + if (abs(h2osfc(c)) > rel_epsilon * abs(h2osfc_orig)) then write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large relative value' write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig call endrun('ERROR: truncate_h2osfc_to_zero true despite large relative value') From 61bf943e7054161d91ef09b5a4b7a3fe82093f76 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sun, 27 Aug 2017 06:36:18 -0600 Subject: [PATCH 038/144] Print some more flux terms when we abort --- src/biogeophys/SoilHydrologyMod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 5534e20c0f..c36d0443dc 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -413,6 +413,8 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & if (abs(h2osfc(c)) > rel_epsilon * abs(h2osfc_orig)) then write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large relative value' write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig + write(iulog,*) 'qflx_in_h2osfc, qflx_h2osfc_surf, qflx_h2osfc_drain, h2osfc_partial, dtime = ', & + qflx_in_h2osfc(c), qflx_h2osfc_surf(c), qflx_h2osfc_drain(c), h2osfc_partial(c), dtime call endrun('ERROR: truncate_h2osfc_to_zero true despite large relative value') end if if (abs(h2osfc(c)) > 1.e-9_r8) then From 575bd18fbefb0b2f32d93108528eeacd6e753e31 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sun, 27 Aug 2017 07:04:43 -0600 Subject: [PATCH 039/144] Truncate based on rel diff from h2osfc_partial, not h2osfc_orig This test was failing: ERP_Ld5.f09_g17.I2000Clm50Vic.yellowstone_pgi.clm-vrtlay In a case where h2osfc_partial was negative, so QflxH2osfcDrain tried to truncate it, but h2osfc_partial was a few orders of magnitude greater than h2osfc_orig, so this didn't trigger the original rel_epsilon check. To deal with that, now separately truncate: (a) the final h2osfc based on rel diff from h2osfc_partial (b) h2osfc_partial based on the original h2osfc I'm not sure if (b) will / should ever trigger, but it seems safest to include this check, too. Update (after running the test suite): Regarding the truncate_small_values called after the comment, "Update h2osfc prior to calculating bottom drainage from h2osfc" (this is (b) above): This call to truncate_small_values never triggers any truncation, at least in the test suite. But it still seems safest to do this truncation here, too. --- src/biogeophys/SoilHydrologyMod.F90 | 33 ++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index c36d0443dc..05ddd6651e 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -345,7 +345,6 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) real(r8) :: h2osfc_partial(bounds%begc:bounds%endc) ! partially-updated h2osfc - real(r8) :: h2osfc_orig ! h2osfc before any updates in this time step ! FIXME(wjs, 2017-08-26) remove this variable real(r8) :: h2osfc_old logical :: truncate_h2osfc_to_zero(bounds%begc:bounds%endc) @@ -384,6 +383,22 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) h2osfc_partial(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime + if (abs(h2osfc_partial(c)) < rel_epsilon * abs(h2osfc(c))) then + ! FIXME(wjs, 2017-08-27) Remove this absolute check + if (abs(h2osfc_partial(c)) > 1.e-9_r8) then + write(iulog,*) 'ERROR: h2osfc_partial truncation triggered despite large absolute value' + write(iulog,*) 'h2osfc, qflx_in_h2osfc, qflx_h2osfc_surf, h2osfc_partial = ', & + h2osfc(c), qflx_in_h2osfc(c), qflx_h2osfc_surf(c), h2osfc_partial(c) + call endrun('ERROR: h2osfc_partial truncation triggered despite large absolute value') + end if + + ! FIXME(wjs, 2017-08-27) Remove this diagnostic print + write(iulog,*) 'WJS: truncating h2osfc_partial' + write(iulog,*) 'h2osfc, qflx_in_h2osfc, qflx_h2osfc_surf, h2osfc_partial = ', & + h2osfc(c), qflx_in_h2osfc(c), qflx_h2osfc_surf(c), h2osfc_partial(c) + + h2osfc_partial(c) = 0._r8 + end if end do call QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & @@ -398,8 +413,6 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - h2osfc_orig = h2osfc(c) - ! The parenthesization of this expression was just needed to maintain bfb answers ! in the major refactor. Note that the first parenthesized expression is ! h2osfc_partial(c), but I'm writing it out explicitly to facilitate a possible @@ -410,16 +423,16 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & ! FIXME(wjs, 2017-08-26) Remove the following block of code h2osfc_old = h2osfc(c) if (truncate_h2osfc_to_zero(c)) then - if (abs(h2osfc(c)) > rel_epsilon * abs(h2osfc_orig)) then + if (abs(h2osfc(c)) > rel_epsilon * abs(h2osfc_partial(c))) then write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large relative value' - write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig - write(iulog,*) 'qflx_in_h2osfc, qflx_h2osfc_surf, qflx_h2osfc_drain, h2osfc_partial, dtime = ', & - qflx_in_h2osfc(c), qflx_h2osfc_surf(c), qflx_h2osfc_drain(c), h2osfc_partial(c), dtime + write(iulog,*) 'h2osfc, h2osfc_partial = ', h2osfc(c), h2osfc_partial(c) + write(iulog,*) 'qflx_in_h2osfc, qflx_h2osfc_surf, qflx_h2osfc_drain, dtime = ', & + qflx_in_h2osfc(c), qflx_h2osfc_surf(c), qflx_h2osfc_drain(c), dtime call endrun('ERROR: truncate_h2osfc_to_zero true despite large relative value') end if if (abs(h2osfc(c)) > 1.e-9_r8) then write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large absolute value' - write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig + write(iulog,*) 'h2osfc, h2osfc_partial = ', h2osfc(c), h2osfc_partial(c) call endrun('ERROR: truncate_h2osfc_to_zero true despite large absolute value') end if h2osfc_old = 0._r8 @@ -428,11 +441,11 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & ! Due to rounding errors, fluxes that should have brought h2osfc to exactly 0 may ! have instead left it slightly less than or slightly greater than 0. Correct for ! that here. - if (abs(h2osfc(c)) < rel_epsilon * abs(h2osfc_orig)) then + if (abs(h2osfc(c)) < rel_epsilon * abs(h2osfc_partial(c))) then ! FIXME(wjs, 2017-08-26) remove this absolute check if (abs(h2osfc(c)) > 1.e-9_r8) then write(iulog,*) 'ERROR: new truncation triggered despite large absolute value' - write(iulog,*) 'h2osfc, h2osfc_orig = ', h2osfc(c), h2osfc_orig + write(iulog,*) 'h2osfc, h2osfc_partial = ', h2osfc(c), h2osfc_partial(c) call endrun('ERROR: new truncation triggered despite large absolute value') end if From 0fc8196067f0da1ab73a02fa1f2decb71e0a3765 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 29 Aug 2017 09:18:53 -0600 Subject: [PATCH 040/144] Remove temporary error checks These checks were just in place to ensure that the changes in this branch were no more than roundoff-level different from before. I have run the full aux_clm test suite and verified that none of these error checks are triggered, so now I can removed these temporary checks. --- src/biogeophys/SoilHydrologyMod.F90 | 56 ++--------------------------- 1 file changed, 3 insertions(+), 53 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 05ddd6651e..34be67ec9d 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -345,9 +345,6 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & integer :: c,l,fc ! indices real(r8) :: dtime ! land model time step (sec) real(r8) :: h2osfc_partial(bounds%begc:bounds%endc) ! partially-updated h2osfc - ! FIXME(wjs, 2017-08-26) remove this variable - real(r8) :: h2osfc_old - logical :: truncate_h2osfc_to_zero(bounds%begc:bounds%endc) !----------------------------------------------------------------------- associate( & @@ -384,19 +381,6 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & c = filter_hydrologyc(fc) h2osfc_partial(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime if (abs(h2osfc_partial(c)) < rel_epsilon * abs(h2osfc(c))) then - ! FIXME(wjs, 2017-08-27) Remove this absolute check - if (abs(h2osfc_partial(c)) > 1.e-9_r8) then - write(iulog,*) 'ERROR: h2osfc_partial truncation triggered despite large absolute value' - write(iulog,*) 'h2osfc, qflx_in_h2osfc, qflx_h2osfc_surf, h2osfc_partial = ', & - h2osfc(c), qflx_in_h2osfc(c), qflx_h2osfc_surf(c), h2osfc_partial(c) - call endrun('ERROR: h2osfc_partial truncation triggered despite large absolute value') - end if - - ! FIXME(wjs, 2017-08-27) Remove this diagnostic print - write(iulog,*) 'WJS: truncating h2osfc_partial' - write(iulog,*) 'h2osfc, qflx_in_h2osfc, qflx_h2osfc_surf, h2osfc_partial = ', & - h2osfc(c), qflx_in_h2osfc(c), qflx_h2osfc_surf(c), h2osfc_partial(c) - h2osfc_partial(c) = 0._r8 end if end do @@ -406,8 +390,7 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & h2osfc = h2osfc_partial(bounds%begc:bounds%endc), & frac_h2osfc = frac_h2osfc(bounds%begc:bounds%endc), & qinmax = qinmax(bounds%begc:bounds%endc), & - qflx_h2osfc_drain = qflx_h2osfc_drain(bounds%begc:bounds%endc), & - truncate_h2osfc_to_zero = truncate_h2osfc_to_zero(bounds%begc:bounds%endc)) + qflx_h2osfc_drain = qflx_h2osfc_drain(bounds%begc:bounds%endc)) ! Update h2osfc based on fluxes do fc = 1, num_hydrologyc @@ -420,35 +403,10 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & h2osfc(c) = (h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime) & - qflx_h2osfc_drain(c) * dtime - ! FIXME(wjs, 2017-08-26) Remove the following block of code - h2osfc_old = h2osfc(c) - if (truncate_h2osfc_to_zero(c)) then - if (abs(h2osfc(c)) > rel_epsilon * abs(h2osfc_partial(c))) then - write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large relative value' - write(iulog,*) 'h2osfc, h2osfc_partial = ', h2osfc(c), h2osfc_partial(c) - write(iulog,*) 'qflx_in_h2osfc, qflx_h2osfc_surf, qflx_h2osfc_drain, dtime = ', & - qflx_in_h2osfc(c), qflx_h2osfc_surf(c), qflx_h2osfc_drain(c), dtime - call endrun('ERROR: truncate_h2osfc_to_zero true despite large relative value') - end if - if (abs(h2osfc(c)) > 1.e-9_r8) then - write(iulog,*) 'ERROR: truncate_h2osfc_to_zero true despite large absolute value' - write(iulog,*) 'h2osfc, h2osfc_partial = ', h2osfc(c), h2osfc_partial(c) - call endrun('ERROR: truncate_h2osfc_to_zero true despite large absolute value') - end if - h2osfc_old = 0._r8 - end if - ! Due to rounding errors, fluxes that should have brought h2osfc to exactly 0 may ! have instead left it slightly less than or slightly greater than 0. Correct for ! that here. if (abs(h2osfc(c)) < rel_epsilon * abs(h2osfc_partial(c))) then - ! FIXME(wjs, 2017-08-26) remove this absolute check - if (abs(h2osfc(c)) > 1.e-9_r8) then - write(iulog,*) 'ERROR: new truncation triggered despite large absolute value' - write(iulog,*) 'h2osfc, h2osfc_partial = ', h2osfc(c), h2osfc_partial(c) - call endrun('ERROR: new truncation triggered despite large absolute value') - end if - h2osfc(c) = 0._r8 end if @@ -565,16 +523,13 @@ end subroutine QflxH2osfcSurf !----------------------------------------------------------------------- subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & h2osfcflag, h2osfc, frac_h2osfc, qinmax, & - qflx_h2osfc_drain, truncate_h2osfc_to_zero) + qflx_h2osfc_drain) ! ! !DESCRIPTION: ! Compute qflx_h2osfc_drain ! ! Note that, if h2osfc is negative, then qflx_h2osfc_drain will be negative - acting - ! to exactly restore h2osfc to 0. In this case, truncate_h2osfc_to_zero will be set - ! to true; in all other cases, truncate_h2osfc_to_zero will be set to false. This - ! particular behavior of truncate_h2osfc_to_zero is just like this to maintain - ! bit-for-bit answers with the old code (see also the TODO note in UpdateH2osfc). + ! to exactly restore h2osfc to 0. ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -585,8 +540,6 @@ subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & real(r8) , intent(in) :: frac_h2osfc( bounds%begc: ) ! fraction of ground covered by surface water (0 to 1) real(r8) , intent(in) :: qinmax( bounds%begc: ) ! maximum infiltration rate (mm H2O /s) real(r8) , intent(inout) :: qflx_h2osfc_drain( bounds%begc: ) ! bottom drainage from h2osfc (mm H2O /s) - ! FIXME(wjs, 2017-08-26) remove truncate_h2osfc_to_zero - logical , intent(inout) :: truncate_h2osfc_to_zero( bounds%begc: ) ! whether h2osfc should be truncated to 0 to correct for roundoff errors, in order to maintain bit-for-bit the same answers as the old code ! ! !LOCAL VARIABLES: integer :: fc, c @@ -599,7 +552,6 @@ subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & SHR_ASSERT_ALL((ubound(frac_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) SHR_ASSERT_ALL((ubound(qinmax) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) SHR_ASSERT_ALL((ubound(qflx_h2osfc_drain) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(truncate_h2osfc_to_zero) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) dtime = get_step_size() @@ -608,14 +560,12 @@ subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & if (h2osfc(c) < 0.0) then qflx_h2osfc_drain(c) = h2osfc(c)/dtime - truncate_h2osfc_to_zero(c) = .true. else qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax(c),h2osfc(c)/dtime) if(h2osfcflag==0) then ! ensure no h2osfc qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) end if - truncate_h2osfc_to_zero(c) = .false. end if end do From 520303bf2053eb7e0b33a15945bec83c826b77e7 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 29 Aug 2017 09:23:55 -0600 Subject: [PATCH 041/144] Reference h2osfc_partial explicitly in update of h2osfc Sicne I'm referencing h2osfc_partial explicitly in the later truncation code anyway, it seems reasonable - and in fact more clear - to reference h2osfc_partial here, too. --- src/biogeophys/SoilHydrologyMod.F90 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 34be67ec9d..aab8708872 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -396,12 +396,7 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - ! The parenthesization of this expression was just needed to maintain bfb answers - ! in the major refactor. Note that the first parenthesized expression is - ! h2osfc_partial(c), but I'm writing it out explicitly to facilitate a possible - ! future removal of h2osfc_partial. - h2osfc(c) = (h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime) & - - qflx_h2osfc_drain(c) * dtime + h2osfc(c) = h2osfc_partial(c) - qflx_h2osfc_drain(c) * dtime ! Due to rounding errors, fluxes that should have brought h2osfc to exactly 0 may ! have instead left it slightly less than or slightly greater than 0. Correct for From 3e66188fa3d2ae19a6600800e11f6a8705b29a5d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 29 Aug 2017 13:33:59 -0600 Subject: [PATCH 042/144] Move truncation code into a separate subroutine Also, add unit tests for this truncation code --- src/biogeophys/SoilHydrologyMod.F90 | 28 ++-- .../unittestFilterBuilderMod.F90 | 2 +- src/utils/CMakeLists.txt | 1 + src/utils/NumericsMod.F90 | 67 ++++++++++ src/utils/test/CMakeLists.txt | 3 +- src/utils/test/numerics_test/CMakeLists.txt | 10 ++ .../test_truncate_small_values.pf | 120 ++++++++++++++++++ 7 files changed, 216 insertions(+), 15 deletions(-) create mode 100644 src/utils/NumericsMod.F90 create mode 100644 src/utils/test/numerics_test/CMakeLists.txt create mode 100644 src/utils/test/numerics_test/test_truncate_small_values.pf diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index aab8708872..754ecf6dea 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -11,12 +11,13 @@ module SoilHydrologyMod use decompMod , only : bounds_type use clm_varctl , only : iulog, use_vichydro use clm_varcon , only : e_ice, denh2o, denice, rpi, aquifer_water_baseline - use clm_varcon , only : pondmx_urban, rel_epsilon + use clm_varcon , only : pondmx_urban use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_imperv use landunit_varcon , only : istsoil, istcrop use clm_time_manager , only : get_step_size + use NumericsMod , only : truncate_small_values use EnergyFluxType , only : energyflux_type use InfiltrationExcessRunoffMod, only : infiltration_excess_runoff_type use SoilHydrologyType , only : soilhydrology_type @@ -380,11 +381,13 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) h2osfc_partial(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime - if (abs(h2osfc_partial(c)) < rel_epsilon * abs(h2osfc(c))) then - h2osfc_partial(c) = 0._r8 - end if end do + call truncate_small_values(num_f = num_hydrologyc, filter_f = filter_hydrologyc, & + lb = bounds%begc, ub = bounds%endc, & + data_baseline = h2osfc(bounds%begc:bounds%endc), & + data = h2osfc_partial(bounds%begc:bounds%endc)) + call QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & h2osfcflag = h2osfcflag, & h2osfc = h2osfc_partial(bounds%begc:bounds%endc), & @@ -395,18 +398,17 @@ subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & ! Update h2osfc based on fluxes do fc = 1, num_hydrologyc c = filter_hydrologyc(fc) - h2osfc(c) = h2osfc_partial(c) - qflx_h2osfc_drain(c) * dtime - - ! Due to rounding errors, fluxes that should have brought h2osfc to exactly 0 may - ! have instead left it slightly less than or slightly greater than 0. Correct for - ! that here. - if (abs(h2osfc(c)) < rel_epsilon * abs(h2osfc_partial(c))) then - h2osfc(c) = 0._r8 - end if - end do + ! Due to rounding errors, fluxes that should have brought h2osfc to exactly 0 may + ! have instead left it slightly less than or slightly greater than 0. Correct for + ! that here. + call truncate_small_values(num_f = num_hydrologyc, filter_f = filter_hydrologyc, & + lb = bounds%begc, ub = bounds%endc, & + data_baseline = h2osfc_partial(bounds%begc:bounds%endc), & + data = h2osfc(bounds%begc:bounds%endc)) + end associate end subroutine UpdateH2osfc diff --git a/src/unit_test_shr/unittestFilterBuilderMod.F90 b/src/unit_test_shr/unittestFilterBuilderMod.F90 index 3ed61eb9a2..6999b63d72 100644 --- a/src/unit_test_shr/unittestFilterBuilderMod.F90 +++ b/src/unit_test_shr/unittestFilterBuilderMod.F90 @@ -55,7 +55,7 @@ subroutine filter_from_range(start, end, numf, filter) ! !LOCAL VARIABLES: integer :: i - character(len=*), parameter :: subname = 'filter_from_list' + character(len=*), parameter :: subname = 'filter_from_range' !----------------------------------------------------------------------- numf = end - start + 1 diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 31a298e28e..4c4c498734 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -17,6 +17,7 @@ list(APPEND clm_sources clm_nlUtilsMod.F90 clm_time_manager.F90 fileutils.F90 + NumericsMod.F90 ) sourcelist_to_parent(clm_sources) diff --git a/src/utils/NumericsMod.F90 b/src/utils/NumericsMod.F90 new file mode 100644 index 0000000000..8ca7d504ef --- /dev/null +++ b/src/utils/NumericsMod.F90 @@ -0,0 +1,67 @@ +module NumericsMod + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Utility routines for assisting with model numerics + ! + ! !USES: +#include "shr_assert.h" + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_log_mod , only : errMsg => shr_log_errMsg + use clm_varcon , only : rel_epsilon + + implicit none + save + private + + ! !PUBLIC MEMBER FUNCTIONS: + public :: truncate_small_values ! Truncate relatively small values to 0 + + ! !PRIVATE MEMBER DATA: + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + !----------------------------------------------------------------------- + subroutine truncate_small_values(num_f, filter_f, lb, ub, data_baseline, data) + ! + ! !DESCRIPTION: + ! Truncate relatively small values to 0, within the given filter. + ! + ! "Relatively small" is determined by comparison with some "baseline" version of the + ! data. + ! + ! For example, this can be used after doing a state update. In this case, + ! data_baseline should hold the values before the state update, and data should hold + ! the values after the state update. + ! + ! !ARGUMENTS: + integer , intent(in) :: num_f ! number of points in filter_f + integer , intent(in) :: filter_f(:) ! filter of points in data + integer , intent(in) :: lb ! lower bound of data + integer , intent(in) :: ub ! upper bound of data + real(r8) , intent(in) :: data_baseline(lb:) ! baseline version of data, used to define "relatively close to 0" + real(r8) , intent(inout) :: data(lb:) ! data to operate on + ! + ! !LOCAL VARIABLES: + integer :: fn ! index into filter + integer :: n ! index into data + + character(len=*), parameter :: subname = 'truncate_small_values' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL((ubound(data_baseline) == (/ub/)), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_ALL((ubound(data) == (/ub/)), errMsg(sourcefile, __LINE__)) + + do fn = 1, num_f + n = filter_f(fn) + if (abs(data(n)) < rel_epsilon * abs(data_baseline(n))) then + data(n) = 0._r8 + end if + end do + + end subroutine truncate_small_values + +end module NumericsMod diff --git a/src/utils/test/CMakeLists.txt b/src/utils/test/CMakeLists.txt index 64e7e89171..2b39a131f7 100644 --- a/src/utils/test/CMakeLists.txt +++ b/src/utils/test/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(clm_time_manager_test) -add_subdirectory(annual_flux_dribbler_test) \ No newline at end of file +add_subdirectory(annual_flux_dribbler_test) +add_subdirectory(numerics_test) diff --git a/src/utils/test/numerics_test/CMakeLists.txt b/src/utils/test/numerics_test/CMakeLists.txt new file mode 100644 index 0000000000..83bf0cc1d0 --- /dev/null +++ b/src/utils/test/numerics_test/CMakeLists.txt @@ -0,0 +1,10 @@ +set (pfunit_sources + test_truncate_small_values.pf) + +set (extra_sources + ) + +create_pFUnit_test(numerics test_numerics_exe + "${pfunit_sources}" "${extra_sources}") + +target_link_libraries(test_numerics_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/utils/test/numerics_test/test_truncate_small_values.pf b/src/utils/test/numerics_test/test_truncate_small_values.pf new file mode 100644 index 0000000000..a989f21c3d --- /dev/null +++ b/src/utils/test/numerics_test/test_truncate_small_values.pf @@ -0,0 +1,120 @@ +module test_truncate_small_values + + ! Tests of NumericsMod: truncate_small_values + + use pfunit_mod + use NumericsMod + use shr_kind_mod , only : r8 => shr_kind_r8 + use unittestSimpleSubgridSetupsMod + use unittestSubgridMod + use unittestFilterBuilderMod, only : filter_from_range + + implicit none + + @TestCase + type, extends(TestCase) :: TestTSV + contains + procedure :: setUp + procedure :: tearDown + end type TestTSV + + real(r8), parameter :: tol = 1.e-13_r8 + +contains + + subroutine setUp(this) + class(TestTSV), intent(inout) :: this + end subroutine setUp + + subroutine tearDown(this) + class(TestTSV), intent(inout) :: this + + call unittest_subgrid_teardown() + end subroutine tearDown + + @Test + subroutine truncates_correct_points(this) + class(TestTSV), intent(inout) :: this + real(r8) :: data_baseline(3) + real(r8) :: data(3) + real(r8) :: data_saved(3) + integer :: num_f + integer, allocatable :: filter_f(:) + + call setup_n_veg_patches(pwtcol = [0.1_r8, 0.8_r8, 0.1_r8], pft_types = [1, 2, 3]) + call filter_from_range(bounds%begp, bounds%endp, num_f, filter_f) + + ! point 2 should be truncated, others should not be truncated + data_baseline = [1._r8, 1._r8, 1._r8] + data = [0.5_r8, 1.e-16_r8, -1._r8] + data_saved = data + + call truncate_small_values( & + num_f = num_f, & + filter_f = filter_f, & + lb = bounds%begp, & + ub = bounds%endp, & + data_baseline = data_baseline, & + data = data) + + @assertEqual(data_saved(1), data(1)) + @assertEqual(data_saved(3), data(3)) + @assertEqual(0._r8, data(2)) + + end subroutine truncates_correct_points + + @Test + subroutine truncates_large_magnitude(this) + ! Make sure we're just relying on relative rather than absolute magnitudes by + ! confirming that it can truncate a value with large magnitude. + class(TestTSV), intent(inout) :: this + real(r8) :: data_baseline(1) + real(r8) :: data(1) + integer :: num_f + integer, allocatable :: filter_f(:) + + call setup_single_veg_patch(pft_type = 1) + call filter_from_range(bounds%begp, bounds%endp, num_f, filter_f) + + data_baseline = [1.e30_r8] + data = [1.e10_r8] + + call truncate_small_values( & + num_f = num_f, & + filter_f = filter_f, & + lb = bounds%begp, & + ub = bounds%endp, & + data_baseline = data_baseline, & + data = data) + + @assertEqual(0._r8, data(1)) + end subroutine truncates_large_magnitude + + @Test + subroutine does_not_truncate_small_magnitude(this) + ! Make sure we're just relying on relative rather than absolute magnitudes by + ! confirming that it does not truncate a value with small magnitude. + class(TestTSV), intent(inout) :: this + real(r8) :: data_baseline(1) + real(r8) :: data(1) + integer :: num_f + integer, allocatable :: filter_f(:) + + call setup_single_veg_patch(pft_type = 1) + call filter_from_range(bounds%begp, bounds%endp, num_f, filter_f) + + data_baseline = [1.e-30_r8] + data = [1.e-31_r8] + + call truncate_small_values( & + num_f = num_f, & + filter_f = filter_f, & + lb = bounds%begp, & + ub = bounds%endp, & + data_baseline = data_baseline, & + data = data) + + @assertEqual(1.e-31_r8, data(1)) + end subroutine does_not_truncate_small_magnitude + +end module test_truncate_small_values From 3f0b3cafb5486400a1af487e2bcf35667046705b Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 7 Sep 2017 05:21:55 -0600 Subject: [PATCH 043/144] Remove a long test Remove SMS_Lm25.f19_g17.I2000Clm50BgcCrop.yellowstone_gnu.clm-cropMonthOutput This test recently exceeded the 2-hour time limit that I gave it. In an effort to reduce testing time, I am removing this test: We already have some other multi-year crop tests, and we already have some short crop tests at f19. The above test seemed more useful before we interpolated initial conditions; now that we do, I feel it can be removed. --- cime_config/testdefs/testlist_clm.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 53e942b2d0..772774377c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -485,9 +485,6 @@ cheyenne yellowstone - - yellowstone - From 609f9792f3070420eef7d1eca2f954e6e64c7e7d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 8 Sep 2017 13:18:45 -0600 Subject: [PATCH 044/144] Add a test SMS_Lm13.f19_g17.I2000Clm50BgcCrop.yellowstone_gnu.clm-cropMonthOutput Erik was uncomfortable with my removal of SMS_Lm25.f19_g17.I2000Clm50BgcCrop.yellowstone_gnu.clm-cropMonthOutput: How about either flip it to f45 (because Rosie is using that resolution for science) -- or leave it at f19 and have it run for 9 months? The 25 months was to take it just past the 2-year spinup time. From spunup initial conditions 9-months pretty much does a full harvest cycle. f19 and f09 are the main configurations for science and it would be good to have something longer than just really short tests. I decided on Lm13, because this still completes in significantly less than 2-hours, and if we're running for 9 months anyway, it seems valuable to finish out the year and run a bit into the next year, since some crop stuff triggers at the end of the year. --- cime_config/testdefs/testlist_clm.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 772774377c..a6f2480a8f 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -485,6 +485,9 @@ cheyenne yellowstone + + yellowstone + From 26b5b0a8e6b8f1dd00e78ad6ce66915a7d304cc5 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 14 Sep 2017 06:20:02 -0600 Subject: [PATCH 045/144] Move definition of rel_epsilon into NumericsMod --- src/main/clm_varcon.F90 | 25 ------------------------- src/utils/NumericsMod.F90 | 24 +++++++++++++++++++++++- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/main/clm_varcon.F90 b/src/main/clm_varcon.F90 index b0858e523e..d0a2053568 100644 --- a/src/main/clm_varcon.F90 +++ b/src/main/clm_varcon.F90 @@ -91,31 +91,6 @@ module clm_varcon integer, public, parameter :: fun_period = 1 ! A FUN parameter, and probably needs to be changed for testing real(r8),public, parameter :: smallValue = 1.e-12_r8 ! A small values used by FUN - ! ------------------------------------------------------------------------ - ! Constants related to model numerics - ! ------------------------------------------------------------------------ - - ! Relative differences below rel_epsilon are considered to be zero. - ! - ! Note that double precision machine epsilon is approximately 1e-16, so this value of - ! 1e-13 allows for 3 orders of magnitude of "slop". - ! - ! Examples of how to use this: - ! - ! (1) Rather than checking - ! if (x == y) - ! instead check - ! if (abs(x - y) < rel_epsilon * x) - ! or - ! if (abs(x - y) < rel_epsilon * y) - ! - ! (2) After a state update, you can truncate the state to 0 based on this condition: - ! if (abs(some_state) < rel_epsilon * abs(some_state_orig)) then - ! some_state = 0._r8 - ! end if - ! where some_state_orig is the value of the state variable before the update - real(r8), public, parameter :: rel_epsilon = 1.e-13_r8 ! Relative differences below this are considered to be zero - ! ------------------------------------------------------------------------ ! Special value flags ! ------------------------------------------------------------------------ diff --git a/src/utils/NumericsMod.F90 b/src/utils/NumericsMod.F90 index 8ca7d504ef..8d75753bb8 100644 --- a/src/utils/NumericsMod.F90 +++ b/src/utils/NumericsMod.F90 @@ -8,7 +8,6 @@ module NumericsMod #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : rel_epsilon implicit none save @@ -17,6 +16,29 @@ module NumericsMod ! !PUBLIC MEMBER FUNCTIONS: public :: truncate_small_values ! Truncate relatively small values to 0 + ! !PUBLIC MEMBER DATA: + + ! Relative differences below rel_epsilon are considered to be zero. + ! + ! Note that double precision machine epsilon is approximately 1e-16, so this value of + ! 1e-13 allows for 3 orders of magnitude of "slop". + ! + ! Examples of how to use this: + ! + ! (1) Rather than checking + ! if (x == y) + ! instead check + ! if (abs(x - y) < rel_epsilon * x) + ! or + ! if (abs(x - y) < rel_epsilon * y) + ! + ! (2) After a state update, you can truncate the state to 0 based on this condition: + ! if (abs(some_state) < rel_epsilon * abs(some_state_orig)) then + ! some_state = 0._r8 + ! end if + ! where some_state_orig is the value of the state variable before the update + real(r8), public, parameter :: rel_epsilon = 1.e-13_r8 ! Relative differences below this are considered to be zero + ! !PRIVATE MEMBER DATA: character(len=*), parameter, private :: sourcefile = & From 31f57c67c7bc5b66be2d414471af287e42141fff Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 14 Sep 2017 16:45:09 -0600 Subject: [PATCH 046/144] Update ChangeLog_branch --- ChangeLog_branch | 121 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/ChangeLog_branch b/ChangeLog_branch index ce9f23aea7..ace21cfdb9 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,5 +1,124 @@ =============================================================== -Tag name: ctsm_n08_clm4_5_16_r249 +Tag name: ctsm_n10_clm4_5_16_r249 +Originator(s): sacks +Date: Sep 14, 2017 +One-line Summary: Truncate small h2osfc values to zero + +Purpose of changes +------------------ + +This replaces the earlier code that only did this truncation in one +particular circumstance. + +This seems mainly important to truncate small negative numbers to 0, but +it also seems like a good idea to truncate small positive numbers that +should have been 0. + +With some intermediate commits on this branch, I did some careful tests +to ensure that these diffs introduce no more than roundoff-level +changes. + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - pass + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - ok + yellowstone_pgi - ok + yellowstone_gnu - ok + cheyenne_intel - ok + hobart_nag - ok + hobart_pgi - ok + hobart_intel - ok + + ok means tests pass, change answers as expected + +CLM tag used for the baseline comparisons: ctsm_n09_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: all clm45/clm50 + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + I introduced some temporary code to ensure that, where there are + differences between the old and new code, these differences are + only roundoff-level (e.g., a roundoff-level value being rounded to + 0 now where it wasn't before). + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: + +========= New utility for truncating small values to 0, and associated + unit tests +A components/clm/src/utils/NumericsMod.F90 +A components/clm/src/utils/test/numerics_test/CMakeLists.txt +A components/clm/src/utils/test/numerics_test/test_truncate_small_values.pf + +List all existing files that have been modified, and describe the changes: + +========= Main changes +M components/clm/src/biogeophys/SoilHydrologyMod.F90 + +========= New unit tests +M components/clm/src/utils/CMakeLists.txt +M components/clm/src/utils/test/CMakeLists.txt + +========= Unrelated fix to subroutine name +M components/clm/src/unit_test_shr/unittestFilterBuilderMod.F90 + +========= Shorten a test that was taking > 2 hours +M components/clm/cime_config/testdefs/testlist_clm.xml + +=============================================================== +=============================================================== +Tag name: ctsm_n09_clm4_5_16_r249 Originator(s): sacks Date: Sep 7, 2017 One-line Summary: Use full qflx_surf in BGC code From a5fb219388153f1abcab97897130ee713dd0ef33 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 13 Sep 2017 16:15:05 -0600 Subject: [PATCH 047/144] Remove infiltration excess runoff for VIC Martyn Clark reviewed the VIC implementation, and felt that the current implementation of infiltration excess runoff is inconsistent with the standard VIC implementation. It appears that what was being called VIC's infiltration excess runoff was actually just an attempt to give a better numerical approximation to the solution for saturated surface excess runoff. So deleting this leaves only a first-order approximation to VIC's saturated surface excess runoff. Eventually we may want to put in place a more accurate solution for VIC's saturated surface excess runoff. But Martyn's feeling is that this can come in with other changes we want to make regarding numerical solutions in CTSM. --- .../InfiltrationExcessRunoffMod.F90 | 97 ++++--------------- src/biogeophys/SaturatedExcessRunoffMod.F90 | 4 + 2 files changed, 23 insertions(+), 78 deletions(-) diff --git a/src/biogeophys/InfiltrationExcessRunoffMod.F90 b/src/biogeophys/InfiltrationExcessRunoffMod.F90 index ddd50136d5..2f7563cec3 100644 --- a/src/biogeophys/InfiltrationExcessRunoffMod.F90 +++ b/src/biogeophys/InfiltrationExcessRunoffMod.F90 @@ -53,13 +53,22 @@ module InfiltrationExcessRunoffMod procedure, private :: InitCold procedure, private, nopass :: ComputeQinmaxHksat - procedure, private, nopass :: ComputeQinmaxVic end type infiltration_excess_runoff_type ! !PRIVATE DATA MEMBERS: + ! For methods that don't generate any infiltration excess runoff, we get this end result + ! by specifying a huge qinmax value - i.e., an effectively infinite max infiltration + ! rate. + ! + ! 1e200 mm H2O /s seems large enough to be effectively infinite, while not being so + ! large as to cause floating point overflows elsewhere. + real(r8), parameter :: qinmax_unlimited = 1.e200_r8 ! mm H2O /s + + ! The 'none' option avoids generating any infiltration excess runoff by setting qinmax + ! to a huge value + integer, parameter :: QINMAX_METHOD_NONE = 0 integer, parameter :: QINMAX_METHOD_HKSAT = 1 - integer, parameter :: QINMAX_METHOD_VIC = 2 character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -155,7 +164,7 @@ subroutine InitCold(this, bounds) ! TODO(wjs, 2017-08-14) We'll read qinmax_method from namelist. if (use_vichydro) then - this%qinmax_method = QINMAX_METHOD_VIC + this%qinmax_method = QINMAX_METHOD_NONE else this%qinmax_method = QINMAX_METHOD_HKSAT end if @@ -203,16 +212,17 @@ subroutine InfiltrationExcessRunoff(this, bounds, num_hydrologyc, filter_hydrolo ) select case (this%qinmax_method) + case (QINMAX_METHOD_NONE) + ! NOTE(wjs, 2017-09-01) I'm putting this here for clarity, though it could be + ! moved to initialization for efficiency + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + qinmax_on_unsaturated_area(c) = qinmax_unlimited + end do case (QINMAX_METHOD_HKSAT) call this%ComputeQinmaxHksat(bounds, num_hydrologyc, filter_hydrologyc, & soilhydrology_inst, soilstate_inst, & qinmax_on_unsaturated_area = qinmax_on_unsaturated_area(bounds%begc:bounds%endc)) - case (QINMAX_METHOD_VIC) - call this%ComputeQinmaxVic(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, & - fsat = fsat(bounds%begc:bounds%endc), & - qflx_in_soil = qflx_in_soil(bounds%begc:bounds%endc), & - qinmax_on_unsaturated_area = qinmax_on_unsaturated_area(bounds%begc:bounds%endc)) case default write(iulog,*) subname//' ERROR: Unrecognized qinmax_method: ', this%qinmax_method call endrun(subname//' ERROR: Unrecognized qinmax_method') @@ -270,73 +280,4 @@ subroutine ComputeQinmaxHksat(bounds, num_hydrologyc, filter_hydrologyc, & end subroutine ComputeQinmaxHksat - !----------------------------------------------------------------------- - subroutine ComputeQinmaxVic(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, & - fsat, qflx_in_soil, qinmax_on_unsaturated_area) - ! - ! !DESCRIPTION: - ! Compute qinmax using the VIC parameterization - ! - ! Citation: Wood et al. 1992, "A land-surface hydrology parameterization with subgrid - ! variability for general circulation models", JGR 97(D3), 2717-2728. - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - real(r8) , intent(in) :: fsat( bounds%begc: ) ! fractional area with water table at surface - real(r8) , intent(in) :: qflx_in_soil( bounds%begc: ) ! surface input to soil (mm/s) - real(r8) , intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration rate on the unsaturated fraction of the column (mm H2O /s) - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: dtime ! land model time step (sec) - real(r8) :: top_icefrac ! ice fraction in top VIC layers - real(r8) :: max_infil ! max infiltration capacity using the VIC parameterization (mm) - real(r8) :: i_0 ! average soil moisture in top VIC layers (mm) - real(r8) :: rsurf_vic ! surface runoff based on the VIC parameterization - real(r8) :: basis ! variable soil moisture holding capacity in top VIC layers for runoff calculation - - character(len=*), parameter :: subname = 'ComputeQinmaxVic' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(fsat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qflx_in_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qinmax_on_unsaturated_area) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers - top_moist => soilhydrology_inst%top_moist_col , & ! Input: [real(r8) (:) ] soil moisture in top VIC layers - top_ice => soilhydrology_inst%top_ice_col , & ! Input: [real(r8) (:) ] ice len in top VIC layers - b_infil => soilhydrology_inst%b_infil_col & ! Input: [real(r8) (:) ] VIC b infiltration parameter - ) - - dtime = get_step_size() - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - top_icefrac = min(1._r8,top_ice(c)/top_max_moist(c)) - max_infil = (1._r8+b_infil(c)) * top_max_moist(c) - i_0 = max_infil * (1._r8 - (1._r8 - fsat(c))**(1._r8/b_infil(c))) - if(qflx_in_soil(c) <= 0._r8) then - rsurf_vic = 0._r8 - else if(max_infil <= 0._r8) then - rsurf_vic = qflx_in_soil(c) - else if((i_0 + qflx_in_soil(c)*dtime) > max_infil) then !(Eq.(3a) Wood et al. 1992) - rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c))/dtime - else !(Eq.(3b) Wood et al. 1992) - basis = 1._r8 - (i_0 + qflx_in_soil(c)*dtime)/max_infil - rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c) & - + top_max_moist(c) * basis**(1._r8 + b_infil(c)))/dtime - end if - rsurf_vic = min(qflx_in_soil(c), rsurf_vic) - qinmax_on_unsaturated_area(c) = 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) - end do - - end associate - - end subroutine ComputeQinmaxVic - end module InfiltrationExcessRunoffMod diff --git a/src/biogeophys/SaturatedExcessRunoffMod.F90 b/src/biogeophys/SaturatedExcessRunoffMod.F90 index 21dcedd5f6..51f1c8369d 100644 --- a/src/biogeophys/SaturatedExcessRunoffMod.F90 +++ b/src/biogeophys/SaturatedExcessRunoffMod.F90 @@ -334,6 +334,10 @@ subroutine ComputeFsatVic(bounds, num_hydrologyc, filter_hydrologyc, & ! Citation: Wood et al. 1992, "A land-surface hydrology parameterization with subgrid ! variability for general circulation models", JGR 97(D3), 2717-2728. ! + ! This implementation gives a first-order approximation to saturated excess runoff. + ! For now we're not including the more exact analytical solution, or even a better + ! numerical approximation. + ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter From 5f43763577213d6e6c7db367b70231b0ee0a6791 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 18 Sep 2017 10:53:27 -0600 Subject: [PATCH 048/144] update changelog --- ChangeLog_branch | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index ace21cfdb9..811cef6464 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,4 +1,104 @@ =============================================================== +Tag name: ctsm_n11_clm4_5_16_r249 +Originator(s): sacks +Date: Sep 18, 2017 +One-line Summary: Remove infiltration excess runoff for VIC + +Purpose of changes +------------------ + +Martyn Clark reviewed the VIC implementation, and felt that the current +implementation of infiltration excess runoff is inconsistent with the +standard VIC implementation. It appears that what was being called VIC's +infiltration excess runoff was actually just an attempt to give a better +numerical approximation to the solution for saturated surface excess +runoff. So deleting this leaves only a first-order approximation to +VIC's saturated surface excess runoff. + +Eventually we may want to put in place a more accurate solution for +VIC's saturated surface excess runoff. But Martyn's feeling is that this +can come in with other changes we want to make regarding numerical +solutions in CTSM. + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + yellowstone - not run + + unit-tests (components/clm/src): + + yellowstone - pass + + tools-tests (components/clm/test/tools): + + yellowstone - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + yellowstone - not run + + regular tests (aux_clm): + + yellowstone_intel - ok + yellowstone_pgi - ok + yellowstone_gnu - ok + cheyenne_intel - ok + hobart_nag - ok + hobart_pgi - ok + hobart_intel - ok + + ok means tests pass, Vic tests change answers as expected + +CLM tag used for the baseline comparisons: ctsm_n10_clm4_5_16_r249 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: Compsets with Vic + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff; likely same climate but not investigated + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +M components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 +M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 + +=============================================================== +=============================================================== Tag name: ctsm_n10_clm4_5_16_r249 Originator(s): sacks Date: Sep 14, 2017 From 22ae73097ab5949a897bf781db2da02f6e92247e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 28 Dec 2017 13:53:52 -0700 Subject: [PATCH 049/144] Change ctsm_* to unified_land_model_* in tag names in ChangeLog --- ChangeLog_branch | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ChangeLog_branch b/ChangeLog_branch index 811cef6464..b4a3900f61 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,5 +1,5 @@ =============================================================== -Tag name: ctsm_n11_clm4_5_16_r249 +Tag name: unified_land_model_n11_clm4_5_16_r249 Originator(s): sacks Date: Sep 18, 2017 One-line Summary: Remove infiltration excess runoff for VIC @@ -56,7 +56,7 @@ CLM testing: ok means tests pass, Vic tests change answers as expected -CLM tag used for the baseline comparisons: ctsm_n10_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n10_clm4_5_16_r249 Answer changes @@ -99,7 +99,7 @@ M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 =============================================================== =============================================================== -Tag name: ctsm_n10_clm4_5_16_r249 +Tag name: unified_land_model_n10_clm4_5_16_r249 Originator(s): sacks Date: Sep 14, 2017 One-line Summary: Truncate small h2osfc values to zero @@ -154,7 +154,7 @@ CLM testing: ok means tests pass, change answers as expected -CLM tag used for the baseline comparisons: ctsm_n09_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n09_clm4_5_16_r249 Answer changes @@ -218,7 +218,7 @@ M components/clm/cime_config/testdefs/testlist_clm.xml =============================================================== =============================================================== -Tag name: ctsm_n09_clm4_5_16_r249 +Tag name: unified_land_model_n09_clm4_5_16_r249 Originator(s): sacks Date: Sep 7, 2017 One-line Summary: Use full qflx_surf in BGC code @@ -264,7 +264,7 @@ CLM testing: ok means tests pass, answers change as expected -CLM tag used for the baseline comparisons: ctsm_n08_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n08_clm4_5_16_r249 Answer changes @@ -311,7 +311,7 @@ M components/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 =============================================================== =============================================================== -Tag name: ctsm_n08_clm4_5_16_r249 +Tag name: unified_land_model_n08_clm4_5_16_r249 Originator(s): sacks Date: Aug 24, 2017 One-line Summary: Finish Infiltration modularization - mainly h2osfc updates @@ -358,7 +358,7 @@ CLM testing: hobart_pgi - pass hobart_intel - pass -CLM tag used for the baseline comparisons: ctsm_n07_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n07_clm4_5_16_r249 Answer changes @@ -391,7 +391,7 @@ M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 =============================================================== =============================================================== -Tag name: ctsm_n07_clm4_5_16_r249 +Tag name: unified_land_model_n07_clm4_5_16_r249 Originator(s): sacks Date: Aug 22, 2017 One-line Summary: Rename things related to saturated surface runoff @@ -442,7 +442,7 @@ CLM testing: hobart_pgi - pass hobart_intel - pass -CLM tag used for the baseline comparisons: ctsm_n06_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n06_clm4_5_16_r249 Answer changes @@ -487,7 +487,7 @@ M components/clm/cime_config/testdefs/testlist_clm.xml =============================================================== =============================================================== -Tag name: ctsm_n06_clm4_5_16_r249 +Tag name: unified_land_model_n06_clm4_5_16_r249 Originator(s): sacks Date: Aug 21, 2017 One-line Summary: Modularization of Infiltration - first stage @@ -548,7 +548,7 @@ CLM testing: SMS_D_Ld1_P24x1.f10_f10_musgs.I2000Clm45BgcCrop.hobart_nag.clm-oldhyd -CLM tag used for the baseline comparisons: ctsm_n05_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n05_clm4_5_16_r249 Answer changes @@ -585,7 +585,7 @@ M components/clm/src/biogeophys/SurfRunoffSatMod.F90 =============================================================== =============================================================== -Tag name: ctsm_n05_clm4_5_16_r249 +Tag name: unified_land_model_n05_clm4_5_16_r249 Originator(s): sacks Date: Aug 17, 2017 One-line Summary: Re-parenthesize a VIC equation @@ -642,7 +642,7 @@ CLM testing: ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_intel.clm-vrtlay SMS_Ld1.f19_g17.I2000Clm50Vic.cheyenne_intel.clm-default -CLM tag used for the baseline comparisons: ctsm_n04_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n04_clm4_5_16_r249 Answer changes @@ -684,12 +684,12 @@ M components/clm/src/biogeophys/SoilHydrologyMod.F90 =============================================================== =============================================================== -Tag name: ctsm_n04_clm4_5_16_r249 +Tag name: unified_land_model_n04_clm4_5_16_r249 Originator(s): sacks Date: July 14, 2017 One-line Summary: Extract SurfaceRunoff to its own module and related modularization -Up-to-date with branch tag: modularize_surface_runoff_n02_ctsm_n02_clm4_5_16_r249 +Up-to-date with branch tag: modularize_surface_runoff_n02_unified_land_model_n02_clm4_5_16_r249 Purpose of changes ------------------ @@ -734,7 +734,7 @@ CLM testing: hobart_pgi - pass hobart_intel - pass -CLM tag used for the baseline comparisons: ctsm_n03_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n03_clm4_5_16_r249 Answer changes -------------- @@ -771,12 +771,12 @@ M components/clm/src/main/clm_driver.F90 =============================================================== =============================================================== -Tag name: ctsm_n03_clm4_5_16_r249 +Tag name: unified_land_model_n03_clm4_5_16_r249 Originator(s): sacks Date: July 13, 2017 One-line Summary: Separate qflx_surf updates into two steps -Up-to-date with branch tag: modularize_surface_runoff_n01_ctsm_n02_clm4_5_16_r249 +Up-to-date with branch tag: modularize_surface_runoff_n01_unified_land_model_n02_clm4_5_16_r249 Purpose of changes ------------------ @@ -819,7 +819,7 @@ CLM testing: ok means tests pass, answers change as expected -CLM tag used for the baseline comparisons: ctsm_n02_clm4_5_16_r249 +CLM tag used for the baseline comparisons: unified_land_model_n02_clm4_5_16_r249 Answer changes @@ -884,7 +884,7 @@ M components/clm/src/cpl/lnd_import_export.F90 =============================================================== =============================================================== -Tag name: ctsm_n02_clm4_5_16_r249 +Tag name: unified_land_model_n02_clm4_5_16_r249 Originator(s): sacks Date: July 11, 2017 One-line Summary: BFB refactorings towards modularization of SurfaceRunoff @@ -928,7 +928,7 @@ CLM testing: hobart_pgi - pass hobart_intel - pass -CLM tag used for the baseline comparisons: ctsm_n01_clm4_5_16_r249 for VIC +CLM tag used for the baseline comparisons: unified_land_model_n01_clm4_5_16_r249 for VIC tests, clm4_5_16_r249 for non-VIC tests @@ -959,7 +959,7 @@ M components/clm/src/biogeophys/LakeHydrologyMod.F90 =============================================================== =============================================================== -Tag name: ctsm_n01_clm4_5_16_r249 +Tag name: unified_land_model_n01_clm4_5_16_r249 Originator(s): sacks Date: July 7, 2017 One-line Summary: If using VIC, don't use the TOPModel formulation for SurfaceRunoff ever @@ -1068,7 +1068,7 @@ M components/clm/src/biogeophys/SoilHydrologyMod.F90 =============================================================== =============================================================== -Tag name: ctsm_n00_clm4_5_16_r249 +Tag name: unified_land_model_n00_clm4_5_16_r249 Originator(s): sacks Date: July 7, 2017 One-line Summary: Baseline tag corresponding to clm4_5_16_r249 From 3f9624becce37d93e72c34c75d2390743b1cba82 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 28 Dec 2017 13:56:24 -0700 Subject: [PATCH 050/144] ChangeLog entry for n12 tag --- ChangeLog_branch | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ChangeLog_branch b/ChangeLog_branch index b4a3900f61..94979448da 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,4 +1,41 @@ =============================================================== +Tag name: unified_land_model_n12_clm4_5_16_r249 +Originator(s): sacks +Date: Dec 28, 2017 +One-line Summary: Edit old ChangeLog entries + +Purpose of changes +------------------ + +Change ctsm_* to unified_land_model_* in tag names in ChangeLog + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +CLM testing: NONE + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +M ChangeLog_branch + +=============================================================== +=============================================================== Tag name: unified_land_model_n11_clm4_5_16_r249 Originator(s): sacks Date: Sep 18, 2017 From 2fc1f9a7b38ce6a55bb0706814f0cd601a4de5f6 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 4 Jan 2018 09:16:29 -0700 Subject: [PATCH 051/144] Give the SHA-1 corresponding to each tag I'm going to remove those tags to clean up the tag list in the ctsm repository. So moving forward, we can refer to the "tags" via their SHA-1s. --- ChangeLog_branch | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog_branch b/ChangeLog_branch index 94979448da..c2a74feb63 100644 --- a/ChangeLog_branch +++ b/ChangeLog_branch @@ -1,5 +1,5 @@ =============================================================== -Tag name: unified_land_model_n12_clm4_5_16_r249 +Tag name: unified_land_model_n12_clm4_5_16_r249 (3f9624be) Originator(s): sacks Date: Dec 28, 2017 One-line Summary: Edit old ChangeLog entries @@ -36,7 +36,7 @@ M ChangeLog_branch =============================================================== =============================================================== -Tag name: unified_land_model_n11_clm4_5_16_r249 +Tag name: unified_land_model_n11_clm4_5_16_r249 (6057e1cd) Originator(s): sacks Date: Sep 18, 2017 One-line Summary: Remove infiltration excess runoff for VIC @@ -136,7 +136,7 @@ M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n10_clm4_5_16_r249 +Tag name: unified_land_model_n10_clm4_5_16_r249 (02e535c6) Originator(s): sacks Date: Sep 14, 2017 One-line Summary: Truncate small h2osfc values to zero @@ -255,7 +255,7 @@ M components/clm/cime_config/testdefs/testlist_clm.xml =============================================================== =============================================================== -Tag name: unified_land_model_n09_clm4_5_16_r249 +Tag name: unified_land_model_n09_clm4_5_16_r249 (92edec11) Originator(s): sacks Date: Sep 7, 2017 One-line Summary: Use full qflx_surf in BGC code @@ -348,7 +348,7 @@ M components/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n08_clm4_5_16_r249 +Tag name: unified_land_model_n08_clm4_5_16_r249 (72070e76) Originator(s): sacks Date: Aug 24, 2017 One-line Summary: Finish Infiltration modularization - mainly h2osfc updates @@ -428,7 +428,7 @@ M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n07_clm4_5_16_r249 +Tag name: unified_land_model_n07_clm4_5_16_r249 (1479a4c7) Originator(s): sacks Date: Aug 22, 2017 One-line Summary: Rename things related to saturated surface runoff @@ -524,7 +524,7 @@ M components/clm/cime_config/testdefs/testlist_clm.xml =============================================================== =============================================================== -Tag name: unified_land_model_n06_clm4_5_16_r249 +Tag name: unified_land_model_n06_clm4_5_16_r249 (7e1bcd5c) Originator(s): sacks Date: Aug 21, 2017 One-line Summary: Modularization of Infiltration - first stage @@ -622,7 +622,7 @@ M components/clm/src/biogeophys/SurfRunoffSatMod.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n05_clm4_5_16_r249 +Tag name: unified_land_model_n05_clm4_5_16_r249 (7b26ad55) Originator(s): sacks Date: Aug 17, 2017 One-line Summary: Re-parenthesize a VIC equation @@ -721,7 +721,7 @@ M components/clm/src/biogeophys/SoilHydrologyMod.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n04_clm4_5_16_r249 +Tag name: unified_land_model_n04_clm4_5_16_r249 (46e33419) Originator(s): sacks Date: July 14, 2017 One-line Summary: Extract SurfaceRunoff to its own module and related modularization @@ -808,7 +808,7 @@ M components/clm/src/main/clm_driver.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n03_clm4_5_16_r249 +Tag name: unified_land_model_n03_clm4_5_16_r249 (0252134a) Originator(s): sacks Date: July 13, 2017 One-line Summary: Separate qflx_surf updates into two steps @@ -921,7 +921,7 @@ M components/clm/src/cpl/lnd_import_export.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n02_clm4_5_16_r249 +Tag name: unified_land_model_n02_clm4_5_16_r249 (b6191a1f) Originator(s): sacks Date: July 11, 2017 One-line Summary: BFB refactorings towards modularization of SurfaceRunoff @@ -996,7 +996,7 @@ M components/clm/src/biogeophys/LakeHydrologyMod.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n01_clm4_5_16_r249 +Tag name: unified_land_model_n01_clm4_5_16_r249 (dfd3094c) Originator(s): sacks Date: July 7, 2017 One-line Summary: If using VIC, don't use the TOPModel formulation for SurfaceRunoff ever @@ -1105,7 +1105,7 @@ M components/clm/src/biogeophys/SoilHydrologyMod.F90 =============================================================== =============================================================== -Tag name: unified_land_model_n00_clm4_5_16_r249 +Tag name: unified_land_model_n00_clm4_5_16_r249 (3889c97c) Originator(s): sacks Date: July 7, 2017 One-line Summary: Baseline tag corresponding to clm4_5_16_r249 From 7dcf610b16b66e02b28882d8b40dfde095ba0fa2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 15 Feb 2018 17:18:40 -0700 Subject: [PATCH 052/144] Move radtemp branch over to git --- src/biogeophys/CanopyFluxesMod.F90 | 11 +++ src/biogeophys/LakeFluxesMod.F90 | 7 +- src/biogeophys/PhotosynthesisMod.F90 | 98 +++++++++++++++++++- src/biogeophys/SoilFluxesMod.F90 | 134 ++++++++++++++++++++++++++- src/biogeophys/TemperatureType.F90 | 23 +++++ src/main/clm_driver.F90 | 12 ++- 6 files changed, 276 insertions(+), 9 deletions(-) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 7c9feb8a25..f9a02366ee 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -452,6 +452,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) t_ref2m_r => temperature_inst%t_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface air temperature (Kelvin) +!ABT + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) +!ABT frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of surface water fwet => waterstate_inst%fwet_patch , & ! Input: [real(r8) (:) ] fraction of canopy that is wet (0 to 1) @@ -1235,6 +1238,14 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb*tlbef(p)**3*(tlbef(p) + & 4._r8*dt_veg(p)) + emg(c)*(1._r8-emv(p))*sb*lw_grnd) +!ABT + ! Calculate the skin temperature as a weighted sum of all the ground and vegetated fraction + ! The weight is the so-called vegetation emissivity, but not that emv is actually an attentuation + ! function that goes to zero as LAI (ELAI + ESAI) go to zero. + + t_skin_patch(p) = emv(p)*t_veg(p) + (1._r8 - emv(p))*sqrt(sqrt(lw_grnd)) +!ABT + ! Derivative of soil energy flux with respect to soil temperature cgrnds(p) = cgrnds(p) + cpair*forc_rho(c)*wtg(p)*wtal(p) diff --git a/src/biogeophys/LakeFluxesMod.F90 b/src/biogeophys/LakeFluxesMod.F90 index 2bebd00b68..2e6f7da25f 100644 --- a/src/biogeophys/LakeFluxesMod.F90 +++ b/src/biogeophys/LakeFluxesMod.F90 @@ -182,6 +182,9 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) +!ABT + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) +!ABT t_lake => temperature_inst%t_lake_col , & ! Input: [real(r8) (:,:) ] lake temperature (Kelvin) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil (or snow) temperature (Kelvin) @@ -657,7 +660,9 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, t_veg(p) = forc_t(c) eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) qflx_prec_grnd(p) = forc_rain(c) + forc_snow(c) - +!ABT + t_skin_patch(p) = t_veg(p) +!ABT end do end associate diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 8b6e708606..9edbb4477b 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -107,7 +107,10 @@ module PhotosynthesisMod real(r8), pointer, private :: tpu_z_phs_patch (:,:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s) real(r8), pointer, private :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s) real(r8), pointer, private :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s) - +!KO + real(r8), pointer, private :: gs_mol_sun_ln_patch (:,:) ! patch sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + real(r8), pointer, private :: gs_mol_sha_ln_patch (:,:) ! patch shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) +!KO real(r8), pointer, private :: ac_patch (:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: aj_patch (:,:) ! patch RuBP-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: ap_patch (:,:) ! patch product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) @@ -250,6 +253,10 @@ subroutine InitAllocate(this, bounds) allocate(this%kp_z_phs_patch (begp:endp,2,1:nlevcan)) ; this%kp_z_phs_patch (:,:,:) = nan allocate(this%gs_mol_sun_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_patch (:,:) = nan allocate(this%gs_mol_sha_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_patch (:,:) = nan +!KO + allocate(this%gs_mol_sun_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_ln_patch (:,:) = nan + allocate(this%gs_mol_sha_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_ln_patch (:,:) = nan +!KO allocate(this%ac_patch (begp:endp,1:nlevcan)) ; this%ac_patch (:,:) = nan allocate(this%aj_patch (begp:endp,1:nlevcan)) ; this%aj_patch (:,:) = nan allocate(this%ap_patch (begp:endp,1:nlevcan)) ; this%ap_patch (:,:) = nan @@ -485,7 +492,30 @@ subroutine InitHistory(this, bounds) ptr_patch=ptr_1d) endif +!KO + this%gs_mol_sun_ln_patch(begp:endp,:) = spval + this%gs_mol_sha_ln_patch(begp:endp,:) = spval + if (nlevcan>1) then + call hist_addfld2d (fname='GSSUNLN', units='umol H20/m2/s', type2d='nlevcan', & + avgflag='A', long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + ptr_patch=this%gs_mol_sun_ln_patch, set_lake=spval, set_urb=spval) + + call hist_addfld2d (fname='GSSHALN', units='umol H20/m2/s', type2d='nlevcan', & + avgflag='A', long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + ptr_patch=this%gs_mol_sha_ln_patch, set_lake=spval, set_urb=spval) + else + ptr_1d => this%gs_mol_sun_ln_patch(begp:endp,1) + call hist_addfld1d (fname='GSSUNLN', units='umol H20/m2/s', & + avgflag='A', long_name='sunlit leaf stomatal conductance at local noon', & + ptr_patch=ptr_1d) + + ptr_1d => this%gs_mol_sha_ln_patch(begp:endp,1) + call hist_addfld1d (fname='GSSHALN', units='umol H20/m2/s', & + avgflag='A', long_name='shaded leaf stomatal conductance at local noon', & + ptr_patch=ptr_1d) + endif +!KO if(use_luna)then if(nlevcan>1)then call hist_addfld2d (fname='Vcmx25Z', units='umol/m2/s', type2d='nlevcan', & @@ -770,6 +800,20 @@ subroutine Restart(this, bounds, ncid, flag) dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='shaded leaf stomatal conductance', units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_patch) + +!KO + call restartvar(ncid=ncid, flag=flag, varname='GSSUNLN', xtype=ncd_double, & + dim1name='pft', dim2name='levcan', & + long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + units='umol H20/m2/s', & + interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sun_ln_patch) + + call restartvar(ncid=ncid, flag=flag, varname='GSSHALN', xtype=ncd_double, & + dim1name='pft', dim2name='levcan', & + long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + units='umol H20/m2/s', & + interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_ln_patch) +!KO call restartvar(ncid=ncid, flag=flag, varname='lnca', xtype=ncd_double, & dim1name='pft', long_name='leaf N concentration', units='gN leaf/m^2', & @@ -2368,7 +2412,12 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! method ! ! !USES: - use clm_varcon , only : rgas, tfrz, rpi +!KO use clm_varcon , only : rgas, tfrz, rpi +!KO + use clm_varcon , only : rgas, tfrz, rpi, spval, degpsec, isecspday + use GridcellType , only : grc + use clm_time_manager , only : get_curr_date, get_step_size +!KO use clm_varctl , only : cnallocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use clm_varpar , only : nlevsoi @@ -2558,8 +2607,16 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8) :: sum_nscaler real(r8) :: total_lai integer :: nptreemax +!KO + integer :: local_secp1 ! seconds into current date in local time + real(r8) :: dtime ! land model time step (sec) + integer :: year,month,day,secs ! calendar info for current time step +!KO !scs - integer :: j ! index +!KO integer :: j ! index +!KO + integer :: j,g ! index +!KO real(r8) :: rs_resis ! combined soil-root resistance [s] real(r8) :: r_soil ! root spacing [m] real(r8) :: root_biomass_density ! root biomass density [g/m3] @@ -2578,6 +2635,9 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8), parameter :: croot_lateral_length = 0.25_r8 ! specified lateral coarse root length [m] real(r8), parameter :: c_to_b = 2.0_r8 !(g biomass /g C) !Note that root density is for dry biomass not carbon. CLM provides root biomass as carbon. The conversion is 0.5 g C / g biomass +!KO + integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon +!KO !------------------------------------------------------------------------------ @@ -2670,7 +2730,11 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & an_sun => photosyns_inst%an_sun_patch , & ! Output: [real(r8) (:,:) ] net sunlit leaf photosynthesis (umol CO2/m**2/s) an_sha => photosyns_inst%an_sha_patch , & ! Output: [real(r8) (:,:) ] net shaded leaf photosynthesis (umol CO2/m**2/s) gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance (umol H2O/m**2/s) - gs_mol_sha => photosyns_inst%gs_mol_sha_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) + gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) +!KO + gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) +!KO ) par_z_sun => solarabs_inst%parsun_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) @@ -2710,6 +2774,13 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 !==============================================================================! +!KO + ! Determine seconds off current time step + + dtime = get_step_size() + call get_curr_date (year, month, day, secs) +!KO + ! vcmax25 parameters, from CN fnr = 7.16_r8 @@ -3146,6 +3217,9 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & do f = 1, fn p = filterp(f) c = patch%column(p) +!KO + g = patch%gridcell(p) +!KO ! Leaf boundary layer conductance, umol/m**2/s @@ -3278,6 +3352,22 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & if (an_sun(p,iv) < 0._r8) gs_mol_sun(p,iv) = max( bsun(p)*gsminsun, 1._r8 ) if (an_sha(p,iv) < 0._r8) gs_mol_sha(p,iv) = max( bsha(p)*gsminsha, 1._r8 ) +!KO + ! Get local noon sunlit and shaded stomatal conductance + local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime + local_secp1 = mod(local_secp1,isecspday) +!KO if (local_secp1 == isecspday/2) then +!KO + ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) + if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then +!KO + gs_mol_sun_ln(p,iv) = gs_mol_sun(p,iv) + gs_mol_sha_ln(p,iv) = gs_mol_sha(p,iv) + else + gs_mol_sun_ln(p,iv) = spval + gs_mol_sha_ln(p,iv) = spval + end if +!KO ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 index 81d05478e8..79f8740c3e 100644 --- a/src/biogeophys/SoilFluxesMod.F90 +++ b/src/biogeophys/SoilFluxesMod.F90 @@ -22,6 +22,9 @@ module SoilFluxesMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch +!KO + use UrbanParamsType , only : urbanparams_type +!KO ! ! !PUBLIC TYPES: implicit none @@ -34,10 +37,18 @@ module SoilFluxesMod contains !----------------------------------------------------------------------- +!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & +!KO num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & +!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & +!KO waterstate_inst, energyflux_inst, waterflux_inst) +!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & + num_urbanc, filter_urbanc, & + num_urbanp, filter_urbanp, & num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & - waterstate_inst, energyflux_inst, waterflux_inst) + waterstate_inst, energyflux_inst, waterflux_inst, urbanparams_inst) +!KO ! ! !DESCRIPTION: ! Update surface fluxes based on the new ground temperature @@ -46,8 +57,15 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & use clm_time_manager , only : get_step_size use clm_varcon , only : hvap, cpair, grav, vkc, tfrz, sb use landunit_varcon , only : istsoil, istcrop - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv +!KO use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv +!KO + use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv +!KO use subgridAveMod , only : p2c +!KO + use clm_varcon , only : sb + use subgridAveMod , only : p2l +!KO ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -55,6 +73,12 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_urbanl ! number of urban landunits in clump integer , intent(in) :: filter_urbanl(:) ! urban landunit filter +!KO + integer , intent(in) :: num_urbanc ! number of urban columns in clump + integer , intent(in) :: filter_urbanc(:) ! urban column filter + integer , intent(in) :: num_urbanp ! number of urban pfts in clump + integer , intent(in) :: filter_urbanp(:) ! urban pft filter +!KO integer , intent(in) :: num_nolakep ! number of column non-lake points in pft filter integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points type(atm2lnd_type) , intent(in) :: atm2lnd_inst @@ -62,12 +86,18 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & type(temperature_type) , intent(in) :: temperature_inst type(canopystate_type) , intent(in) :: canopystate_inst type(waterstate_type) , intent(in) :: waterstate_inst +!KO + type(urbanparams_type) , intent(in) :: urbanparams_inst +!KO type(waterflux_type) , intent(inout) :: waterflux_inst type(energyflux_type) , intent(inout) :: energyflux_inst ! ! !LOCAL VARIABLES: integer :: p,c,g,j,pi,l ! indices - integer :: fc,fp ! lake filtered column and pft indices +!KO integer :: fc,fp ! lake filtered column and pft indices +!KO + integer :: fc,fp,fl ! lake filtered column and pft indices +!KO real(r8) :: dtime ! land model time step (sec) real(r8) :: egsmax(bounds%begc:bounds%endc) ! max. evaporation which soil can provide at one time step real(r8) :: egirat(bounds%begc:bounds%endc) ! ratio of topsoil_evap_tot : egsmax @@ -80,6 +110,17 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & real(r8) :: t_grnd0(bounds%begc:bounds%endc) ! t_grnd of previous time step real(r8) :: lw_grnd real(r8) :: fsno_eff +!KO + real(r8) :: eflx_lwrad_out_lun(bounds%begl:bounds%endl) ! emitted infrared (longwave) radiation (W/m**2) + real(r8) :: emg_roof(bounds%begl:bounds%endl) ! roof emissivity + real(r8) :: emg_sunwall(bounds%begl:bounds%endl) ! sunwall emissivity + real(r8) :: emg_shadewall(bounds%begl:bounds%endl) ! shadewall emissivity + real(r8) :: emg_road_perv(bounds%begl:bounds%endl) ! pervious road emissivity + real(r8) :: emg_road_imperv(bounds%begl:bounds%endl) ! impervious road emissivity + real(r8) :: emg_road ! road emissivity + real(r8) :: emg_canyon ! canyon emissivity + real(r8) :: emg_urban ! effective urban emissivity +!KO !----------------------------------------------------------------------- associate( & @@ -97,6 +138,19 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] ground emissivity +!ABT +! emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity +! t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) +!ABT +!KO + t_skin_lun => temperature_inst%t_skin_lun , & ! Output: [real(r8) (:) ] landunit skin temperature (K) + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) + vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road + vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall + wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road + wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:) ] weight of roof with respect to landunit + canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street hwidth (-) +!KO t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] soil/snow temperature before update t_h2osfc_bef => temperature_inst%t_h2osfc_bef_col , & ! Input: [real(r8) (:) ] saved surface water temperature @@ -403,6 +457,19 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & + (1-frac_veg_nosno(p))*emg(c)*sb*lw_grnd & + 4._r8*emg(c)*sb*t_grnd0(c)**3*tinc(c) + +!ABT + ! Calculate the skin temperature as a weighted sum of all the surface contributions (surface water table, snow, etc...) + ! Note: This is the bare ground calculation of skin temperature + ! The Urban and Vegetation are done in other place. Urban=Later in this function Veg=CanopyFluxMod +! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + emv(p)*t_veg(p) +! if( frac_veg_nosno(p).eq.0 ) then +! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + & +! emv(p) * frac_veg_nosno(p) * t_veg(p) +! end if + if(frac_veg_nosno(p).eq.0) t_skin_patch(p) = sqrt(sqrt(lw_grnd)) +!ABT + eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then eflx_lwrad_net_r(p) = eflx_lwrad_out(p) - forc_lwrad(c) @@ -423,6 +490,67 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & errsoi_patch(bounds%begp:bounds%endp), & errsoi_col(bounds%begc:bounds%endc)) +!KO + ! Calculate urban skin temperature. Must be done here instead of in + ! UrbanFluxes because eflx_lwrad_out has been updated above. This section + ! of code could be placed in a subroutine that could be called here or + ! called from within clm_driver after the call to SoilFluxes. +!KO + ! Assign urban surface emissivities + + do fc = 1,num_urbanc + c = filter_urbanc(fc) + l = col%landunit(c) + + if (col%itype(c) == icol_roof ) then + emg_roof(l) = emg(c) + else if (col%itype(c) == icol_sunwall ) then + emg_sunwall(l) = emg(c) + else if (col%itype(c) == icol_shadewall) then + emg_shadewall(l) = emg(c) + else if (col%itype(c) == icol_road_perv) then + emg_road_perv(l) = emg(c) + else if (col%itype(c) == icol_road_imperv) then + emg_road_imperv(l) = emg(c) + end if + + end do + + ! Update landunit level upward longwave radiation + + call p2l(bounds, & + eflx_lwrad_out(bounds%begp:bounds%endp), & + eflx_lwrad_out_lun(bounds%begl:bounds%endl), & + p2c_scale_type = 'unity', c2l_scale_type = 'urbanf') + + ! Calculate urban effective emissivity and skin temperature + + do fl = 1, num_urbanl + l = filter_urbanl(fl) + + + emg_road = emg_road_perv(l)*wtroad_perv(l) + emg_road_imperv(l)*(1._r8-wtroad_perv(l)) + + ! The expression for vf_sw is for per unit wall area + ! So multiply it by canyon_hwr to convert to per unit ground area + ! Then the following should equal one: 2*canyon_hwr*vf_sw + vf_sr + emg_canyon = emg_road*vf_sr(l) + emg_sunwall(l)*vf_sw(l)*canyon_hwr(l) + emg_shadewall(l)*vf_sw(l)*canyon_hwr(l) + + emg_urban = emg_roof(l)*wtlunit_roof(l) + emg_canyon*(1._r8-wtlunit_roof(l)) + t_skin_lun(l) = sqrt(sqrt(eflx_lwrad_out_lun(l)/(sb*emg_urban))) + + end do + + ! Assign landunit-level t_skin to each urban pft + do fp = 1, num_urbanp + p = filter_urbanp(fp) + l = patch%landunit(p) + + t_skin_patch(p) = t_skin_lun(l) + + end do +!KO + call t_stopf('bgp2_loop_4') end associate diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index a797159829..9896a005ca 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -23,6 +23,9 @@ module TemperatureType ! Temperatures real(r8), pointer :: t_veg_patch (:) ! patch vegetation temperature (Kelvin) +!KO + real(r8), pointer :: t_skin_patch (:) ! patch skin temperature (Kelvin) +!KO real(r8), pointer :: t_veg_day_patch (:) ! patch daytime accumulative vegetation temperature (Kelvinx*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg_night_patch (:) ! patch night-time accumulative vegetation temperature (Kelvin*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg10_day_patch (:) ! 10 day running mean of patch daytime time vegetation temperature (Kelvin), LUNA specific, but can be reused @@ -44,6 +47,9 @@ module TemperatureType real(r8), pointer :: t_sunw_inner_lun (:) ! lun sunwall inside surface temperature (K) real(r8), pointer :: t_shdw_inner_lun (:) ! lun shadewall inside surface temperature (K) real(r8), pointer :: t_floor_lun (:) ! lun floor temperature (K) +!KO + real(r8), pointer :: t_skin_lun (:) ! lun skin temperature (K) +!KO real(r8), pointer :: snot_top_col (:) ! col temperature of top snow layer [K] real(r8), pointer :: dTdz_top_col (:) ! col temperature gradient in top layer [K m-1] real(r8), pointer :: dt_veg_patch (:) ! patch change in t_veg, last iteration (Kelvin) @@ -186,6 +192,9 @@ subroutine InitAllocate(this, bounds) ! Temperatures allocate(this%t_veg_patch (begp:endp)) ; this%t_veg_patch (:) = nan +!KO + allocate(this%t_skin_patch (begp:endp)) ; this%t_skin_patch (:) = nan +!KO if(use_luna) then allocate(this%t_veg_day_patch (begp:endp)) ; this%t_veg_day_patch (:) = spval allocate(this%t_veg_night_patch (begp:endp)) ; this%t_veg_night_patch (:) = spval @@ -207,6 +216,9 @@ subroutine InitAllocate(this, bounds) allocate(this%t_sunw_inner_lun (begl:endl)) ; this%t_sunw_inner_lun (:) = nan allocate(this%t_shdw_inner_lun (begl:endl)) ; this%t_shdw_inner_lun (:) = nan allocate(this%t_floor_lun (begl:endl)) ; this%t_floor_lun (:) = nan +!KO + allocate(this%t_skin_lun (begl:endl)) ; this%t_skin_lun (:) = nan +!KO allocate(this%snot_top_col (begc:endc)) ; this%snot_top_col (:) = nan allocate(this%dTdz_top_col (begc:endc)) ; this%dTdz_top_col (:) = nan allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan @@ -381,6 +393,17 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='vegetation temperature', & ptr_patch=this%t_veg_patch) +!KO + this%t_skin_patch(begp:endp) = spval + call hist_addfld1d(fname='TSKIN', units='K', & + avgflag='A', long_name='skin temperature', & + ptr_patch=this%t_skin_patch, c2l_scale_type='urbans') +! this%t_skin_lun(begl:endl) = spval +! call hist_addfld1d(fname='TSKIN', units='K', & +! avgflag='A', long_name='skin temperature', & +! ptr_lun=this%t_skin_patch, set_nourb=spval, l2g_scale_type='unity') +!KO + this%t_grnd_col(begc:endc) = spval call hist_addfld1d (fname='TG', units='K', & avgflag='A', long_name='ground temperature', & diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 9cbbe51f25..b481b60178 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -660,12 +660,22 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! ============================================================================ call t_startf('bgp2') +!KO call SoilFluxes(bounds_clump, & +!KO filter(nc)%num_urbanl, filter(nc)%urbanl, & +!KO filter(nc)%num_nolakec, filter(nc)%nolakec, & +!KO filter(nc)%num_nolakep, filter(nc)%nolakep, & +!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & +!KO energyflux_inst, waterflux_inst) +!KO call SoilFluxes(bounds_clump, & filter(nc)%num_urbanl, filter(nc)%urbanl, & + filter(nc)%num_urbanc, filter(nc)%urbanc, & + filter(nc)%num_urbanp, filter(nc)%urbanp, & filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_nolakep, filter(nc)%nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & - energyflux_inst, waterflux_inst) + energyflux_inst, waterflux_inst, urbanparams_inst) +!KO call t_stopf('bgp2') ! ============================================================================ From fbb097408bd54206d60a7b8d5807450253a8e344 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 15 Feb 2018 17:18:40 -0700 Subject: [PATCH 053/144] Move radtemp branch over to git --- src/biogeophys/CanopyFluxesMod.F90 | 11 +++ src/biogeophys/LakeFluxesMod.F90 | 7 +- src/biogeophys/PhotosynthesisMod.F90 | 98 +++++++++++++++++++- src/biogeophys/SoilFluxesMod.F90 | 134 ++++++++++++++++++++++++++- src/biogeophys/TemperatureType.F90 | 23 +++++ src/main/clm_driver.F90 | 12 ++- 6 files changed, 276 insertions(+), 9 deletions(-) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 7c9feb8a25..f9a02366ee 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -452,6 +452,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) t_ref2m_r => temperature_inst%t_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface air temperature (Kelvin) +!ABT + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) +!ABT frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of surface water fwet => waterstate_inst%fwet_patch , & ! Input: [real(r8) (:) ] fraction of canopy that is wet (0 to 1) @@ -1235,6 +1238,14 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb*tlbef(p)**3*(tlbef(p) + & 4._r8*dt_veg(p)) + emg(c)*(1._r8-emv(p))*sb*lw_grnd) +!ABT + ! Calculate the skin temperature as a weighted sum of all the ground and vegetated fraction + ! The weight is the so-called vegetation emissivity, but not that emv is actually an attentuation + ! function that goes to zero as LAI (ELAI + ESAI) go to zero. + + t_skin_patch(p) = emv(p)*t_veg(p) + (1._r8 - emv(p))*sqrt(sqrt(lw_grnd)) +!ABT + ! Derivative of soil energy flux with respect to soil temperature cgrnds(p) = cgrnds(p) + cpair*forc_rho(c)*wtg(p)*wtal(p) diff --git a/src/biogeophys/LakeFluxesMod.F90 b/src/biogeophys/LakeFluxesMod.F90 index 2bebd00b68..2e6f7da25f 100644 --- a/src/biogeophys/LakeFluxesMod.F90 +++ b/src/biogeophys/LakeFluxesMod.F90 @@ -182,6 +182,9 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) +!ABT + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) +!ABT t_lake => temperature_inst%t_lake_col , & ! Input: [real(r8) (:,:) ] lake temperature (Kelvin) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil (or snow) temperature (Kelvin) @@ -657,7 +660,9 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, t_veg(p) = forc_t(c) eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) qflx_prec_grnd(p) = forc_rain(c) + forc_snow(c) - +!ABT + t_skin_patch(p) = t_veg(p) +!ABT end do end associate diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 8b6e708606..9edbb4477b 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -107,7 +107,10 @@ module PhotosynthesisMod real(r8), pointer, private :: tpu_z_phs_patch (:,:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s) real(r8), pointer, private :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s) real(r8), pointer, private :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s) - +!KO + real(r8), pointer, private :: gs_mol_sun_ln_patch (:,:) ! patch sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + real(r8), pointer, private :: gs_mol_sha_ln_patch (:,:) ! patch shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) +!KO real(r8), pointer, private :: ac_patch (:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: aj_patch (:,:) ! patch RuBP-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: ap_patch (:,:) ! patch product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) @@ -250,6 +253,10 @@ subroutine InitAllocate(this, bounds) allocate(this%kp_z_phs_patch (begp:endp,2,1:nlevcan)) ; this%kp_z_phs_patch (:,:,:) = nan allocate(this%gs_mol_sun_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_patch (:,:) = nan allocate(this%gs_mol_sha_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_patch (:,:) = nan +!KO + allocate(this%gs_mol_sun_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_ln_patch (:,:) = nan + allocate(this%gs_mol_sha_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_ln_patch (:,:) = nan +!KO allocate(this%ac_patch (begp:endp,1:nlevcan)) ; this%ac_patch (:,:) = nan allocate(this%aj_patch (begp:endp,1:nlevcan)) ; this%aj_patch (:,:) = nan allocate(this%ap_patch (begp:endp,1:nlevcan)) ; this%ap_patch (:,:) = nan @@ -485,7 +492,30 @@ subroutine InitHistory(this, bounds) ptr_patch=ptr_1d) endif +!KO + this%gs_mol_sun_ln_patch(begp:endp,:) = spval + this%gs_mol_sha_ln_patch(begp:endp,:) = spval + if (nlevcan>1) then + call hist_addfld2d (fname='GSSUNLN', units='umol H20/m2/s', type2d='nlevcan', & + avgflag='A', long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + ptr_patch=this%gs_mol_sun_ln_patch, set_lake=spval, set_urb=spval) + + call hist_addfld2d (fname='GSSHALN', units='umol H20/m2/s', type2d='nlevcan', & + avgflag='A', long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + ptr_patch=this%gs_mol_sha_ln_patch, set_lake=spval, set_urb=spval) + else + ptr_1d => this%gs_mol_sun_ln_patch(begp:endp,1) + call hist_addfld1d (fname='GSSUNLN', units='umol H20/m2/s', & + avgflag='A', long_name='sunlit leaf stomatal conductance at local noon', & + ptr_patch=ptr_1d) + + ptr_1d => this%gs_mol_sha_ln_patch(begp:endp,1) + call hist_addfld1d (fname='GSSHALN', units='umol H20/m2/s', & + avgflag='A', long_name='shaded leaf stomatal conductance at local noon', & + ptr_patch=ptr_1d) + endif +!KO if(use_luna)then if(nlevcan>1)then call hist_addfld2d (fname='Vcmx25Z', units='umol/m2/s', type2d='nlevcan', & @@ -770,6 +800,20 @@ subroutine Restart(this, bounds, ncid, flag) dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='shaded leaf stomatal conductance', units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_patch) + +!KO + call restartvar(ncid=ncid, flag=flag, varname='GSSUNLN', xtype=ncd_double, & + dim1name='pft', dim2name='levcan', & + long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + units='umol H20/m2/s', & + interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sun_ln_patch) + + call restartvar(ncid=ncid, flag=flag, varname='GSSHALN', xtype=ncd_double, & + dim1name='pft', dim2name='levcan', & + long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + units='umol H20/m2/s', & + interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_ln_patch) +!KO call restartvar(ncid=ncid, flag=flag, varname='lnca', xtype=ncd_double, & dim1name='pft', long_name='leaf N concentration', units='gN leaf/m^2', & @@ -2368,7 +2412,12 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! method ! ! !USES: - use clm_varcon , only : rgas, tfrz, rpi +!KO use clm_varcon , only : rgas, tfrz, rpi +!KO + use clm_varcon , only : rgas, tfrz, rpi, spval, degpsec, isecspday + use GridcellType , only : grc + use clm_time_manager , only : get_curr_date, get_step_size +!KO use clm_varctl , only : cnallocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use clm_varpar , only : nlevsoi @@ -2558,8 +2607,16 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8) :: sum_nscaler real(r8) :: total_lai integer :: nptreemax +!KO + integer :: local_secp1 ! seconds into current date in local time + real(r8) :: dtime ! land model time step (sec) + integer :: year,month,day,secs ! calendar info for current time step +!KO !scs - integer :: j ! index +!KO integer :: j ! index +!KO + integer :: j,g ! index +!KO real(r8) :: rs_resis ! combined soil-root resistance [s] real(r8) :: r_soil ! root spacing [m] real(r8) :: root_biomass_density ! root biomass density [g/m3] @@ -2578,6 +2635,9 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8), parameter :: croot_lateral_length = 0.25_r8 ! specified lateral coarse root length [m] real(r8), parameter :: c_to_b = 2.0_r8 !(g biomass /g C) !Note that root density is for dry biomass not carbon. CLM provides root biomass as carbon. The conversion is 0.5 g C / g biomass +!KO + integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon +!KO !------------------------------------------------------------------------------ @@ -2670,7 +2730,11 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & an_sun => photosyns_inst%an_sun_patch , & ! Output: [real(r8) (:,:) ] net sunlit leaf photosynthesis (umol CO2/m**2/s) an_sha => photosyns_inst%an_sha_patch , & ! Output: [real(r8) (:,:) ] net shaded leaf photosynthesis (umol CO2/m**2/s) gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance (umol H2O/m**2/s) - gs_mol_sha => photosyns_inst%gs_mol_sha_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) + gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) +!KO + gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) +!KO ) par_z_sun => solarabs_inst%parsun_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) @@ -2710,6 +2774,13 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 !==============================================================================! +!KO + ! Determine seconds off current time step + + dtime = get_step_size() + call get_curr_date (year, month, day, secs) +!KO + ! vcmax25 parameters, from CN fnr = 7.16_r8 @@ -3146,6 +3217,9 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & do f = 1, fn p = filterp(f) c = patch%column(p) +!KO + g = patch%gridcell(p) +!KO ! Leaf boundary layer conductance, umol/m**2/s @@ -3278,6 +3352,22 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & if (an_sun(p,iv) < 0._r8) gs_mol_sun(p,iv) = max( bsun(p)*gsminsun, 1._r8 ) if (an_sha(p,iv) < 0._r8) gs_mol_sha(p,iv) = max( bsha(p)*gsminsha, 1._r8 ) +!KO + ! Get local noon sunlit and shaded stomatal conductance + local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime + local_secp1 = mod(local_secp1,isecspday) +!KO if (local_secp1 == isecspday/2) then +!KO + ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) + if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then +!KO + gs_mol_sun_ln(p,iv) = gs_mol_sun(p,iv) + gs_mol_sha_ln(p,iv) = gs_mol_sha(p,iv) + else + gs_mol_sun_ln(p,iv) = spval + gs_mol_sha_ln(p,iv) = spval + end if +!KO ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 index 81d05478e8..79f8740c3e 100644 --- a/src/biogeophys/SoilFluxesMod.F90 +++ b/src/biogeophys/SoilFluxesMod.F90 @@ -22,6 +22,9 @@ module SoilFluxesMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch +!KO + use UrbanParamsType , only : urbanparams_type +!KO ! ! !PUBLIC TYPES: implicit none @@ -34,10 +37,18 @@ module SoilFluxesMod contains !----------------------------------------------------------------------- +!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & +!KO num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & +!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & +!KO waterstate_inst, energyflux_inst, waterflux_inst) +!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & + num_urbanc, filter_urbanc, & + num_urbanp, filter_urbanp, & num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & - waterstate_inst, energyflux_inst, waterflux_inst) + waterstate_inst, energyflux_inst, waterflux_inst, urbanparams_inst) +!KO ! ! !DESCRIPTION: ! Update surface fluxes based on the new ground temperature @@ -46,8 +57,15 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & use clm_time_manager , only : get_step_size use clm_varcon , only : hvap, cpair, grav, vkc, tfrz, sb use landunit_varcon , only : istsoil, istcrop - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv +!KO use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv +!KO + use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv +!KO use subgridAveMod , only : p2c +!KO + use clm_varcon , only : sb + use subgridAveMod , only : p2l +!KO ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -55,6 +73,12 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_urbanl ! number of urban landunits in clump integer , intent(in) :: filter_urbanl(:) ! urban landunit filter +!KO + integer , intent(in) :: num_urbanc ! number of urban columns in clump + integer , intent(in) :: filter_urbanc(:) ! urban column filter + integer , intent(in) :: num_urbanp ! number of urban pfts in clump + integer , intent(in) :: filter_urbanp(:) ! urban pft filter +!KO integer , intent(in) :: num_nolakep ! number of column non-lake points in pft filter integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points type(atm2lnd_type) , intent(in) :: atm2lnd_inst @@ -62,12 +86,18 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & type(temperature_type) , intent(in) :: temperature_inst type(canopystate_type) , intent(in) :: canopystate_inst type(waterstate_type) , intent(in) :: waterstate_inst +!KO + type(urbanparams_type) , intent(in) :: urbanparams_inst +!KO type(waterflux_type) , intent(inout) :: waterflux_inst type(energyflux_type) , intent(inout) :: energyflux_inst ! ! !LOCAL VARIABLES: integer :: p,c,g,j,pi,l ! indices - integer :: fc,fp ! lake filtered column and pft indices +!KO integer :: fc,fp ! lake filtered column and pft indices +!KO + integer :: fc,fp,fl ! lake filtered column and pft indices +!KO real(r8) :: dtime ! land model time step (sec) real(r8) :: egsmax(bounds%begc:bounds%endc) ! max. evaporation which soil can provide at one time step real(r8) :: egirat(bounds%begc:bounds%endc) ! ratio of topsoil_evap_tot : egsmax @@ -80,6 +110,17 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & real(r8) :: t_grnd0(bounds%begc:bounds%endc) ! t_grnd of previous time step real(r8) :: lw_grnd real(r8) :: fsno_eff +!KO + real(r8) :: eflx_lwrad_out_lun(bounds%begl:bounds%endl) ! emitted infrared (longwave) radiation (W/m**2) + real(r8) :: emg_roof(bounds%begl:bounds%endl) ! roof emissivity + real(r8) :: emg_sunwall(bounds%begl:bounds%endl) ! sunwall emissivity + real(r8) :: emg_shadewall(bounds%begl:bounds%endl) ! shadewall emissivity + real(r8) :: emg_road_perv(bounds%begl:bounds%endl) ! pervious road emissivity + real(r8) :: emg_road_imperv(bounds%begl:bounds%endl) ! impervious road emissivity + real(r8) :: emg_road ! road emissivity + real(r8) :: emg_canyon ! canyon emissivity + real(r8) :: emg_urban ! effective urban emissivity +!KO !----------------------------------------------------------------------- associate( & @@ -97,6 +138,19 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] ground emissivity +!ABT +! emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity +! t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) +!ABT +!KO + t_skin_lun => temperature_inst%t_skin_lun , & ! Output: [real(r8) (:) ] landunit skin temperature (K) + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) + vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road + vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall + wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road + wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:) ] weight of roof with respect to landunit + canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street hwidth (-) +!KO t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] soil/snow temperature before update t_h2osfc_bef => temperature_inst%t_h2osfc_bef_col , & ! Input: [real(r8) (:) ] saved surface water temperature @@ -403,6 +457,19 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & + (1-frac_veg_nosno(p))*emg(c)*sb*lw_grnd & + 4._r8*emg(c)*sb*t_grnd0(c)**3*tinc(c) + +!ABT + ! Calculate the skin temperature as a weighted sum of all the surface contributions (surface water table, snow, etc...) + ! Note: This is the bare ground calculation of skin temperature + ! The Urban and Vegetation are done in other place. Urban=Later in this function Veg=CanopyFluxMod +! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + emv(p)*t_veg(p) +! if( frac_veg_nosno(p).eq.0 ) then +! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + & +! emv(p) * frac_veg_nosno(p) * t_veg(p) +! end if + if(frac_veg_nosno(p).eq.0) t_skin_patch(p) = sqrt(sqrt(lw_grnd)) +!ABT + eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then eflx_lwrad_net_r(p) = eflx_lwrad_out(p) - forc_lwrad(c) @@ -423,6 +490,67 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & errsoi_patch(bounds%begp:bounds%endp), & errsoi_col(bounds%begc:bounds%endc)) +!KO + ! Calculate urban skin temperature. Must be done here instead of in + ! UrbanFluxes because eflx_lwrad_out has been updated above. This section + ! of code could be placed in a subroutine that could be called here or + ! called from within clm_driver after the call to SoilFluxes. +!KO + ! Assign urban surface emissivities + + do fc = 1,num_urbanc + c = filter_urbanc(fc) + l = col%landunit(c) + + if (col%itype(c) == icol_roof ) then + emg_roof(l) = emg(c) + else if (col%itype(c) == icol_sunwall ) then + emg_sunwall(l) = emg(c) + else if (col%itype(c) == icol_shadewall) then + emg_shadewall(l) = emg(c) + else if (col%itype(c) == icol_road_perv) then + emg_road_perv(l) = emg(c) + else if (col%itype(c) == icol_road_imperv) then + emg_road_imperv(l) = emg(c) + end if + + end do + + ! Update landunit level upward longwave radiation + + call p2l(bounds, & + eflx_lwrad_out(bounds%begp:bounds%endp), & + eflx_lwrad_out_lun(bounds%begl:bounds%endl), & + p2c_scale_type = 'unity', c2l_scale_type = 'urbanf') + + ! Calculate urban effective emissivity and skin temperature + + do fl = 1, num_urbanl + l = filter_urbanl(fl) + + + emg_road = emg_road_perv(l)*wtroad_perv(l) + emg_road_imperv(l)*(1._r8-wtroad_perv(l)) + + ! The expression for vf_sw is for per unit wall area + ! So multiply it by canyon_hwr to convert to per unit ground area + ! Then the following should equal one: 2*canyon_hwr*vf_sw + vf_sr + emg_canyon = emg_road*vf_sr(l) + emg_sunwall(l)*vf_sw(l)*canyon_hwr(l) + emg_shadewall(l)*vf_sw(l)*canyon_hwr(l) + + emg_urban = emg_roof(l)*wtlunit_roof(l) + emg_canyon*(1._r8-wtlunit_roof(l)) + t_skin_lun(l) = sqrt(sqrt(eflx_lwrad_out_lun(l)/(sb*emg_urban))) + + end do + + ! Assign landunit-level t_skin to each urban pft + do fp = 1, num_urbanp + p = filter_urbanp(fp) + l = patch%landunit(p) + + t_skin_patch(p) = t_skin_lun(l) + + end do +!KO + call t_stopf('bgp2_loop_4') end associate diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index a797159829..9896a005ca 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -23,6 +23,9 @@ module TemperatureType ! Temperatures real(r8), pointer :: t_veg_patch (:) ! patch vegetation temperature (Kelvin) +!KO + real(r8), pointer :: t_skin_patch (:) ! patch skin temperature (Kelvin) +!KO real(r8), pointer :: t_veg_day_patch (:) ! patch daytime accumulative vegetation temperature (Kelvinx*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg_night_patch (:) ! patch night-time accumulative vegetation temperature (Kelvin*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg10_day_patch (:) ! 10 day running mean of patch daytime time vegetation temperature (Kelvin), LUNA specific, but can be reused @@ -44,6 +47,9 @@ module TemperatureType real(r8), pointer :: t_sunw_inner_lun (:) ! lun sunwall inside surface temperature (K) real(r8), pointer :: t_shdw_inner_lun (:) ! lun shadewall inside surface temperature (K) real(r8), pointer :: t_floor_lun (:) ! lun floor temperature (K) +!KO + real(r8), pointer :: t_skin_lun (:) ! lun skin temperature (K) +!KO real(r8), pointer :: snot_top_col (:) ! col temperature of top snow layer [K] real(r8), pointer :: dTdz_top_col (:) ! col temperature gradient in top layer [K m-1] real(r8), pointer :: dt_veg_patch (:) ! patch change in t_veg, last iteration (Kelvin) @@ -186,6 +192,9 @@ subroutine InitAllocate(this, bounds) ! Temperatures allocate(this%t_veg_patch (begp:endp)) ; this%t_veg_patch (:) = nan +!KO + allocate(this%t_skin_patch (begp:endp)) ; this%t_skin_patch (:) = nan +!KO if(use_luna) then allocate(this%t_veg_day_patch (begp:endp)) ; this%t_veg_day_patch (:) = spval allocate(this%t_veg_night_patch (begp:endp)) ; this%t_veg_night_patch (:) = spval @@ -207,6 +216,9 @@ subroutine InitAllocate(this, bounds) allocate(this%t_sunw_inner_lun (begl:endl)) ; this%t_sunw_inner_lun (:) = nan allocate(this%t_shdw_inner_lun (begl:endl)) ; this%t_shdw_inner_lun (:) = nan allocate(this%t_floor_lun (begl:endl)) ; this%t_floor_lun (:) = nan +!KO + allocate(this%t_skin_lun (begl:endl)) ; this%t_skin_lun (:) = nan +!KO allocate(this%snot_top_col (begc:endc)) ; this%snot_top_col (:) = nan allocate(this%dTdz_top_col (begc:endc)) ; this%dTdz_top_col (:) = nan allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan @@ -381,6 +393,17 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='vegetation temperature', & ptr_patch=this%t_veg_patch) +!KO + this%t_skin_patch(begp:endp) = spval + call hist_addfld1d(fname='TSKIN', units='K', & + avgflag='A', long_name='skin temperature', & + ptr_patch=this%t_skin_patch, c2l_scale_type='urbans') +! this%t_skin_lun(begl:endl) = spval +! call hist_addfld1d(fname='TSKIN', units='K', & +! avgflag='A', long_name='skin temperature', & +! ptr_lun=this%t_skin_patch, set_nourb=spval, l2g_scale_type='unity') +!KO + this%t_grnd_col(begc:endc) = spval call hist_addfld1d (fname='TG', units='K', & avgflag='A', long_name='ground temperature', & diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 9cbbe51f25..b481b60178 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -660,12 +660,22 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! ============================================================================ call t_startf('bgp2') +!KO call SoilFluxes(bounds_clump, & +!KO filter(nc)%num_urbanl, filter(nc)%urbanl, & +!KO filter(nc)%num_nolakec, filter(nc)%nolakec, & +!KO filter(nc)%num_nolakep, filter(nc)%nolakep, & +!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & +!KO energyflux_inst, waterflux_inst) +!KO call SoilFluxes(bounds_clump, & filter(nc)%num_urbanl, filter(nc)%urbanl, & + filter(nc)%num_urbanc, filter(nc)%urbanc, & + filter(nc)%num_urbanp, filter(nc)%urbanp, & filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_nolakep, filter(nc)%nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & - energyflux_inst, waterflux_inst) + energyflux_inst, waterflux_inst, urbanparams_inst) +!KO call t_stopf('bgp2') ! ============================================================================ From b5cab6cf79f0639bc80d355503a73c4cc682192c Mon Sep 17 00:00:00 2001 From: ckoven Date: Fri, 23 Feb 2018 16:39:53 -0700 Subject: [PATCH 054/144] added summary N litterfall flux variable --- src/biogeochem/CNVegNitrogenFluxType.F90 | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index 1bb630c687..2616b858a4 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -178,6 +178,7 @@ module CNVegNitrogenFluxType real(r8), pointer :: ndeploy_patch (:) ! patch total N deployed to growth and storage (gN/m2/s) real(r8), pointer :: wood_harvestn_patch (:) ! patch total N losses to wood product pools (gN/m2/s) real(r8), pointer :: wood_harvestn_col (:) ! col total N losses to wood product pools (gN/m2/s) (p2c) + real(r8), pointer :: litfall_n_patch (:) ! total N passed from plant to litter (gN/m2/s) ! phenology: litterfall and crop fluxes real(r8), pointer :: phenology_n_to_litr_met_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s) @@ -441,6 +442,8 @@ subroutine InitAllocate(this, bounds) allocate(this%dwt_crop_productn_gain_patch (begp:endp)) ; this%dwt_crop_productn_gain_patch (:) = nan allocate(this%wood_harvestn_col (begc:endc)) ; this%wood_harvestn_col (:) = nan + allocate(this%litfall_n_patch (begp:endp)) ; this%litfall_n_patch (:) = nan + allocate(this%dwt_frootn_to_litr_met_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_met_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_cel_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_cel_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_lig_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_lig_n_col (:,:) = nan @@ -1034,6 +1037,11 @@ subroutine InitHistory(this, bounds) '(per-area-gridcell; only makes sense with dov2xy=.false.)', & ptr_patch=this%dwt_conv_nflux_patch, default='inactive') + this%litfall_n_patch(begp:endp) = spval + call hist_addfld1d (fname='LITFALL_N', units='gN/m^2/s', & + avgflag='A', long_name='N Flux from vegetation to soil', & + ptr_patch=this%litfall_n_patch) + this%dwt_frootn_to_litr_met_n_col(begc:endc,:) = spval call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_MET_N', units='gN/m^2/s', type2d='levdcmp', & avgflag='A', long_name='fine root to litter due to landcover change', & @@ -1820,6 +1828,49 @@ subroutine Summary_nitrogenflux(this, bounds, num_soilc, filter_soilc, num_soilp this%m_deadcrootn_xfer_to_fire_patch(p) + & this%m_retransn_to_fire_patch(p) + ! total N fluxes from veg to litter + this%litfall_n_patch(p) = & + this%m_leafn_to_litter_patch(p) + & + this%m_frootn_to_litter_patch(p) + & + this%m_leafn_storage_to_litter_patch(p) + & + this%m_frootn_storage_to_litter_patch(p) + & + this%m_livestemn_storage_to_litter_patch(p) + & + this%m_deadstemn_storage_to_litter_patch(p) + & + this%m_livecrootn_storage_to_litter_patch(p) + & + this%m_deadcrootn_storage_to_litter_patch(p) + & + this%m_leafn_xfer_to_litter_patch(p) + & + this%m_frootn_xfer_to_litter_patch(p) + & + this%m_livestemn_xfer_to_litter_patch(p) + & + this%m_deadstemn_xfer_to_litter_patch(p) + & + this%m_livecrootn_xfer_to_litter_patch(p) + & + this%m_deadcrootn_xfer_to_litter_patch(p) + & + this%m_livestemn_to_litter_patch(p) + & + this%m_deadstemn_to_litter_patch(p) + & + this%m_livecrootn_to_litter_patch(p) + & + this%m_deadcrootn_to_litter_patch(p) + & + this%m_retransn_to_litter_patch(p) + & + this%hrv_leafn_to_litter_patch(p) + & + this%hrv_frootn_to_litter_patch(p) + & + this%hrv_leafn_storage_to_litter_patch(p) + & + this%hrv_frootn_storage_to_litter_patch(p) + & + this%hrv_livestemn_storage_to_litter_patch(p) + & + this%hrv_deadstemn_storage_to_litter_patch(p) + & + this%hrv_livecrootn_storage_to_litter_patch(p) + & + this%hrv_deadcrootn_storage_to_litter_patch(p) + & + this%hrv_leafn_xfer_to_litter_patch(p) + & + this%hrv_frootn_xfer_to_litter_patch(p) + & + this%hrv_livestemn_xfer_to_litter_patch(p) + & + this%hrv_deadstemn_xfer_to_litter_patch(p) + & + this%hrv_livecrootn_xfer_to_litter_patch(p) + & + this%hrv_deadcrootn_xfer_to_litter_patch(p) + & + this%hrv_livestemn_to_litter_patch(p) + & + this%hrv_livecrootn_to_litter_patch(p) + & + this%hrv_deadcrootn_to_litter_patch(p) + & + this%hrv_retransn_to_litter_patch(p) + & + this%livestemn_to_litter_patch(p) + & + this%leafn_to_litter_patch(p) + & + this%frootn_to_litter_patch(p) + end do call p2c(bounds, num_soilc, filter_soilc, & From d676c01bec8893f5b89dcc797a56f75f4f66caf9 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 6 Mar 2018 17:23:39 -0700 Subject: [PATCH 055/144] Add TSL diagnostic and GSSUNLN/GSSHALN to subroutine Photosynthesis --- src/biogeophys/HydrologyNoDrainageMod.F90 | 5 +++ src/biogeophys/PhotosynthesisMod.F90 | 41 +++++++++++++++++++++-- src/biogeophys/TemperatureType.F90 | 7 ++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 6ab5e8d98e..320784ac0c 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -132,6 +132,7 @@ subroutine HydrologyNoDrainage(bounds, & t_grnd => temperature_inst%t_grnd_col , & ! Output: [real(r8) (:) ] ground temperature (Kelvin) t_grnd_u => temperature_inst%t_grnd_u_col , & ! Output: [real(r8) (:) ] Urban ground temperature (Kelvin) t_grnd_r => temperature_inst%t_grnd_r_col , & ! Output: [real(r8) (:) ] Rural ground temperature (Kelvin) + tsl => temperature_inst%tsl_col , & ! Output: [real(r8) (:) ] temperature of near-surface soil layer (Kelvin) t_soi_10cm => temperature_inst%t_soi10cm_col , & ! Output: [real(r8) (:) ] soil temperature in top 10cm of soil (Kelvin) tsoi17 => temperature_inst%t_soi17cm_col , & ! Output: [real(r8) (:) ] soil temperature in top 17cm of soil (Kelvin) @@ -299,6 +300,7 @@ subroutine HydrologyNoDrainage(bounds, & end do ! Determine ground temperature, ending water balance and volumetric soil water + ! Calculate temperature of near-surface soil layer ! Calculate soil temperature and total water (liq+ice) in top 10cm of soil ! Calculate soil temperature and total water (liq+ice) in top 17cm of soil do fc = 1, num_nolakec @@ -317,6 +319,9 @@ subroutine HydrologyNoDrainage(bounds, & c = filter_nolakec(fc) l = col%landunit(c) if (.not. lun%urbpoi(l)) then + if (j == 1) then + tsl(c) = t_soisno(c,j) + end if ! soil T at top 17 cm added by F. Li and S. Levis if (zi(c,j) <= 0.17_r8) then fracl = 1._r8 diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 9edbb4477b..99920f4cca 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -803,13 +803,13 @@ subroutine Restart(this, bounds, ncid, flag) !KO call restartvar(ncid=ncid, flag=flag, varname='GSSUNLN', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', & + dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sun_ln_patch) call restartvar(ncid=ncid, flag=flag, varname='GSSHALN', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', & + dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_ln_patch) @@ -963,7 +963,9 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! a multi-layer canopy ! ! !USES: - use clm_varcon , only : rgas, tfrz + use clm_varcon , only : rgas, tfrz, spval, degpsec, isecspday + use GridcellType , only : grc + use clm_time_manager , only : get_curr_date, get_step_size use clm_varctl , only : cnallocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use pftconMod , only : nbrdlf_dcd_tmp_shrub, npcropmin @@ -1106,6 +1108,12 @@ subroutine Photosynthesis ( bounds, fn, filterp, & real(r8) :: sum_nscaler real(r8) :: total_lai integer :: nptreemax + + integer :: local_secp1 ! seconds into current date in local time + real(r8) :: dtime ! land model time step (sec) + integer :: year,month,day,secs ! calendar info for current time step + integer :: g ! index + integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon !------------------------------------------------------------------------------ ! Temperature and soil water response functions @@ -1156,6 +1164,8 @@ subroutine Photosynthesis ( bounds, fn, filterp, & an => photosyns_inst%an_patch , & ! Output: [real(r8) (:,:) ] net leaf photosynthesis (umol CO2/m**2/s) gb_mol => photosyns_inst%gb_mol_patch , & ! Output: [real(r8) (:) ] leaf boundary layer conductance (umol H2O/m**2/s) gs_mol => photosyns_inst%gs_mol_patch , & ! Output: [real(r8) (:,:) ] leaf stomatal conductance (umol H2O/m**2/s) + gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) vcmax_z => photosyns_inst%vcmax_z_patch , & ! Output: [real(r8) (:,:) ] maximum rate of carboxylation (umol co2/m**2/s) cp => photosyns_inst%cp_patch , & ! Output: [real(r8) (:) ] CO2 compensation point (Pa) kc => photosyns_inst%kc_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for CO2 (Pa) @@ -1215,6 +1225,11 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 !==============================================================================! + ! Determine seconds of current time step + + dtime = get_step_size() + call get_curr_date (year, month, day, secs) + ! vcmax25 parameters, from CN fnr = 7.16_r8 @@ -1572,6 +1587,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & do f = 1, fn p = filterp(f) c = patch%column(p) + g = patch%gridcell(p) ! Leaf boundary layer conductance, umol/m**2/s @@ -1646,6 +1662,25 @@ subroutine Photosynthesis ( bounds, fn, filterp, & if (an(p,iv) < 0._r8) gs_mol(p,iv) = bbb(p) + ! Get local noon sunlit and shaded stomatal conductance + local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime + local_secp1 = mod(local_secp1,isecspday) + + ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) + if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then + if (phase == 'sun') then + gs_mol_sun_ln(p,iv) = gs_mol(p,iv) + else if (phase == 'sha') then + gs_mol_sha_ln(p,iv) = gs_mol(p,iv) + end if + else + if (phase == 'sun') then + gs_mol_sun_ln(p,iv) = spval + else if (phase == 'sha') then + gs_mol_sha_ln(p,iv) = spval + end if + end if + ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) cs = cair(p) - 1.4_r8/gb_mol(p) * an(p,iv) * forc_pbot(c) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 9896a005ca..11640faf07 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -36,6 +36,7 @@ module TemperatureType real(r8), pointer :: t_h2osfc_bef_col (:) ! col surface water temperature from time-step before real(r8), pointer :: t_ssbef_col (:,:) ! col soil/snow temperature before update (-nlevsno+1:nlevgrnd) real(r8), pointer :: t_soisno_col (:,:) ! col soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) + real(r8), pointer :: tsl_col (:) ! col temperature of near-surface soil layer (Kelvin) real(r8), pointer :: t_soi10cm_col (:) ! col soil temperature in top 10cm of soil (Kelvin) real(r8), pointer :: t_soi17cm_col (:) ! col soil temperature in top 17cm of soil (Kelvin) real(r8), pointer :: t_lake_col (:,:) ! col lake temperature (Kelvin) (1:nlevlak) @@ -223,6 +224,7 @@ subroutine InitAllocate(this, bounds) allocate(this%dTdz_top_col (begc:endc)) ; this%dTdz_top_col (:) = nan allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan + allocate(this%tsl_col (begc:endc)) ; this%tsl_col (:) = nan allocate(this%t_soi10cm_col (begc:endc)) ; this%t_soi10cm_col (:) = nan allocate(this%t_soi17cm_col (begc:endc)) ; this%t_soi17cm_col (:) = spval allocate(this%dt_grnd_col (begc:endc)) ; this%dt_grnd_col (:) = nan @@ -433,6 +435,11 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='soil temperature in top 10cm of soil', & ptr_col=this%t_soi10cm_col, set_urb=spval) + this%tsl_col(begc:endc) = spval + call hist_addfld1d (fname='TSL', units='K', & + avgflag='A', long_name='temperature of near-surface soil layer (vegetated landunits only)', & + ptr_col=this%tsl_col, l2g_scale_type='veg') + if (use_cndv .or. use_crop) then active = "active" else From ff3a5c6b670d3e9f6464bd9df860227fb9cf0027 Mon Sep 17 00:00:00 2001 From: Peter Lawrence Date: Tue, 27 Mar 2018 14:12:18 -0600 Subject: [PATCH 056/144] Added code to put the PCT_NAT_PFT_MAX and PCT_CFT_MAX on the landuse.timeseries file to register the maximum values for PCT_NAT_PFT and PCT_CFT through the time series. This is used to determine how many PFTs and CFTs are instantiated at run time in CLM5 --- tools/mksurfdata_map/src/mkpctPftTypeMod.F90 | 46 +++++++++++++++++++- tools/mksurfdata_map/src/mkpftMod.F90 | 6 +++ tools/mksurfdata_map/src/mksurfdat.F90 | 24 ++++++++-- 3 files changed, 70 insertions(+), 6 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 index a47d67dd2a..67c839eea8 100644 --- a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 +++ b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 @@ -46,6 +46,7 @@ module mkpctPftTypeMod end type pct_pft_type ! !PUBLIC MEMBER FUNCTIONS + public :: set_max_p2l_array ! given an array of pct_pft_type variables update the max_p2l values from pct_p2l public :: get_pct_p2l_array ! given an array of pct_pft_type variables, return a 2-d array of pct_p2l public :: get_pct_l2g_array ! given an array of pct_pft_type variables, return an array of pct_l2g @@ -409,8 +410,6 @@ subroutine remove_small_cover(this, too_small, nsmall) deallocate(pct_p2g, is_small, is_zero) end subroutine remove_small_cover - - ! ======================================================================== ! Private member functions ! ======================================================================== @@ -511,6 +510,49 @@ end subroutine check_vals ! Module-level routines (not member functions) ! ======================================================================== + !----------------------------------------------------------------------- + subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) + ! + ! !DESCRIPTION: + ! Given an array of pct_pft_type variables, set all max_p2l. + ! + ! Assumes that all elements of pct_pft_arr have the same size and lower bound for + ! their pct_p2l array. + ! + ! !ARGUMENTS: + ! workaround for gfortran bug (58043): declare this 'type' rather than 'class': + type(pct_pft_type), intent(inout) :: pct_pft_max_arr(:) + type(pct_pft_type), intent(in) :: pct_pft_arr(:) + ! + ! !LOCAL VARIABLES: + integer :: pft_lbound + integer :: pft_ubound + integer :: arr_index + integer :: pft_index + + character(len=*), parameter :: subname = 'get_pct_p2l_array' + !----------------------------------------------------------------------- + + pft_lbound = lbound(pct_pft_arr(1)%pct_p2l, 1) + pft_ubound = ubound(pct_pft_arr(1)%pct_p2l, 1) + + do arr_index = 1, size(pct_pft_arr) + if (lbound(pct_pft_arr(arr_index)%pct_p2l, 1) /= pft_lbound .or. & + ubound(pct_pft_arr(arr_index)%pct_p2l, 1) /= pft_ubound) then + write(6,*) subname//' ERROR: all elements of pct_pft_arr must have' + write(6,*) 'the same size and lower bound for their pct_p2l array' + call abort() + end if + + do pft_index = pft_lbound, pft_ubound + if (pct_pft_arr(arr_index)%pct_p2l(pft_index) > pct_pft_max_arr(arr_index)%pct_p2l(pft_index)) then + pct_pft_max_arr(arr_index)%pct_p2l(pft_index) = pct_pft_arr(arr_index)%pct_p2l(pft_index) + end if + end do + end do + + end subroutine set_max_p2l_array + !----------------------------------------------------------------------- function get_pct_p2l_array(pct_pft_arr) result(pct_p2l) ! diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 5a3686a0ae..4f1067c427 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -1019,6 +1019,9 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) call ncd_def_spatial_var(ncid=ncid, varname='PCT_NAT_PFT', xtype=xtype, & lev1name='natpft', lev2name='time', & long_name='percent plant functional type on the natural veg landunit (% of landunit)', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='PCT_NAT_PFT_MAX', xtype=xtype, & + lev1name='natpft', & + long_name='maximum percent plant functional type during time period (% of landunit)', units='unitless') end if ! PCT_CFT @@ -1031,6 +1034,9 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) call ncd_def_spatial_var(ncid=ncid, varname='PCT_CFT', xtype=xtype, & lev1name='cft', lev2name='time', & long_name='percent crop functional type on the crop landunit (% of landunit)', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='PCT_CFT_MAX', xtype=xtype, & + lev1name='cft', & + long_name='maximum percent crop functional type during time period (% of landunit)', units='unitless') end if end if diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 97d53aac02..a4e94eee30 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -15,7 +15,7 @@ program mksurfdat use shr_kind_mod , only : r8 => shr_kind_r8, r4 => shr_kind_r4 use fileutils , only : opnfil, getavu use mklaiMod , only : mklai - use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array + use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array, set_max_p2l_array use mkpftConstantsMod , only : natpft_lb, natpft_ub, cft_lb, cft_ub, num_cft use mkpftMod , only : pft_idx, pft_frc, mkpft, mkpftInit, mkpft_parse_oride use mksoilMod , only : soil_sand, soil_clay, mksoiltex, mksoilInit, & @@ -90,9 +90,11 @@ program mksurfdat real(r8), allocatable :: pctlnd_pft(:) ! PFT data: % of gridcell for PFTs real(r8), allocatable :: pctlnd_pft_dyn(:) ! PFT data: % of gridcell for dyn landuse PFTs integer , allocatable :: pftdata_mask(:) ! mask indicating real or fake land type - type(pct_pft_type), allocatable :: pctnatpft(:) ! % of grid cell that is nat veg, and breakdown into PFTs - type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs - type(pct_pft_type), allocatable :: pctcft_saved(:) ! version of pctcft saved from the initial call to mkpft + type(pct_pft_type), allocatable :: pctnatpft(:) ! % of grid cell that is nat veg, and breakdown into PFTs + type(pct_pft_type), allocatable :: pctnatpft_max(:) ! % of grid cell maximum PFTs of the time series + type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs + type(pct_pft_type), allocatable :: pctcft_max(:) ! % of grid cell maximum CFTs of the time series + type(pct_pft_type), allocatable :: pctcft_saved(:) ! version of pctcft saved from the initial call to mkpft real(r8), pointer :: harvest1D(:) ! harvest 1D data: normalized harvesting real(r8), pointer :: harvest2D(:,:) ! harvest 1D data: normalized harvesting real(r8), allocatable :: pctgla(:) ! percent of grid cell that is glacier @@ -414,7 +416,9 @@ program mksurfdat pctlnd_pft(ns_o) , & pftdata_mask(ns_o) , & pctnatpft(ns_o) , & + pctnatpft_max(ns_o) , & pctcft(ns_o) , & + pctcft_max(ns_o) , & pctcft_saved(ns_o) , & pctgla(ns_o) , & pctlak(ns_o) , & @@ -802,6 +806,9 @@ program mksurfdat landfrac_pft(n) = pctlnd_pft(n)/100._r8 end do + pctnatpft_max = pctnatpft + pctcft_max = pctcft + ! ---------------------------------------------------------------------- ! Create surface dataset ! ---------------------------------------------------------------------- @@ -1156,6 +1163,9 @@ program mksurfdat call change_landuse(ldomain, dynpft=.true.) call normalizencheck_landuse(ldomain) + + call set_max_p2l_array(pctnatpft_max,pctnatpft) + call set_max_p2l_array(pctcft_max,pctcft) ! Output time-varying data for current year @@ -1198,6 +1208,12 @@ program mksurfdat end do ! end of read loop + call check_ret(nf_inq_varid(ncid, 'PCT_NAT_PFT_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctnatpft_max)), subname) + + call check_ret(nf_inq_varid(ncid, 'PCT_CFT_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctcft_max)), subname) + call check_ret(nf_close(ncid), subname) end if ! end of if-create dynamic landust dataset From 4291c19ca1546b547a6229587e99efa7ee8422b7 Mon Sep 17 00:00:00 2001 From: Peter Lawrence Date: Mon, 2 Apr 2018 11:38:28 -0600 Subject: [PATCH 057/144] Following suggestions by Bill Sacks the code has been updated to output PCT_CROP_MAX in addition to PCT_NAT_PFT_MAX and PCT_CFT_MAX. This involved modifying the new subroutine to update both p2l and l2g and renaming it update_max_array. Additional changes were made to match Bill's suggestions of the sub_routine subname parameter and moving the initial assignment of the max array within the if (mksrf_fdynuse /= ' ') then code The code has been tested and produces the maximum PCT_CROP_MAX variable as expected. PJL --- tools/mksurfdata_map/src/mkpctPftTypeMod.F90 | 21 ++++++++++++-------- tools/mksurfdata_map/src/mkpftMod.F90 | 2 ++ tools/mksurfdata_map/src/mksurfdat.F90 | 21 ++++++++++++-------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 index 67c839eea8..8c2c9b7c53 100644 --- a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 +++ b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 @@ -46,7 +46,7 @@ module mkpctPftTypeMod end type pct_pft_type ! !PUBLIC MEMBER FUNCTIONS - public :: set_max_p2l_array ! given an array of pct_pft_type variables update the max_p2l values from pct_p2l + public :: update_max_array ! given an array of pct_pft_type variables update the max_p2l values from pct_p2l public :: get_pct_p2l_array ! given an array of pct_pft_type variables, return a 2-d array of pct_p2l public :: get_pct_l2g_array ! given an array of pct_pft_type variables, return an array of pct_l2g @@ -511,13 +511,13 @@ end subroutine check_vals ! ======================================================================== !----------------------------------------------------------------------- - subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) + subroutine update_max_array(pct_pft_max_arr,pct_pft_arr) ! ! !DESCRIPTION: - ! Given an array of pct_pft_type variables, set all max_p2l. + ! Given an array of pct_pft_type variables, update all the max_p2l variables. ! - ! Assumes that all elements of pct_pft_arr have the same size and lower bound for - ! their pct_p2l array. + ! Assumes that all elements of pct_pft_max_arr and pct_pft_arr have the same + ! size and lower bound for their pct_p2l array. ! ! !ARGUMENTS: ! workaround for gfortran bug (58043): declare this 'type' rather than 'class': @@ -530,9 +530,10 @@ subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) integer :: arr_index integer :: pft_index - character(len=*), parameter :: subname = 'get_pct_p2l_array' + character(len=*), parameter :: subname = 'update_max_array' !----------------------------------------------------------------------- - + + pft_lbound = lbound(pct_pft_arr(1)%pct_p2l, 1) pft_ubound = ubound(pct_pft_arr(1)%pct_p2l, 1) @@ -544,6 +545,10 @@ subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) call abort() end if + if (pct_pft_arr(arr_index)%pct_l2g > pct_pft_max_arr(arr_index)%pct_l2g) then + pct_pft_max_arr(arr_index)%pct_l2g = pct_pft_arr(arr_index)%pct_l2g + end if + do pft_index = pft_lbound, pft_ubound if (pct_pft_arr(arr_index)%pct_p2l(pft_index) > pct_pft_max_arr(arr_index)%pct_p2l(pft_index)) then pct_pft_max_arr(arr_index)%pct_p2l(pft_index) = pct_pft_arr(arr_index)%pct_p2l(pft_index) @@ -551,7 +556,7 @@ subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) end do end do - end subroutine set_max_p2l_array + end subroutine update_max_array !----------------------------------------------------------------------- function get_pct_p2l_array(pct_pft_arr) result(pct_p2l) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 4f1067c427..c99d66c9ac 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -1008,6 +1008,8 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) call ncd_def_spatial_var(ncid=ncid, varname='PCT_CROP', xtype=xtype, & lev1name='time', & long_name='total percent crop landunit', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='PCT_CROP_MAX', xtype=xtype, & + long_name='maximum total percent crop landunit during time period', units='unitless') end if ! PCT_NAT_PFT diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index a4e94eee30..981bfef03d 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -15,7 +15,7 @@ program mksurfdat use shr_kind_mod , only : r8 => shr_kind_r8, r4 => shr_kind_r4 use fileutils , only : opnfil, getavu use mklaiMod , only : mklai - use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array, set_max_p2l_array + use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array, update_max_array use mkpftConstantsMod , only : natpft_lb, natpft_ub, cft_lb, cft_ub, num_cft use mkpftMod , only : pft_idx, pft_frc, mkpft, mkpftInit, mkpft_parse_oride use mksoilMod , only : soil_sand, soil_clay, mksoiltex, mksoilInit, & @@ -806,9 +806,6 @@ program mksurfdat landfrac_pft(n) = pctlnd_pft(n)/100._r8 end do - pctnatpft_max = pctnatpft - pctcft_max = pctcft - ! ---------------------------------------------------------------------- ! Create surface dataset ! ---------------------------------------------------------------------- @@ -1102,6 +1099,9 @@ program mksurfdat nfdyn = getavu(); call opnfil (mksrf_fdynuse, nfdyn, 'f') + pctnatpft_max = pctnatpft + pctcft_max = pctcft + ntim = 0 do ! Read input pft data @@ -1164,8 +1164,8 @@ program mksurfdat call normalizencheck_landuse(ldomain) - call set_max_p2l_array(pctnatpft_max,pctnatpft) - call set_max_p2l_array(pctcft_max,pctcft) + call update_max_array(pctnatpft_max,pctnatpft) + call update_max_array(pctcft_max,pctcft) ! Output time-varying data for current year @@ -1211,8 +1211,13 @@ program mksurfdat call check_ret(nf_inq_varid(ncid, 'PCT_NAT_PFT_MAX', varid), subname) call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctnatpft_max)), subname) - call check_ret(nf_inq_varid(ncid, 'PCT_CFT_MAX', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctcft_max)), subname) + call check_ret(nf_inq_varid(ncid, 'PCT_CROP_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_l2g_array(pctcft_max)), subname) + + if (num_cft > 0) then + call check_ret(nf_inq_varid(ncid, 'PCT_CFT_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctcft_max)), subname) + end if call check_ret(nf_close(ncid), subname) From 70548756672da9d364dd2dd0370023da032aa41a Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 1 Jun 2018 09:56:24 -0600 Subject: [PATCH 058/144] Change urban skin temperature from longwave-derived to surface temperature (TG). --- src/biogeophys/SoilFluxesMod.F90 | 110 ++--------------------------- src/biogeophys/TemperatureType.F90 | 16 ----- src/main/clm_driver.F90 | 11 +-- 3 files changed, 7 insertions(+), 130 deletions(-) diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 index fcde1d5d7e..701bb22fcd 100644 --- a/src/biogeophys/SoilFluxesMod.F90 +++ b/src/biogeophys/SoilFluxesMod.F90 @@ -22,9 +22,6 @@ module SoilFluxesMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch -!KO - use UrbanParamsType , only : urbanparams_type -!KO ! ! !PUBLIC TYPES: implicit none @@ -37,18 +34,11 @@ module SoilFluxesMod contains !----------------------------------------------------------------------- -!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & -!KO num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & -!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & -!KO waterstate_inst, energyflux_inst, waterflux_inst) -!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & - num_urbanc, filter_urbanc, & num_urbanp, filter_urbanp, & num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & - waterstate_inst, energyflux_inst, waterflux_inst, urbanparams_inst) -!KO + waterstate_inst, energyflux_inst, waterflux_inst) ! ! !DESCRIPTION: ! Update surface fluxes based on the new ground temperature @@ -57,15 +47,8 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & use clm_time_manager , only : get_step_size use clm_varcon , only : hvap, cpair, grav, vkc, tfrz, sb use landunit_varcon , only : istsoil, istcrop -!KO use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv -!KO - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv -!KO + use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv use subgridAveMod , only : p2c -!KO - use clm_varcon , only : sb - use subgridAveMod , only : p2l -!KO ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -73,12 +56,8 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_urbanl ! number of urban landunits in clump integer , intent(in) :: filter_urbanl(:) ! urban landunit filter -!KO - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter integer , intent(in) :: num_urbanp ! number of urban pfts in clump integer , intent(in) :: filter_urbanp(:) ! urban pft filter -!KO integer , intent(in) :: num_nolakep ! number of column non-lake points in pft filter integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points type(atm2lnd_type) , intent(in) :: atm2lnd_inst @@ -86,18 +65,12 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & type(temperature_type) , intent(in) :: temperature_inst type(canopystate_type) , intent(in) :: canopystate_inst type(waterstate_type) , intent(in) :: waterstate_inst -!KO - type(urbanparams_type) , intent(in) :: urbanparams_inst -!KO type(waterflux_type) , intent(inout) :: waterflux_inst type(energyflux_type) , intent(inout) :: energyflux_inst ! ! !LOCAL VARIABLES: integer :: p,c,g,j,pi,l ! indices -!KO integer :: fc,fp ! lake filtered column and pft indices -!KO - integer :: fc,fp,fl ! lake filtered column and pft indices -!KO + integer :: fc,fp ! lake filtered column and pft indices real(r8) :: dtime ! land model time step (sec) real(r8) :: egsmax(bounds%begc:bounds%endc) ! max. evaporation which soil can provide at one time step real(r8) :: egirat(bounds%begc:bounds%endc) ! ratio of topsoil_evap_tot : egsmax @@ -110,17 +83,6 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & real(r8) :: t_grnd0(bounds%begc:bounds%endc) ! t_grnd of previous time step real(r8) :: lw_grnd real(r8) :: fsno_eff -!KO - real(r8) :: eflx_lwrad_out_lun(bounds%begl:bounds%endl) ! emitted infrared (longwave) radiation (W/m**2) - real(r8) :: emg_roof(bounds%begl:bounds%endl) ! roof emissivity - real(r8) :: emg_sunwall(bounds%begl:bounds%endl) ! sunwall emissivity - real(r8) :: emg_shadewall(bounds%begl:bounds%endl) ! shadewall emissivity - real(r8) :: emg_road_perv(bounds%begl:bounds%endl) ! pervious road emissivity - real(r8) :: emg_road_imperv(bounds%begl:bounds%endl) ! impervious road emissivity - real(r8) :: emg_road ! road emissivity - real(r8) :: emg_canyon ! canyon emissivity - real(r8) :: emg_urban ! effective urban emissivity -!KO !----------------------------------------------------------------------- associate( & @@ -144,15 +106,7 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & ! emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity ! t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) !ABT -!KO - t_skin_lun => temperature_inst%t_skin_lun , & ! Output: [real(r8) (:) ] landunit skin temperature (K) t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) - vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road - vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall - wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road - wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:) ] weight of roof with respect to landunit - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street hwidth (-) -!KO t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] soil/snow temperature before update t_h2osfc_bef => temperature_inst%t_h2osfc_bef_col , & ! Input: [real(r8) (:) ] saved surface water temperature @@ -492,66 +446,14 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & errsoi_patch(bounds%begp:bounds%endp), & errsoi_col(bounds%begc:bounds%endc)) -!KO - ! Calculate urban skin temperature. Must be done here instead of in - ! UrbanFluxes because eflx_lwrad_out has been updated above. This section - ! of code could be placed in a subroutine that could be called here or - ! called from within clm_driver after the call to SoilFluxes. -!KO - ! Assign urban surface emissivities - - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - - if (col%itype(c) == icol_roof ) then - emg_roof(l) = emg(c) - else if (col%itype(c) == icol_sunwall ) then - emg_sunwall(l) = emg(c) - else if (col%itype(c) == icol_shadewall) then - emg_shadewall(l) = emg(c) - else if (col%itype(c) == icol_road_perv) then - emg_road_perv(l) = emg(c) - else if (col%itype(c) == icol_road_imperv) then - emg_road_imperv(l) = emg(c) - end if - - end do - - ! Update landunit level upward longwave radiation - - call p2l(bounds, & - eflx_lwrad_out(bounds%begp:bounds%endp), & - eflx_lwrad_out_lun(bounds%begl:bounds%endl), & - p2c_scale_type = 'unity', c2l_scale_type = 'urbanf') - - ! Calculate urban effective emissivity and skin temperature - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - - - emg_road = emg_road_perv(l)*wtroad_perv(l) + emg_road_imperv(l)*(1._r8-wtroad_perv(l)) - - ! The expression for vf_sw is for per unit wall area - ! So multiply it by canyon_hwr to convert to per unit ground area - ! Then the following should equal one: 2*canyon_hwr*vf_sw + vf_sr - emg_canyon = emg_road*vf_sr(l) + emg_sunwall(l)*vf_sw(l)*canyon_hwr(l) + emg_shadewall(l)*vf_sw(l)*canyon_hwr(l) - - emg_urban = emg_roof(l)*wtlunit_roof(l) + emg_canyon*(1._r8-wtlunit_roof(l)) - t_skin_lun(l) = sqrt(sqrt(eflx_lwrad_out_lun(l)/(sb*emg_urban))) - - end do - - ! Assign landunit-level t_skin to each urban pft + ! Assign column-level t_soisno(snl+1) to t_skin for each urban pft do fp = 1, num_urbanp p = filter_urbanp(fp) - l = patch%landunit(p) + c = patch%column(p) - t_skin_patch(p) = t_skin_lun(l) + t_skin_patch(p) = t_soisno(c,col%snl(c)+1) end do -!KO call t_stopf('bgp2_loop_4') diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 11b215e609..9be3ed7c74 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -23,9 +23,7 @@ module TemperatureType ! Temperatures real(r8), pointer :: t_veg_patch (:) ! patch vegetation temperature (Kelvin) -!KO real(r8), pointer :: t_skin_patch (:) ! patch skin temperature (Kelvin) -!KO real(r8), pointer :: t_veg_day_patch (:) ! patch daytime accumulative vegetation temperature (Kelvinx*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg_night_patch (:) ! patch night-time accumulative vegetation temperature (Kelvin*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg10_day_patch (:) ! 10 day running mean of patch daytime time vegetation temperature (Kelvin), LUNA specific, but can be reused @@ -49,9 +47,6 @@ module TemperatureType real(r8), pointer :: t_sunw_inner_lun (:) ! lun sunwall inside surface temperature (K) real(r8), pointer :: t_shdw_inner_lun (:) ! lun shadewall inside surface temperature (K) real(r8), pointer :: t_floor_lun (:) ! lun floor temperature (K) -!KO - real(r8), pointer :: t_skin_lun (:) ! lun skin temperature (K) -!KO real(r8), pointer :: snot_top_col (:) ! col temperature of top snow layer [K] real(r8), pointer :: dTdz_top_col (:) ! col temperature gradient in top layer [K m-1] real(r8), pointer :: dt_veg_patch (:) ! patch change in t_veg, last iteration (Kelvin) @@ -194,9 +189,7 @@ subroutine InitAllocate(this, bounds) ! Temperatures allocate(this%t_veg_patch (begp:endp)) ; this%t_veg_patch (:) = nan -!KO allocate(this%t_skin_patch (begp:endp)) ; this%t_skin_patch (:) = nan -!KO if(use_luna) then allocate(this%t_veg_day_patch (begp:endp)) ; this%t_veg_day_patch (:) = spval allocate(this%t_veg_night_patch (begp:endp)) ; this%t_veg_night_patch (:) = spval @@ -218,9 +211,6 @@ subroutine InitAllocate(this, bounds) allocate(this%t_sunw_inner_lun (begl:endl)) ; this%t_sunw_inner_lun (:) = nan allocate(this%t_shdw_inner_lun (begl:endl)) ; this%t_shdw_inner_lun (:) = nan allocate(this%t_floor_lun (begl:endl)) ; this%t_floor_lun (:) = nan -!KO - allocate(this%t_skin_lun (begl:endl)) ; this%t_skin_lun (:) = nan -!KO allocate(this%snot_top_col (begc:endc)) ; this%snot_top_col (:) = nan allocate(this%dTdz_top_col (begc:endc)) ; this%dTdz_top_col (:) = nan allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan @@ -397,16 +387,10 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='vegetation temperature', & ptr_patch=this%t_veg_patch) -!KO this%t_skin_patch(begp:endp) = spval call hist_addfld1d(fname='TSKIN', units='K', & avgflag='A', long_name='skin temperature', & ptr_patch=this%t_skin_patch, c2l_scale_type='urbans') -! this%t_skin_lun(begl:endl) = spval -! call hist_addfld1d(fname='TSKIN', units='K', & -! avgflag='A', long_name='skin temperature', & -! ptr_lun=this%t_skin_patch, set_nourb=spval, l2g_scale_type='unity') -!KO this%t_grnd_col(begc:endc) = spval call hist_addfld1d (fname='TG', units='K', & diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index b481b60178..640c3038d3 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -660,22 +660,13 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! ============================================================================ call t_startf('bgp2') -!KO call SoilFluxes(bounds_clump, & -!KO filter(nc)%num_urbanl, filter(nc)%urbanl, & -!KO filter(nc)%num_nolakec, filter(nc)%nolakec, & -!KO filter(nc)%num_nolakep, filter(nc)%nolakep, & -!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & -!KO energyflux_inst, waterflux_inst) -!KO call SoilFluxes(bounds_clump, & filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & filter(nc)%num_urbanp, filter(nc)%urbanp, & filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_nolakep, filter(nc)%nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & - energyflux_inst, waterflux_inst, urbanparams_inst) -!KO + energyflux_inst, waterflux_inst) call t_stopf('bgp2') ! ============================================================================ From 5272865da0cd79a03f6dcc8edbdbeede6b58317e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 11 Jun 2018 15:36:30 -0600 Subject: [PATCH 059/144] Start a document of design notes Eventually we may want to have multiple files here. But I'm not sure what organization we'll want in the end, so for now I'm starting with a single file. --- doc/design_docs/design_docs.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/design_docs/design_docs.rst diff --git a/doc/design_docs/design_docs.rst b/doc/design_docs/design_docs.rst new file mode 100644 index 0000000000..6d2a355867 --- /dev/null +++ b/doc/design_docs/design_docs.rst @@ -0,0 +1,17 @@ +.. sectnum:: + +.. contents:: + +============================================================= + Use of Init method rather than constructor for most classes +============================================================= + +Most of the object-oriented classes in CTSM (and particularly the science-focused classes) +are initialized with a method named ``Init``, rather than the more standard +object-oriented pattern of using a constructor. This is largely for historical reasons: +Object initialization was done this way when object orientation was first introduced to +CESM (possibly because of compiler bugs that prevented the general use of constructors for +this purpose?). As more object orientation was added, we continued to use an ``Init`` +method for this purpose to remain consistent with existing code. + +At this point, we could probably refactor this to use constructors. From ad8a058e0a8d4cb9ed90d501da9930d522fe1b53 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 13 Jun 2018 16:44:54 -0600 Subject: [PATCH 060/144] First version of multiple issue templates Copied from my work here: https://github.com/billsacks/ctsm-github-multiple-issue-templates/issues --- .github/ISSUE_TEMPLATE.md | 21 ----------------- .github/ISSUE_TEMPLATE/01_bug_report.md | 25 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/02_support_needed.md | 23 +++++++++++++++++++ .github/ISSUE_TEMPLATE/03_other.md | 7 ++++++ 4 files changed, 55 insertions(+), 21 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/01_bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/02_support_needed.md create mode 100644 .github/ISSUE_TEMPLATE/03_other.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index a6f3fa765b..0000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,21 +0,0 @@ -### General Type of Issue: -Some example types are: -- bug -- enhancement -- question - -### Details of Issue: -(Be sure to give enough details that the issue can be understood sufficiently -to replicate or to make the required changes) - -### For bugs fill out the following: (Otherwise remove, and remove any prompts that aren't useful) ------------------------------------------------------------------ -#### Important Details of your setup/configuration (compset, settings, etc.): - -#### Important output or errors that show the problem: - -#### What is the CTSM version you are using (output of git describe)?: - -#### What is the machine you are running on:? - ------------------------------------------------------------------ diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md new file mode 100644 index 0000000000..b03c77171d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Report a problem with the code + +--- + +### General bug information + +**CTSM version you are using:** [output of `git describe`] + +**Does this bug cause significantly incorrect results in the model's science?** [Yes / No] + +**Configurations affected:** [Fill this in if known.] + +### Details of bug + +[Fill in details here.] + +### Important details of your setup / configuration so we can reproduce the bug + +[Specify anything relevant: the compset, resolution, machine, compiler, any xml or namelist changes, etc. You don't have to repeat anything that you have already noted above.] + +### Important output or errors that show the problem + +[Fill this in with anything relevant that you haven't already noted; if there is nothing to add, delete this section.] diff --git a/.github/ISSUE_TEMPLATE/02_support_needed.md b/.github/ISSUE_TEMPLATE/02_support_needed.md new file mode 100644 index 0000000000..470b82fd45 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_support_needed.md @@ -0,0 +1,23 @@ +--- +name: Support needed +about: If you need help from other CTSM developers and users + +--- + +### Details of support request + +[Fill in details here.] + +### Important details of your setup / configuration so we can better assist you + +**CTSM version you are using:** [output of `git describe`] + +**If you are having problems with a specific case: Is your case on a machine accessible to most CTSM developers (e.g., an NCAR machine)?** [Yes / No] + +If Yes: + +- Location of case directory: [Fill this in] + +- Location of run directory: [Fill this in] + +If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files. diff --git a/.github/ISSUE_TEMPLATE/03_other.md b/.github/ISSUE_TEMPLATE/03_other.md new file mode 100644 index 0000000000..3c7e2828b2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03_other.md @@ -0,0 +1,7 @@ +--- +name: Other +about: Other issues (enhancement, cleanup, documentation, discussion, etc.) + +--- + + From e82e8672549fe27d07d10849983aaab1a9304dde Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 13 Jun 2018 16:50:33 -0600 Subject: [PATCH 061/144] Make it clear that testing isn't a prerequisite for submitting a PR Suggested by Rosie Fisher --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 422365325c..4f0dbc9ccb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,7 +8,7 @@ Are answers expected to change (and if so in what way)? Any User Interface Changes (namelist or namelist defaults changes)? -Testing performed: +Testing performed, if any: (List what testing you did to show your changes worked as expected) (This can be manual testing or running of the different test suites) From 6870bc86bd78502de91456376352f8715faa4728 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 13 Jun 2018 16:52:10 -0600 Subject: [PATCH 062/144] Ask for other contributors Suggested by Mike Barlage --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4f0dbc9ccb..41356aa0f5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,8 @@ ### Specific notes +Contributors other than yourself, if any: + CTSM Issues Fixed (include github issue #): Are answers expected to change (and if so in what way)? From d41d0bb8e3642f1047dbfd2f6fc13f444a5986cc Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 13 Jun 2018 16:57:46 -0600 Subject: [PATCH 063/144] Explicitly call out science discussion as an issue type Rosie Fisher suggests explicitly calling this out so people know they can use issues in this way (even though it doesn't have its own template). --- .github/ISSUE_TEMPLATE/03_other.md | 7 ------- .github/ISSUE_TEMPLATE/03_science_discussion.md | 7 +++++++ .github/ISSUE_TEMPLATE/04_other.md | 7 +++++++ 3 files changed, 14 insertions(+), 7 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/03_other.md create mode 100644 .github/ISSUE_TEMPLATE/03_science_discussion.md create mode 100644 .github/ISSUE_TEMPLATE/04_other.md diff --git a/.github/ISSUE_TEMPLATE/03_other.md b/.github/ISSUE_TEMPLATE/03_other.md deleted file mode 100644 index 3c7e2828b2..0000000000 --- a/.github/ISSUE_TEMPLATE/03_other.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Other -about: Other issues (enhancement, cleanup, documentation, discussion, etc.) - ---- - - diff --git a/.github/ISSUE_TEMPLATE/03_science_discussion.md b/.github/ISSUE_TEMPLATE/03_science_discussion.md new file mode 100644 index 0000000000..25f47ff601 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03_science_discussion.md @@ -0,0 +1,7 @@ +--- +name: Science discussion +about: We encourage the use of issues to discuss CTSM science developments + +--- + + diff --git a/.github/ISSUE_TEMPLATE/04_other.md b/.github/ISSUE_TEMPLATE/04_other.md new file mode 100644 index 0000000000..61898d3a75 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/04_other.md @@ -0,0 +1,7 @@ +--- +name: Other +about: Other issues (enhancement, cleanup, documentation, etc.) + +--- + + From 6d4c46a4e550b63c720722ae34a66bea5bbd96f2 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 13 Jun 2018 17:06:28 -0600 Subject: [PATCH 064/144] Update "support needed" template Based on feedback from CTSM meeting --- .github/ISSUE_TEMPLATE/02_support_needed.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/02_support_needed.md b/.github/ISSUE_TEMPLATE/02_support_needed.md index 470b82fd45..b2c0b7ad96 100644 --- a/.github/ISSUE_TEMPLATE/02_support_needed.md +++ b/.github/ISSUE_TEMPLATE/02_support_needed.md @@ -1,6 +1,6 @@ --- -name: Support needed -about: If you need help from other CTSM developers and users +name: Support needed for model use +about: Ask for help with using CTSM --- @@ -12,6 +12,11 @@ about: If you need help from other CTSM developers and users **CTSM version you are using:** [output of `git describe`] + +**Have you made any modifications to code, xml files, etc.?** [Yes / No] + +[If Yes: Please point us to your modifications] + **If you are having problems with a specific case: Is your case on a machine accessible to most CTSM developers (e.g., an NCAR machine)?** [Yes / No] If Yes: @@ -20,4 +25,4 @@ If Yes: - Location of run directory: [Fill this in] -If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files. +[If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files.] From 046b00fc38511461b62467dd97a2d1a0eb53e703 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 14 Jun 2018 14:28:50 -0600 Subject: [PATCH 065/144] Suggest opening an issue rather than contacting ctsm-software Following Joe Hamman's suggestion Also, fix some typos --- CONTRIBUTING.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ddcfdf1702..1772529c43 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,12 @@ ## How to contribute: -It's recommended that you first contact ctsm-software@ucar.edu to discuss the changes or additions that you propose. -Work with them to think about the design and implemention of the changes as well as the planning -and scheduling for the change to come into CTSM. +We recommend that you first open an issue (https://github.com/escomp/ctsm/issues/) to +discuss the changes or additions that you propose. Through the issue discussion, you can +work with other CTSM developers to think about the design and implementation of the changes +as well as the planning and scheduling for the change to come into CTSM. -It's also recommened that you join the ctsm-dev@ucar.edu google groups in order -to be informed about the science that is happening in CTSM as well as the latest develepments and tags. +We also recommend that you join the ctsm-dev@ucar.edu google groups in order +to be informed about the science that is happening in CTSM as well as the latest developments and tags. The ctsm-dev group is here: https://groups.google.com/a/ucar.edu/forum/#!forum/ctsm-dev From 2f7fcdbbad928573747c6985800514092a581a38 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 21 Jun 2018 14:57:33 -0600 Subject: [PATCH 066/144] Update 02_support_needed.md Add some more caveats for our ability to help and also point to documentation to look at. --- .github/ISSUE_TEMPLATE/02_support_needed.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/02_support_needed.md b/.github/ISSUE_TEMPLATE/02_support_needed.md index b2c0b7ad96..fb74fac008 100644 --- a/.github/ISSUE_TEMPLATE/02_support_needed.md +++ b/.github/ISSUE_TEMPLATE/02_support_needed.md @@ -1,8 +1,15 @@ --- name: Support needed for model use about: Ask for help with using CTSM +[NOTE: We have limited staff and ability to provide support!] --- +### NOTE: Be sure to read the relevant documentation and user forums: +- User's Guide: https://escomp.github.io/ctsm-docs/doc/build/html/users_guide/index.html +- CLM Forum: https://bb.cgd.ucar.edu/forums/land-modeling-clm +- README files amongst the source code. +- GitHub CTSM issues: +- Also make sure this issue is unique to CTSM and not really an issue with CESM or CIME. ### Details of support request @@ -15,7 +22,8 @@ about: Ask for help with using CTSM **Have you made any modifications to code, xml files, etc.?** [Yes / No] -[If Yes: Please point us to your modifications] +* [If Yes: Please point us to your modifications] +* [If Yes, ALSO NOTE: In general we can NOT support problems with modified code. Try to show the problem without modifications.] **If you are having problems with a specific case: Is your case on a machine accessible to most CTSM developers (e.g., an NCAR machine)?** [Yes / No] @@ -25,4 +33,5 @@ If Yes: - Location of run directory: [Fill this in] -[If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files.] +* [If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files.] +* [If No, ALSO NOTE: We are less likely to be able to reproduce your problem if the issue is NOT on an NCAR machine] From 478d0ecb50d174e79b4887f4c0d73f5847166348 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 21 Jun 2018 15:02:32 -0600 Subject: [PATCH 067/144] Update CONTRIBUTING.md Add as an alternative to send email. Some people would rather start with an email, rather than open a fully public issue. We should allow either one. The main point is to get it as early as possible. --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1772529c43..42bf914082 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,9 @@ We recommend that you first open an issue (https://github.com/escomp/ctsm/issues/) to discuss the changes or additions that you propose. Through the issue discussion, you can work with other CTSM developers to think about the design and implementation of the changes -as well as the planning and scheduling for the change to come into CTSM. +as well as the planning and scheduling for the change to come into CTSM. An alternative is to +contact the key software and science developers via ctsm-software@ucar.edu. The sooner those +contacts are made the better and more likely your development can come into CTSM. We also recommend that you join the ctsm-dev@ucar.edu google groups in order to be informed about the science that is happening in CTSM as well as the latest developments and tags. From 0c2706797b217a49199ea69b5488b18ddc081aef Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 21 Jun 2018 15:10:44 -0600 Subject: [PATCH 068/144] Update PULL_REQUEST_TEMPLATE.md Add a couple more notes about testing. --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 41356aa0f5..36a87f49f1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,6 +13,8 @@ Any User Interface Changes (namelist or namelist defaults changes)? Testing performed, if any: (List what testing you did to show your changes worked as expected) (This can be manual testing or running of the different test suites) +(Documentation on system testing is here: https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide) +(aux_clm on cheyenne for gnu/pgi and hobart for gnu/pgi/nag is the standard for tags on master) **NOTE: Be sure to check your Coding style against the standard:** https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines From 2cfe3cb796e6d6e4f9b80a980e3c66af978348c8 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 21 Jun 2018 16:40:54 -0600 Subject: [PATCH 069/144] Tweak support needed issue template Important change: Take a note out of the yaml header (because this prevented the issue template from being usable). In addition: some formatting tweaks to make things appear better when the issue is rendered (e.g., with "preview"). --- .github/ISSUE_TEMPLATE/02_support_needed.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/02_support_needed.md b/.github/ISSUE_TEMPLATE/02_support_needed.md index fb74fac008..d3c69aaf6a 100644 --- a/.github/ISSUE_TEMPLATE/02_support_needed.md +++ b/.github/ISSUE_TEMPLATE/02_support_needed.md @@ -1,15 +1,17 @@ --- name: Support needed for model use about: Ask for help with using CTSM -[NOTE: We have limited staff and ability to provide support!] --- -### NOTE: Be sure to read the relevant documentation and user forums: + +### NOTE: Be sure to read the relevant documentation and user forums + +We have limited staff and ability to provide support. Here are some resources that might provide help: - User's Guide: https://escomp.github.io/ctsm-docs/doc/build/html/users_guide/index.html - CLM Forum: https://bb.cgd.ucar.edu/forums/land-modeling-clm -- README files amongst the source code. -- GitHub CTSM issues: -- Also make sure this issue is unique to CTSM and not really an issue with CESM or CIME. +- README files amongst the source code +- GitHub CTSM issues: https://github.com/escomp/ctsm/issues/ +- Also make sure this issue is unique to CTSM and not really an issue with CESM or CIME ### Details of support request @@ -19,11 +21,9 @@ about: Ask for help with using CTSM **CTSM version you are using:** [output of `git describe`] - **Have you made any modifications to code, xml files, etc.?** [Yes / No] -* [If Yes: Please point us to your modifications] -* [If Yes, ALSO NOTE: In general we can NOT support problems with modified code. Try to show the problem without modifications.] +[If Yes: Please point us to your modifications. However: In general we can NOT support problems with modified code. Try to show the problem without modifications.] **If you are having problems with a specific case: Is your case on a machine accessible to most CTSM developers (e.g., an NCAR machine)?** [Yes / No] @@ -33,5 +33,4 @@ If Yes: - Location of run directory: [Fill this in] -* [If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files.] -* [If No, ALSO NOTE: We are less likely to be able to reproduce your problem if the issue is NOT on an NCAR machine] +[If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files. However: We are less likely to be able to reproduce your problem if the issue is NOT on an NCAR machine.] From 47f0d78712cc46f6da0ec312d6f1a13ba900b944 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 21 Jun 2018 16:51:28 -0600 Subject: [PATCH 070/144] Reword a grammatically-incorrect sentence --- CONTRIBUTING.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 42bf914082..70bf041ba7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,9 +3,10 @@ We recommend that you first open an issue (https://github.com/escomp/ctsm/issues/) to discuss the changes or additions that you propose. Through the issue discussion, you can work with other CTSM developers to think about the design and implementation of the changes -as well as the planning and scheduling for the change to come into CTSM. An alternative is to -contact the key software and science developers via ctsm-software@ucar.edu. The sooner those -contacts are made the better and more likely your development can come into CTSM. +as well as the planning and scheduling for the change to come into CTSM. An alternative is +to contact the key software and science developers via ctsm-software@ucar.edu. Making +contact early in your project will increase the likelihood that your developments can come +into CTSM. We also recommend that you join the ctsm-dev@ucar.edu google groups in order to be informed about the science that is happening in CTSM as well as the latest developments and tags. @@ -44,4 +45,4 @@ Code conventions: https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines #### Code of Conduct: -See the "CODE_OF_CONDUCT.md" file for expectations of how to work in the community. +See the `CODE_OF_CONDUCT.md` file for expectations of how to work in the community. From 71aa93394c04b9e39e614797e91abcf1e776523c Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 22 Jun 2018 06:12:50 -0600 Subject: [PATCH 071/144] Add missing --append flag to decStart xmlchange command --- cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands b/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands index 3000705067..f3e89bb4fa 100755 --- a/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands @@ -1,2 +1,2 @@ ./xmlchange RUN_STARTDATE=2001-12-30 -./xmlchange CLM_BLDNML_OPTS=-ignore_warnings +./xmlchange CLM_BLDNML_OPTS=-ignore_warnings --append From 3e03d656e2bbc34158cc005d2e9bb53a13f972e0 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 22 Jun 2018 06:43:33 -0600 Subject: [PATCH 072/144] Remove a test from the expected fail list This test was failing sporadically in the past, but I haven't seen it fail since the cime update, so I'm tentatively removing it from the expected fail list and closing the related issue. --- cime_config/testdefs/ExpectedTestFails.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index a671a234cf..ab3e96aaac 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -5,7 +5,6 @@ FAIL ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN - FAIL ERS_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_gnu.clm-default COMPARE_base_rest FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN From 3996cf70421cd7db252ce3baf794d1921e06cdf7 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 22 Jun 2018 06:50:44 -0600 Subject: [PATCH 073/144] Fix UpdateChangelog.pl to expect ctsm rather than clm tag names --- doc/UpdateChangelog.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/UpdateChangelog.pl b/doc/UpdateChangelog.pl index 58e0165bcf..88f8331d03 100755 --- a/doc/UpdateChangelog.pl +++ b/doc/UpdateChangelog.pl @@ -41,7 +41,7 @@ sub usage { To document a new tag - $ProgName clm4_5_2_r097 "Description of this tag" + $ProgName ctsm1.0.dev012 "Description of this tag" EOF } @@ -67,7 +67,7 @@ sub usage { $tag = $ARGV[0]; $sum = $ARGV[1]; - if ( $tag !~ /clm[0-9]\.[0-9]\.(dev[0-9][0-9][0-9]|[0-9][0-9])/ ) { + if ( $tag !~ /ctsm[0-9]\.[0-9]\.(dev[0-9][0-9][0-9]|[0-9][0-9])/ ) { print "ERROR: bad tagname: $tag\n"; usage(); } @@ -137,7 +137,7 @@ sub usage { my $oldTag = ""; while( $_ = ) { # If adding a new tag check that new tag name does NOT match any old tag - if ( $_ =~ /Tag name:[ ]*(clm.+)/ ) { + if ( $_ =~ /Tag name:[ ]*(ctsm.+)/ ) { $oldTag = $1; if ( (! $opts{'update'}) && ($tag eq $oldTag) ) { close( CL ); From 23e61dc08b04cf04645f087dadaa369ac1fd38a3 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 22 Jun 2018 07:32:39 -0600 Subject: [PATCH 074/144] Update ChangeLog; move old ChangeLog to clm5_0_ChangeLog Also, delete ChangeLog_branch, which gave a detailed breakdown of changes on this branch, including answer changes of each piece. --- ChangeLog_branch | 1139 ------------------------ ChangeLog_branch_template | 83 -- doc/ChangeLog | 1767 +++---------------------------------- doc/ChangeSum | 1 + doc/clm5_0_ChangeLog | 1742 ++++++++++++++++++++++++++++++++++++ 5 files changed, 1868 insertions(+), 2864 deletions(-) delete mode 100644 ChangeLog_branch delete mode 100644 ChangeLog_branch_template create mode 100644 doc/clm5_0_ChangeLog diff --git a/ChangeLog_branch b/ChangeLog_branch deleted file mode 100644 index c2a74feb63..0000000000 --- a/ChangeLog_branch +++ /dev/null @@ -1,1139 +0,0 @@ -=============================================================== -Tag name: unified_land_model_n12_clm4_5_16_r249 (3f9624be) -Originator(s): sacks -Date: Dec 28, 2017 -One-line Summary: Edit old ChangeLog entries - -Purpose of changes ------------------- - -Change ctsm_* to unified_land_model_* in tag names in ChangeLog - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: NONE - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M ChangeLog_branch - -=============================================================== -=============================================================== -Tag name: unified_land_model_n11_clm4_5_16_r249 (6057e1cd) -Originator(s): sacks -Date: Sep 18, 2017 -One-line Summary: Remove infiltration excess runoff for VIC - -Purpose of changes ------------------- - -Martyn Clark reviewed the VIC implementation, and felt that the current -implementation of infiltration excess runoff is inconsistent with the -standard VIC implementation. It appears that what was being called VIC's -infiltration excess runoff was actually just an attempt to give a better -numerical approximation to the solution for saturated surface excess -runoff. So deleting this leaves only a first-order approximation to -VIC's saturated surface excess runoff. - -Eventually we may want to put in place a more accurate solution for -VIC's saturated surface excess runoff. But Martyn's feeling is that this -can come in with other changes we want to make regarding numerical -solutions in CTSM. - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu - ok - cheyenne_intel - ok - hobart_nag - ok - hobart_pgi - ok - hobart_intel - ok - - ok means tests pass, Vic tests change answers as expected - -CLM tag used for the baseline comparisons: unified_land_model_n10_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Compsets with Vic - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; likely same climate but not investigated - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 -M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n10_clm4_5_16_r249 (02e535c6) -Originator(s): sacks -Date: Sep 14, 2017 -One-line Summary: Truncate small h2osfc values to zero - -Purpose of changes ------------------- - -This replaces the earlier code that only did this truncation in one -particular circumstance. - -This seems mainly important to truncate small negative numbers to 0, but -it also seems like a good idea to truncate small positive numbers that -should have been 0. - -With some intermediate commits on this branch, I did some careful tests -to ensure that these diffs introduce no more than roundoff-level -changes. - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu - ok - cheyenne_intel - ok - hobart_nag - ok - hobart_pgi - ok - hobart_intel - ok - - ok means tests pass, change answers as expected - -CLM tag used for the baseline comparisons: unified_land_model_n09_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all clm45/clm50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - I introduced some temporary code to ensure that, where there are - differences between the old and new code, these differences are - only roundoff-level (e.g., a roundoff-level value being rounded to - 0 now where it wasn't before). - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= New utility for truncating small values to 0, and associated - unit tests -A components/clm/src/utils/NumericsMod.F90 -A components/clm/src/utils/test/numerics_test/CMakeLists.txt -A components/clm/src/utils/test/numerics_test/test_truncate_small_values.pf - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/biogeophys/SoilHydrologyMod.F90 - -========= New unit tests -M components/clm/src/utils/CMakeLists.txt -M components/clm/src/utils/test/CMakeLists.txt - -========= Unrelated fix to subroutine name -M components/clm/src/unit_test_shr/unittestFilterBuilderMod.F90 - -========= Shorten a test that was taking > 2 hours -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: unified_land_model_n09_clm4_5_16_r249 (92edec11) -Originator(s): sacks -Date: Sep 7, 2017 -One-line Summary: Use full qflx_surf in BGC code - -Purpose of changes ------------------- - -We had been using a separate variable to avoid changing answers. But -Dave Lawrence gave his approval to change this. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu - ok - cheyenne_intel - ok - hobart_nag - ok - hobart_pgi - ok - hobart_intel - ok - - ok means tests pass, answers change as expected - -CLM tag used for the baseline comparisons: unified_land_model_n08_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All Bgc configurations - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated carefully; larger than roundoff, but expected to - be same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/biogeochem/ch4Mod.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n08_clm4_5_16_r249 (72070e76) -Originator(s): sacks -Date: Aug 24, 2017 -One-line Summary: Finish Infiltration modularization - mainly h2osfc updates - -Purpose of changes ------------------- - -Finish the modularization of subroutine Infiltration. The main focus here is -modularizing the calculation of fluxes out of h2osfc and the updates of the -h2osfc state variable. Flux calculations and state updates are now done -separately. Where a flux calculation depends on a partially-updated version of -h2osfc, this is now made explicit in a way that could facilitate removing this -partial update later. - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu - pass - cheyenne_intel - pass - hobart_nag - pass - hobart_pgi - pass - hobart_intel - pass - -CLM tag used for the baseline comparisons: unified_land_model_n07_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 - -========= Tweak some comments based on feedback on - https://github.com/NCAR/clm-ctsm/pull/2 -M components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 -M components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n07_clm4_5_16_r249 (1479a4c7) -Originator(s): sacks -Date: Aug 22, 2017 -One-line Summary: Rename things related to saturated surface runoff - -Purpose of changes ------------------- - -Renames the module, derived type, variables and methods related to saturated -surface runoff. The rename qflx_sat_surf -> qflx_sat_excess_surf was suggested -at a ctsm meeting. The other renames are to be consistent with that and -consistent with InfiltrationExcessRunoffMod. - -Also, remove a long yellowstone test, change PE count for cheyenne: Removing -this long test that sometimes exceeds the 2-hour limit I give it (other times it -takes just slightly less than 2 hours): -ERS_Ly5_P60x1.f10_f10_musgs.IHistClm50BgcCrop.yellowstone_intel.clm-cropMonthOutput. We -still have an identical test on cheyenne. Also, increase the PE count on -cheyenne to use two full nodes, rather than a partial node. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu - pass - cheyenne_intel - pass - hobart_nag - pass - hobart_pgi - pass - hobart_intel - pass - -CLM tag used for the baseline comparisons: unified_land_model_n06_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: - -========= Renamed -D components/clm/src/biogeophys/SurfRunoffSatMod.F90 - -List all files added and what they do: - -========= Renamed -A components/clm/src/biogeophys/SaturatedExcessRunoffMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Renames -M components/clm/src/biogeochem/CNDriverMod.F90 -M components/clm/src/biogeochem/CNFireBaseMod.F90 -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -M components/clm/src/biogeochem/CNFireMethodMod.F90 -M components/clm/src/biogeochem/CNFireNoFireMod.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/clm_instMod.F90 - -========= Remove a yellowstone test, tweak a cheyenne test, as described above -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: unified_land_model_n06_clm4_5_16_r249 (7e1bcd5c) -Originator(s): sacks -Date: Aug 21, 2017 -One-line Summary: Modularization of Infiltration - first stage - -Purpose of changes ------------------- - -Separate out the first 3 steps of subroutine Infiltration into more modular -homes. The biggest piece of this is to introduce a new -InfiltrationExcessRunoffMod.F90; this will be where alternative -parameterizations of infiltration excess runoff can be put. - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu - pass - cheyenne_intel - pass - hobart_nag - pass - hobart_pgi - pass - hobart_intel - pass - - NOTE: Most tests were run on 24913d0. On the final commit (afdbcf7), I ran - only the following tests: - - These test failed without the fix in afdbcf7, so I reran them with that fix: - - ERP_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.yellowstone_intel.clm-allActive - ERP_D_P15x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.yellowstone_intel.clm-cropColdStart - ERP_P180x2_D_Ld5.f19_g17.I2000Clm50BgcDvCrop.yellowstone_pgi.clm-crop - ERP_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-allActive - ERP_D_P15x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-cropColdStart - - This is the only oldhyd test, and so is the only test that should be - affected by this change: - - SMS_D_Ld1_P24x1.f10_f10_musgs.I2000Clm45BgcCrop.hobart_nag.clm-oldhyd - -CLM tag used for the baseline comparisons: unified_land_model_n05_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Holds the portion of subroutine Infiltration that actually computes - the infiltration excess runoff flux. New parameterizations of - infiltration excess runoff should be put here. -A components/clm/src/biogeophys/InfiltrationExcessRunoffMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/clm_instMod.F90 - -========= Just add a comment -M components/clm/src/biogeophys/SurfRunoffSatMod.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n05_clm4_5_16_r249 (7b26ad55) -Originator(s): sacks -Date: Aug 17, 2017 -One-line Summary: Re-parenthesize a VIC equation - -Purpose of changes ------------------- - -With an upcoming refactoring, answers change for VIC. The minor change here -forces the answer change to happen with this simple re-parenthesization, which I -think will allow us to avoid the answer changes in the upcoming refactoring. - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - just ran vic tests - yellowstone_pgi - just ran vic tests - yellowstone_gnu - not run - cheyenne_intel - just ran vic tests - hobart_nag - not run - hobart_pgi - not run - hobart_intel - not run - - Just ran the following vic tests (all of the vic tests in the test list): - - ERP_D_Ld5.f09_g17.I2000Clm50Vic.yellowstone_intel.clm-vrtlay - ERP_Ld5.f09_g17.I2000Clm50Vic.yellowstone_pgi.clm-vrtlay - ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_intel.clm-vrtlay - ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_pgi.clm-decStart - SMS_Ld1.f19_g17.I2000Clm50Vic.yellowstone_intel.clm-default - ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay - ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_intel.clm-vrtlay - SMS_Ld1.f19_g17.I2000Clm50Vic.cheyenne_intel.clm-default - -CLM tag used for the baseline comparisons: unified_land_model_n04_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Vic configurations - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated closely, but should just be roundoff-level - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/SoilHydrologyMod.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n04_clm4_5_16_r249 (46e33419) -Originator(s): sacks -Date: July 14, 2017 -One-line Summary: Extract SurfaceRunoff to its own module and related modularization - -Up-to-date with branch tag: modularize_surface_runoff_n02_unified_land_model_n02_clm4_5_16_r249 - -Purpose of changes ------------------- - -Major change is extracting SurfaceRunoff to its own module, SurfRunoffSatMod.F90 - -Also, some related modularization: -- Move urban surface runoff code into different routines -- Extract a subroutine for each fsat method -- Other minor refactoring - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu - pass - cheyenne_intel - pass - hobart_nag - pass - hobart_pgi - pass - hobart_intel - pass - -CLM tag used for the baseline comparisons: unified_land_model_n03_clm4_5_16_r249 -Answer changes --------------- - -Changes answers relative to baseline: NO - bfb - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= New class containing what used to be the core of subroutine - SurfaceRunoff -A components/clm/src/biogeophys/SurfRunoffSatMod.F90 - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/SoilHydrologyType.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -M components/clm/src/biogeochem/CNFireBaseMod.F90 -M components/clm/src/biogeochem/CNFireMethodMod.F90 -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 -M components/clm/src/biogeochem/CNFireNoFireMod.F90 -M components/clm/src/main/clm_instMod.F90 -M components/clm/src/main/clm_driver.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n03_clm4_5_16_r249 (0252134a) -Originator(s): sacks -Date: July 13, 2017 -One-line Summary: Separate qflx_surf updates into two steps - -Up-to-date with branch tag: modularize_surface_runoff_n01_unified_land_model_n02_clm4_5_16_r249 - -Purpose of changes ------------------- - -Separate qflx_surf updates into two steps - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu - ok - cheyenne_intel - ok - hobart_nag - ok - hobart_pgi - ok - hobart_intel - ok - - ok means tests pass, answers change as expected - -CLM tag used for the baseline comparisons: unified_land_model_n02_clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - There are greater than roundoff-level changes in the diagnostic field - QOVER, because this field now includes QH2OSFC. Other than that, there are - just roundoff-level differences in runoff. Sometimes, these roundoff-level - runoff changes can feed back to create greater-than-roundoff level changes - over time. This happens for ch4-related fields, and for many fields in - this test with flooding: - ERP_P180x2_D.f19_g17.I2000Clm50SpRtmFl.yellowstone_pgi.clm-default - - Note that the oldhyd test is bit-for-bit: - SMS_D_Ld1_P24x1.f10_f10_musgs.I2000Clm45BgcCrop.hobart_nag.clm-oldhyd - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeochem/ch4Mod.F90 -M components/clm/src/main/ColumnType.F90 -M components/clm/src/main/lnd2atmType.F90 -M components/clm/src/main/initSubgridMod.F90 -M components/clm/src/main/lnd2atmMod.F90 -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 -M components/clm/src/cpl/lnd_import_export.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n02_clm4_5_16_r249 (b6191a1f) -Originator(s): sacks -Date: July 11, 2017 -One-line Summary: BFB refactorings towards modularization of SurfaceRunoff - -Purpose of changes ------------------- - -BFB refactorings towards modularization of SurfaceRunoff - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu - pass - cheyenne_intel - pass - hobart_nag - pass - hobart_pgi - pass - hobart_intel - pass - -CLM tag used for the baseline comparisons: unified_land_model_n01_clm4_5_16_r249 for VIC -tests, clm4_5_16_r249 for non-VIC tests - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bfb - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/SoilHydrologyType.F90 -M components/clm/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n01_clm4_5_16_r249 (dfd3094c) -Originator(s): sacks -Date: July 7, 2017 -One-line Summary: If using VIC, don't use the TOPModel formulation for SurfaceRunoff ever - -Purpose of changes ------------------- - -The code was using the TOPModel-based formulation for SurfaceRunoff if -frost_table > zwt_perched. Sean Swenson felt this shouldn't be done, and -refactoring will be easier if VIC always uses the vic-looking formulation, so -I'm stopping applying this formulation when using VIC. - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - just ran vic tests - yellowstone_pgi - just ran vic tests - yellowstone_gnu - not run - cheyenne_intel - just ran vic tests - hobart_nag - not run - hobart_pgi - not run - hobart_intel - not run - - Just ran the following vic tests (all of the vic tests in the test list): - - ERP_D_Ld5.f09_g17.I2000Clm50Vic.yellowstone_intel.clm-vrtlay - ERP_Ld5.f09_g17.I2000Clm50Vic.yellowstone_pgi.clm-vrtlay - ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_intel.clm-vrtlay - ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.yellowstone_pgi.clm-decStart - SMS_Ld1.f19_g17.I2000Clm50Vic.yellowstone_intel.clm-default - ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay - ERP_D_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_intel.clm-vrtlay - SMS_Ld1.f19_g17.I2000Clm50Vic.cheyenne_intel.clm-default - -CLM tag used for the baseline comparisons: clm4_5_16_r249 - - For baseline comparisons, just spot-checked one test: - ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay - - This test changed answers - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Vic configurations - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; not investigated closely - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Track changes for this branch -A ChangeLog_branch_template -A ChangeLog_branch - -List all existing files that have been modified, and describe the changes: - -========= Changes as described above -M components/clm/src/biogeophys/SoilHydrologyMod.F90 - -=============================================================== -=============================================================== -Tag name: unified_land_model_n00_clm4_5_16_r249 (3889c97c) -Originator(s): sacks -Date: July 7, 2017 -One-line Summary: Baseline tag corresponding to clm4_5_16_r249 - -Purpose of changes ------------------- - -N/A - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: No additional testing beyond trunk tag - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: none - -=============================================================== diff --git a/ChangeLog_branch_template b/ChangeLog_branch_template deleted file mode 100644 index eb2375df86..0000000000 --- a/ChangeLog_branch_template +++ /dev/null @@ -1,83 +0,0 @@ -=============================================================== -Tag name: -Originator(s): -Date: -One-line Summary: - -Purpose of changes ------------------- - -[Fill this in with details] - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - - - unit-tests (components/clm/src): - - yellowstone - - - tools-tests (components/clm/test/tools): - - yellowstone - - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - - - regular tests (aux_clm): - - yellowstone_intel - - yellowstone_pgi - - yellowstone_gnu - - cheyenne_intel - - hobart_nag - - hobart_pgi - - hobart_intel - - -CLM tag used for the baseline comparisons: - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - - URL for LMWG diagnostics output used to validate new climate: - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -=============================================================== diff --git a/doc/ChangeLog b/doc/ChangeLog index 368d1742a0..0cbc486a62 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,1542 +1,149 @@ =============================================================== -Tag name: clm5.0.dev013 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Jun 12 13:46:31 MDT 2018 -One-line Summary: cleanup and update cime and cism - -Purpose of changes ------------------- - -Update cime and cism to newer versions used in release. These bring in some answer -changes. The cime version updates the orbit for 2000 compsets. The cism version -changes answers for two fields with NO_EVOLVE and more fields for EVOLVE. - -Fixes an important bug needed for use with Data Assimulation. Several changes -to testing. Adding wallclock as needed, changing a few compsets so science -supported compsets are used, added tput_tolerance to some tests known to be -variable. - -Many changes to the clm tools for creating input files. Added the version by -querying "git describe" and adding it as an attribute to NetCDF files. Changes -to get tools working, and tested. Also changed so that tools can be run in either -a CTSM checkout or a CESM checkout. - -Updated README files so they are accurate. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] - #188 -- Global PTCLM tools test fails - #187 -- PTCLM tools tests fail baseline comparisons due to a seg fault - #259 -- Most README files in ctsm are incorrect - #386 -- Shorten some currently very long debug tests - #387 -- Lots of testmods still set orb_iyear and orb_iyear_align - #388 -- Add "git describe" to input files that are created - #389 -- Post data-assimilation processing broken with multi-driver - #393 -- Increase wallclock - #399 -- minor format update needed in namelist_definition_clm4_5.xml - #402 -- Some smaller tests can be slow.. - #411 -- Refactor tools aren't useful anymore - #414 -- PTCLM tests aren't working - #415 -- mkprocdata_map tests aren't working because of bad return statement in script type: bug - other - #418 -- Path needs to be updated for getco2 script type: bug - other - -Known bugs found since the previous tag (include github issue ID): #404, #413, #414 - #404 -- Carbon balance error in decStart test just after new year - #413 -- Currently can't use DAV cluster to make mapping files - #414 -- With change in repo for fates, had to enter username/password four times - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Yes - Lengthen some of the wallclock times. Remove the 1850 test-mods that just change the orbit. - Change some of the compsets tested to cover the science supported compsets. - Allow decStart test modes to ignore errors, so Crop tests can run. Remove a very long debug test. - Add a setting for tput_tolerance for some tests that are shown to have a large variability. - Add a test mod for data assimulation. Remove some of the settings from the pauseResume test - as already done, or tested seperately in the DA test. - -Code reviewed by: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - hobart --- PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - hobart --- PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - hobart --- PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - hobart --- OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev012 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! Because of changes in cism and cime - - Summarize any changes to answers: - - what code configurations: All 2000 compsets and some cases with cism - - what platforms/compilers: All - - nature of change: similar climate - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, rtm, mosart, PTCLM - - cime to cime_cesm2_0_rel_03 (changes answers for 2000 cases because of change to orbit - cism to release-v2.1.01 (changes answers for two fields for NOEVOLVE and more fields for EVOLVE) - PTCLM to PTCLM2_180611 - - rtm and mosart changed to point to cesm2_0 release versions (identical to previous version) - -Pull Requests that document the changes (include PR ids): #398, #400, #407, #408, #417, #394 -(https://github.com/ESCOMP/ctsm/pull) - - #394 -- some final cleanup - #417 -- Make PR template questions less prominent - #408 -- Documentation updates - #407 -- Initial version of templates for contributing, PR's and issues - #400 -- Update CanopyStateType.F90 priority: high type: code cleanup/docs - #398 -- Allow first history tape to have other than one time point per file priority: high type: enhance - science - -=============================================================== -=============================================================== -Tag name: clm5.0.dev012 -Originator(s): sacks (Bill Sacks) -Date: Thu May 17 14:13:34 MDT 2018 -One-line Summary: Fixes for variable_year orbital mode - -Purpose of changes ------------------- - -Fixes for correctness and exact restartability with variable_year -orbital mode: - -(1) Update max day length (max_dayl) each time step, rather than just - updating it once in initialization - -(2) Update to a cime version that has a fix for datm, which updates the - orbital parameters (used for solar zenith angle-based interpolation) - each time step, rather than just once in initialization - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #379 (Problems with Hist decStart restart tests due to variable - orbital year) -- Fixes #260 (max daylength doesn't change over time for varying orbital - parameters) - -CIME Issues fixed (include issue #): -- ESMCI/cime#2598 (datm doesn't restart properly with variable year orbit) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Gave extra time to some tests so they would pass - -Code reviewed by: Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, some baselines fail as expected - - Also verified that this test (reported in #379) now passes: - ERS_D_P36x1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart - - Also verified that the ctsm code changes alone (without the cime - update) have the expected behavior in terms of baseline - passes/fails: - - FAIL SMS_D_Ld10.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE - Enters the second year - PASS SMS_D_Ld1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE - Stays in first year - PASS SMS_Lm1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-ciso_bombspike1963 BASELINE - Stays in first year - -CLM tag used for the baseline comparisons: clm5.0.dev011 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: multi-year runs with HIST compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff/same climate - - Bit-for-bit for runs with fixed orbital parameters (non-HIST - compsets) and for HIST runs that do not span multiple years. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: adds one commit that fixes ESMCI/cime#2598 - -Pull Requests that document the changes (include PR ids): -- #385 (Update max day length (max_dayl) each time step) - -=============================================================== -=============================================================== -Tag name: clm5.0.dev011 -Originator(s): erik (Erik Kluzek) -Date: Wed May 16 20:27:39 MDT 2018 -One-line Summary: 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing - -Purpose of changes ------------------- - -Update ndep file used for fully coupled 1850 cases to one being used in fully coupled -simulations. Update cism to latest release branch: release-v2.1.00. -Update PE layouts for f45, f09, f19. Turn BFBFLAG=TRUE for most CTSM testing. -Fix some issues with tools for batch submission. Remove a write statement for VIC -that was written a ridiculous amount of times. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #) #363 #374 #380 #382 #383: - #363 -- PE Layout - $374 -- Turn BFBFLAG on for testing (so PE layout changes won't appear to change answers) - #382 -- Write statement for VIC - $383 -- mkmapdata intel version - -Known bugs introduced in this tag (include github issue ID): #384 - #384 -- f09 resolution VIC test - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): PE layouts - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): ndep for clm50_cam6 forcing - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Added back tests - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev010 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes for some - - Summarize any changes to answers, i.e., - - what code configurations: all with cism, tests as BFBFLAG on - - what platforms/compilers: all - - nature of change: similar - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism - - cism to release-v2.1.00 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #381 -- 1850 fully coupled ndep update, update cism, update PE layouts, turn BFBFLAG on for testing - -=============================================================== -=============================================================== -Tag name: clm5.0.dev010 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue May 15 03:00:38 MDT 2018 -One-line Summary: Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit - -Purpose of changes ------------------- - -Update externals to version in cesm2.0.beta10. Add in f05 crop datasets. Add pauseResume for DART and a -test for it. Fix several issues required for CESM2.0. Add model_doi_url to history files. - -update cism to very latest -Add model_doi_url to history files -Update rtm, mosart -Changes answers because of change in orbit (for testing orbit was already updated for 1850 so will appear to not change answers) -Using cime5.6.6 - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #68 --- gnu compiler workaround - #364 -- crop f05 datasets - #362 -- svn checkout - #318 -- quadratic bug - #249 -- bypass balance checks for DART - #341 -- add model_doi_url - -CIME Issues fixed (include issue #): - -Known bugs introduced in this tag (include github issue ID): - #379 -- transient end-of-year exact restart issue - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - cime updates: - - manage_testlist was removed. - - Changes to matching behavior in env_mach_specific. - - New option to wait_for_tests. - - case.st_archive now has a --test option. - - New FORCE_BUILD_THREADED. - - New custom script option. - - env_archive.xml - - .case.run.sh file generated for E3SM. - - New selectors allowed for batch directives. - - Source code files beginning in test_ will be ignored in build. - - New prefix attribute available for batch directives. - - xmlquery will now accept derived attributes. - - Users may run on lawrencium lr3/lr2. - - In env_archive.xml. - - (cesm only) create_test and query_testlist now have --supported-only flag - - New allow_error attribute for module systems. - - check_input_data replace --svn-loc with --server and --protocal - - Some Tools with "acme" in the name now say "e3sm". - - env_archive.xml - - .case.run.sh file generated for E3SM. - - New selectors allowed for batch directives. - - Source code files beginning in test_ will be ignored in build. - - New prefix attribute available for batch directives. - - xmlquery will now accept derived attributes. - - Users may run on lawrencium lr3/lr2. - - In env_archive.xml. - - (cesm only) create_test and query_testlist now have --supported-only flag - - New allow_error attribute for module systems. - - check_input_data replace --svn-loc with --server and --protocal - - Some Tools with "acme" in the name now say "e3sm". - - cime_bisect changes. - - New XML variables, PAUSE_ACTIVE_XXX. - - module_lmod no longer a support module type. - - simple-py-prof sets PYTHONPATH for you, list_acme_tests assumes you want - to list tests - - jobid now added to CaseStatus case_submit entry. - -Splits GLC2OCN_RMAPNAME xml variable into - GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for - GLC2OCN_RMAPTYPE - - Better defaults for bless_test_results and compare_test_results. - - New bless_log file in baseline dirs. - - Allow multiple -m args to case.submit. Allows user to put email settings in .cime/config. - - New --retry option to create_test. - - Add --clean-depends to case.build, this argument can take a component list and will - clean all components if one is not provided. - - Some additional output from nl comp code in some cases - - --driver added to create_newcase, new _V$driver testopt. - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): - Crop f05 surface datasets - -Substantial timing or memory changes: Seems to be slower and require more memory - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - pause/resume is still under development. This works for DART DA as needed for CESm2.0 - -Changes to tests or testing: - Added new pauseResume test on cheyenne_intel - Remove some of the higher PE count tests on cheyenne_gnu and replace with cheyenne_intel - Lengthen wallclock for a few of the tests on cheyenne - Change I1850Clm50BgcSpinup test to f09 resolution so it will run - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev009 - - -Answer changes --------------- - -Changes answers relative to baseline: 1850 compsets change because orbit has been changed - - Summarize any changes to answers, i.e., - - what code configurations: 1850 compsets - - what platforms/compilers: all - - nature of change: 1850 orbit rather than 1990 - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, rtm, mosart, cism - - cime to cime5.6.6 - rtm to rtm1_0_66 - mosart to mosart1_0_31 - cism to cism2_1_54 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #377 -- update cime - #376 -- changes needed for DART - #372 -- Update manage_externals - -=============================================================== -=============================================================== -Tag name: clm5.0.dev009 -Originator(s): sacks (Bill Sacks) -Date: Thu May 10 13:48:32 MDT 2018 -One-line Summary: New init_interp method - -Purpose of changes ------------------- - -The main change in this tag is to introduce a new method for -init_interp. This is needed in order for subgrid areas to be the same in -initialization in runs with and without init_interp. - -The choice of init_interp method is controlled by a new namelist -variable, init_interp_method, whose documentation appears below: - - Method to use for init_interp. Only applies when use_init_interp = .true. - - 'general': The general-purpose method that can be used when changing - grids, configurations, etc. This starts off with subgrid areas taken - from the surface dataset. - - 'use_finidat_areas': This starts off with subgrid areas taken from the - input finidat file. This is needed to achieve bit-for-bit results in a - coupled case (where areas in initialization impact initial fields sent - to the atmosphere) (but using the 'general' method will typically have - only a very minor impact on results in this case). For this method to - work, the input finidat file needs to be at the same resolution as the - current configuration. So this is a less general form of - init_interp. However, it can be used when transitioning from a spinup - run to a transient run, or in other cases where the only difference is - in internal memory allocation. In order to catch possible problems, this - uses a different algorithm for finding the input point for each output - point, which ensures that each active output point is associated with - exactly one input point with the same latitude, longitude and type. This - method requires (a) the same grid for input and output, within roundoff; - (b) any non-zero-weight point in the input must have memory allocated - for it in this grid cell in the output (this will be satisfied if the - point is non-zero-weight on the surface dataset or if it's a point for - which we allocate memory even for zero-weight points); (c) any active - point in the output (based on the surface dataset and rules for - determining active points) must have a matching point in this grid cell - in the input. - -This tag also has some other changes: - -- Fixes #347 - endrun message behavior: needed for some of the new unit - tests - -- Fixes #345 - Add a cmip6_evolving_icesheet usermods directory: - unrelated, but folded in here for convenience of testing) - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #346: New mode of operation for init_interp: Copy subgrid areas, too -- #347: endrun message behavior -- #345: Add a cmip6_evolving_icesheet usermods directory - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable - init_interp_method - documented above. Default - behavior is the same as before ('general') - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Added a new test type, similar to LII, that covers the new init_interp behavior -- Removed some no-longer-needed tests with 'interp' testmods - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - tests pass, namelists differ as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - Unexpected baseline failures for these two tests that are in the - expected fail list for other reasons: - FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest - FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest - - Differences are just in some cism fields that I’m not concerned - about: roundoff-level differences in internal_time; big differences - in tempstag, uvel and vvel, but those fields don’t really make sense - in this configuration (and I have removed them in the latest CISM - tag). (Note that I did two runs of each of these tests from my - branch, and for both tests, the two runs had identical cism hist - files, so I don’t think this is a reproducibility problem.) - - -CLM tag used for the baseline comparisons: clm5.0.dev008 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #352 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev008 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Apr 27 13:28:41 MDT 2018 -One-line Summary: With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 - -Purpose of changes ------------------- - -Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #351 -- FATES external to https - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - -Code reviewed by: wweider, rfischer - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev007 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 BGC with FUN on - - what platforms/compilers: All - - nature of change: climate very nearly the same - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - rfisher case -- clm5_nbug_test_case ----- short f45 resolution - oleson case --- clm5_nbug_test_case ----- AD spinup f45 resolution - oleson case --- clm5_nbug_test_casepAD -- Post AD spinup f45 resolution - - URL for LMWG diagnostics output used to validate new climate: - http://webext.cgd.ucar.edu/I1850/clm5_nbug_test_casepAD/lnd/clm5_nbug_test_casepAD.281_300-clm5_nbug_control_casepAD.281_300/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates changed to https form rather than ssh - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #344 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev007 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Apr 24 14:50:19 MDT 2018 -One-line Summary: Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit - -Purpose of changes ------------------- - -Important updates in land-ice model (CISM) version used that changes answers. Fix some initial condition problems -with CLM5.0 cases. Update the FATES version to a new updated science version that hence changes answers. -Change the default orbit for testing of 1850 cases to use 1850 orbit rather than 1990. -Make sure to use f45_f45_g37 and not f45_f45 in test lists. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #313 -- Issues with initial condition files - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New IC file for clm5_0_CRUv7 - CLM5.0 finidat files choosen will be different for both GSWP3.1 and CRUNCEPv7 forcing - -Substantial timing or memory changes: No - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - When the cime version is updated the changes that make the 1850 orbit explicit in testing can be removed - -Changes to tests or testing: 1850 tests explicitly set a 1850 orbit, f45_f45 tests changed to include mask (f45_f45_mg37) - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev006 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes - - Summarize any changes to answers: - - what code configurations: All 1850 tests, all FATES, all with CISM, CLM50 initial conditions - - what platforms/compilers: All - - nature of change: Significant - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, cism - FATES to SCI_1.8.1_API_3.0.0 - cism to cism2_1_49 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #349 -- Update manage externals to manic_v1.1.3 - #348 -- Update FATES science version to 1.8.1, and bring in some answer changes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev006 -Originator(s): sacks (Bill Sacks) -Date: Thu Apr 12 06:16:16 MDT 2018 -One-line Summary: Don't allocate memory for zero-weight natveg patches and urban - -Purpose of changes ------------------- - -We have previously been allocating memory for all urban columns and all -natural veg PFTs, everywhere. In some cases this may still be desired, -but in some cases - and particularly non-transient cases - this is a -waste of memory and performance without any benefit. - -In timing runs of a CONUS test case set up by Mike Barlage, where there -were 2 PFTs per gridcell (bare plus grass), only allocating memory for -the non-zero-weight points (i.e., 2 natural pfts per gridcell and -nothing else) reduced land run time from 56.4 sec to 21.6 sec. - -This tag puts in place a more general solution, avoiding allocating -memory for zero-weight natural PFTs in non-transient runs, and avoiding -allocating memory for zero-weight urban points unless requested with a -namelist flag. - -For non-transient runs, this change improves performance and decreases -memory and restart file size substantially: For short timing runs on -cheyenne_intel at f09_g16 (I haven't looked closely at memory use, but -it probably is about the same reduction as the restart file size): -- I1850Clm50Sp - - 91% of the runtime (i.e., 9.0% reduction in runtime) - - Restart file size is 32% of original (68% reduction) -- I1850Clm50Bgc - - 77% of the runtime (i.e., 23% reduction in runtime) - - Restart file size is 33% of original (67% reduction) -- I1850Clm50BgcCrop - - 80% of the runtime (i.e., 20% reduction in runtime) - - Restart file size is 37% of original (63% reduction) - -(Non-transient cases should also be improved due to the urban change, -but I haven't investigated the improvement there.) - -This tag also fixes some other bugs, as noted below. - -NOTE: This change requires running init_interp on any existing initial -conditions files! In addition, moving forward, init_interp will always -be needed when going from a non-transient to a transient run (this has -already been the case when running with crop; now it will also be the -case when running without crop, too). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #298: Don't allocate memory for zero-weight PFTs and urban - columns -- Fixes #317: c14 bombspike and c13 timeseries code can use the wrong - year, with irreproducible behavior -- Fixes #320: I1850Clm50Sp compset mistakenly uses SGLC - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- You will need to run init_interp on any existing initial conditions - files -- Moving forward, init_interp will always be needed when going from a - non-transient to a transient run (this has already been the case when - running with crop; now it will also be the case when running without - crop, too) - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable: run_zero_weight_urban: If TRUE, run all urban - landunits everywhere where we have valid urban data. This has two - effects: (1) goes back to the previous behavior of allocating memory - for urban nearly everywhere; (2) makes all urban columns active, even - if they have zero weight. This can be used to evaluate potential urban - behavior globally. - -Changes made to namelist defaults (e.g., changed parameter values): -- Use init_interp for all out-of-the-box finidat files - -Changes to the datasets (e.g., parameter, surface or initial files): -- Remove initial conditions for Fates for 1x1 Brazil - -Substantial timing or memory changes: -- Substantial decreases in memory use and improvements in timing: see - notes above. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changed aux_clm Fates tests to use cold start -- Changed the allActive test to be a transient case so that we allocate and run all PFTs - -Code reviewed by: -- Quick review by Erik Kluzek -- Urban change reviewed by Keith Oleson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - Tests pass, namelists differ as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means: tests pass, some baseline failures as expected: - - DIMSIZEDIFF for vector output - - ERI_D_Ld9.f09_g16.I1850Clm50Sp.cheyenne_gnu.clm-default differs - due to fix of #320 - - ERP_D_Ld9.f09_g16.I1850Clm50SpCru.cheyenne_gnu.clm-default differs - because this uses init_interp whereas on master we did not use - init_interp, and this changes answers for this ERP test due to - #330 - - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 - differs due to fix of #317 - - Note: For changed tests (allActive and Fates tests), I ran the new - versions of the tests from clm5.0.dev005 and confirmed that dev006 - is bit-for-bit with dev005 for these changed tests. - -CLM tag used for the baseline comparisons: clm5.0.dev005 - - -Answer changes --------------- - -Changes answers relative to baseline: YES, but only in limited situations - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: see below - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Changes answers in the following situations: - - Vector output is not directly comparable, because dimension sizes - differ - - I1850Clm50Sp cases change substantially due to fix of #320 - - Cases with carbon isotope bombspike change due to fix of #317 - - In some situations, cases that use init_interp now but did not - before can change answers by roundoff due to #330 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #311: Avoid allocating memory for zero-weight natveg patches and urban - -=============================================================== -=============================================================== -Tag name: clm5.0.dev005 -Originator(s): sacks (Bill Sacks) -Date: Tue Apr 10 14:15:52 MDT 2018 -One-line Summary: Two fixes for init_interp - -Purpose of changes ------------------- - -Two fixes for init_interp: - -(1) Copy as many snow layers as possible in init_interp - - In most cases, we only need data from the existing snow layers. But in a - few cases - in particular, the flx_abs* variables - we need data even - from non-existing snow layers in order for interpolation to be - bit-for-bit. The change here reworks snow interpolation so that, in - addition to copying the existing snow layers, we also copy as many - non-existing snow layers as will fit in the destination layer structure. - - Fixes #326 - -(2) For glcmec, match col/patch types in some cases - - If glcmec used the same elevation class definitions in input and output, - then match classes as we do for most landunit types, rather than just - using topographic heights. (An exception is output cells with the - single_at_atm_topo behavior, because their types could change once we - enter the run loop.) - - Fixes #325 - -The new behavior is covered by unit tests. This tag also expands some -unit testing infrastructure to facilitate the addition of some of these -unit tests. - -I have confirmed that this test passes: -LII_D_Ld9.f09_g16.I1850Clm50SpCru.hobart_intel.clm-default, when I point -to an initial conditions file that I generated from the dev 002 tag -(because I wasn't sure if the current default initial conditions file -was exactly compatible with the latest master). Before the changes in -this tag, that test was failing. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #326: init_interp can change answers for absorbed radiation in - non-existent snow layers -- #325: init_interp can change answers over the CISM domain - -Known bugs introduced in this tag (include github issue ID): -- #339: cheyenne_gnu restart test fails exact restart comparison sporadically - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, baselines fail as expected (baseline failures - just for tests that use init_interp) - -CLM tag used for the baseline comparisons: clm5.0.dev004 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all configurations with use_init_interp = .true. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff / same climate - - Differences arise due to both fixes listed above. - - (1) Copy as many snow layers as possible in init_interp: It - appears that this only changes answers for some radiation - terms in the first time step after initialization when a snow - layer had just melted before the restart file was written. In - this case, the flx_abs* variables are set differently for this - just-disappeared layer. This can affect a lot of grid cells, - but I expect differences from this change to be very small and - not scientifically important. - - (2) For glcmec, match col/patch types in some cases: This seems to - only affect a small number of grid cells in Greenland. So I do - not expect the overall effect on a simulation to be significant. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- +Tag name: ctsm1.0.dev001 +Originator(s): sacks (Bill Sacks) +Date: Fri Jun 22 07:31:43 MDT 2018 +One-line Summary: Begin separating SoilHydrology flux calculations -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none +Note the new tag naming: Starting with this tag, we are naming tags +"ctsm..." rather than "clm...". We are starting with ctsm version 1, +which for now is nearly the same as clm version 5. We are moving to this +new tag naming now because: -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #328: fixes for init_interp +(1) The changes in this tag represent the first step towards + implementing the CTSM vision (separating the biogeophysics flux + calculations from state updates, making it easier to plug in + alternative parameterizations, etc.). -=============================================================== -=============================================================== -Tag name: clm5.0.dev004 -Originator(s): erik (Erik Kluzek) -Date: Mon Apr 9 00:20:03 MDT 2018 -One-line Summary: List of important bug fixes +(2) This tag changes answers relative to the CLM5 release. (We expect + the climate to be the same, but we haven't tested this carefully + yet.) Purpose of changes ------------------ -A list of important bug and usability fixes. One of those changes makes it easier for the user to end up with -initial condition files that don't match the start date of their simulation. This is problematic because of the -saved counters for prognostic crop. For sure a mismatched date will end up with bad results for the first season, -but this will also affect subsequent years running averages. So we don't recommend that you do that. - -Jim Edwards also brought in some changes for PIO for 64bit_data, and to fix fill values for integer data. And we updated -manage_externals to the newest version. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -#213 -- usability issue for CPLHIST that Keith found. -#210 -- Recent request to increase number of tapes to 10. -#169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. -#68 --- workaround for gnu compiler bug -#46 --- needed for multi-instance -#66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work -#65 --– need to change a check from "> 0" to "> [small val]" -#240 -- from Jim -#255 -- get PTCLM working -#253 -- bad clm40 IC file - -Known bugs introduced in this tag (include github issue ID): - #329 -- init_interp doesn't work if finidat points to finidat_interp_dest from a different case - #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers - #325 -- init_interp can change answers over the CISM domain - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - You can bypass the ignore_ic_date error when crop is being used - Matching for initial conditions for crop simulations are allowed to ignore the month/day - When crop is on and the start date doesn't match the date for the initial conditions file, - the counters for the crop model will be incorrect -- and hence the first season will be screwed - up, and the screwed up results will affect the running averages for the future. This was a condition - that we didn't allow you to easily do -- we've made it easier for this to happen now. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - Allow ten streams of history tapes rather than just six. - Correct the I1850Clm50BgcSpinup compset - You can bypass the ignore_ic_date error when crop is being used (may affect results) - Matching for initial conditions for crop simulations are allowed to ignore the month/day - The precision control settings for Nitrogen and Carbon are now making it to the namelist - -Changes made to namelist defaults (e.g., changed parameter values): ncrit=1.d-8 (10X looser) - -Changes to the datasets (e.g., parameter, surface or initial files): Correct to a few finidat files (clm4_0_CRUv7) - -Substantial timing or memory changes: Maybe 3% to memory +First steps toward separating various flux calculations in the soil +hydrology code. The focus here is on saturated surface runoff and +infiltration excess runoff. The changes here separate flux calculations +from state updates and extract various calculations into their own +subroutines to facilitate swapping in alternative parameterizations. - There is a 3% increase to memory, but memory high water mark seems to double +Most of the changes here are refactorings that are either bit-for-bit or +just introduce roundoff-level differences. However, there are also a few +larger answer changes, as described below. -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - Added aux_cime_baseline tests - add cplhist test - Add edison to fates testlist - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular +These are the greater-than-roundoff-level answer changes: +(A1) Use full qflx_surf in BGC code. Previously, the subroutines ch4 and + SoilBiogeochemNLeaching had been using a flux that excluded surface + water runoff (qflx_h2osfc_surf). That was deemed to be incorrect + (by Dave Lawrence and others), so these BGC subroutines have been + changed to use the full surface runoff (saturated excess runoff + + infiltration excess runoff + h2osfc runoff). - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS + Configurations affected: BGC compsets - PTCLM testing (components/clm/tools/shared/PTCLM/test): + Magnitude of change: Larger than roundoff; expected to be same + climate, but not investigated carefully - cheyenne - PASS +(A2) VIC: Don't ever use the TOPModel formulation for SurfaceRunoff - regular tests (aux_clm): + The code was using the TOPModel-based formulation for SurfaceRunoff + if frost_table > zwt_perched. Sean Swenson felt this shouldn't be + done, and refactoring will be easier if VIC always uses the + vic-looking formulation, so I'm stopping applying this formulation + when using VIC. - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK + Configurations affected: VIC compsets -CLM tag used for the baseline comparisons: clm5.0.dev003 + Magnitude of change: Larger than roundoff; not investigated carefully +(A3) VIC: Remove infiltration excess runoff -Answer changes --------------- + Martyn Clark reviewed the VIC implementation, and felt that the + current implementation of infiltration excess runoff is + inconsistent with the standard VIC implementation. It appears that + what was being called VIC's infiltration excess runoff was actually + just an attempt to give a better numerical approximation to the + solution for saturated surface excess runoff. So deleting this + leaves only a first-order approximation to VIC's saturated surface + excess runoff. -Changes answers relative to baseline: no but, there are some specific potential or small apparant change to answers - in terms of the test suite - 3 fields have a different missing value pattern: landmask, pftmask, nbedrock - roundoff difference in F_N2O_DENIT due to #65 - LVG_Ld5_D.f10_f10.I1850Clm50Bgc.cheyenne_intel.clm-no_vector_output - landmask was different for two cases: - ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + Eventually we may want to put in place a more accurate solution for + VIC's saturated surface excess runoff. But Martyn's feeling is that + this can come in with other changes we want to make regarding + numerical solutions in CTSM. -Detailed list of changes ------------------------- + Configurations affected: VIC compsets -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): manic - manage_externals to manicv1.0.2 + Magnitude of change: Larger than roundoff; expected to be same + climate, but not investigated carefully -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) +(A4) Change in QOVER diagnostic field: now includes QH2OSFC. - #337 Update manage_externals to manicv1.0.2 - #333 Important fixes - #241 Add support for 64bit_data, fix fillvalues +These are the major refactorings (either bit-for-bit or just +roundoff-level differences): -=============================================================== -=============================================================== -Tag name: clm5.0.dev003 -Originator(s): erik (Erik Kluzek) -Date: Fri Mar 9 00:34:04 MST 2018 -One-line Summary: Bug fixes for energy imbalance associated with surface water and lakes +(R1) Extract surface runoff to its own module, and other modularization + related to what used to be subroutine SurfaceRunoff: extract a + subroutine for each fsat method, move urban surface runoff code + into different routines. -Purpose of changes ------------------- +(R2) Extract infiltration excess runoff to its own module, and other + modularization related to what used to be subroutine Infiltration. -These are bug fixes for the land energy imbalance over land as determined by coupler diagnostics. -They include bug fixes for surface water phase change and lake/snow interactions developed by -Sean Swenson and Keith Oleson. +NOTE: For a detailed breakdown of changes, including documentation of +which changed changed answers, see the file ChangeLog_branch which was +deleted from this branch shortly before it was merged to master. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #304 - #304 -- Energy imbalance over land per coupler diagnostics - -Known bugs introduced in this tag (include github issue ID): [If none, remove this line] - #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior - #313 -- Problems with CLM5 initial conditions files - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 +Issues fixed (include CTSM Issue #): +- Fixes #424 (decStart testmod is missing an `--append` in an xmlchange command) Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): None +Caveats for users (e.g., need to interpolate initial conditions): -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): -Changes to the datasets (e.g., parameter, surface or initial files): None +Changes to the datasets (e.g., parameter, surface or initial files): -Substantial timing or memory changes: None +Substantial timing or memory changes: Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide Caveats for developers (e.g., code that is duplicated that requires double maintenance): - There is some dupliciation in calculations by level that could be consolidated - For example, the calculation of c1. - There is a check for ffrac_sno(c) > 0, that probably should be greater than a small value - -Changes to tests or testing: none - -Code reviewed by: self, sacks, swensosc - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev002 - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 and clm5_0 - - what platforms/compilers: all - - nature of change: climate similar - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461 - - username: oleson - - machine: cheyenne - - URL for LMWG diagnostics output used to validate new climate: - -http://webext.cgd.ucar.edu/I1850/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850/lnd/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461-clm50_r272_1deg_GSWP3V1_iso_1850.1443_1461/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #307 -- Bug fixes for energy imbalance associated with surface water and lakes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev002 -Originator(s): sacks (Bill Sacks) -Date: Sun Feb 25 06:53:36 MST 2018 -One-line Summary: Add some land ice diagnostic vars needed for CMIP6 - -Purpose of changes ------------------- - -Add some diagnostic variables needed for analyzing land ice that have -been requested by some of the MIPs in CMIP6 (especially ISMIP). - -Also, fixes c2l_scale_type to fix urban scaling for SNOWICE, SNOWLIQ - -Some changes from Leo van Kampenhout. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- https://github.com/ESCOMP/ctsm/issues/271 Add some land ice fields for cmip6 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self, Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes +Changes to tests or testing: +- Shortened a 25-month f19 test to 13-months + (SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput): + This test took a long time to run, and we already have long tests of + this configuration at coarse-resolution. I suggested removing this + test entirely, but Erik Kluzek wanted to maintain a shortened version + of it. Erik's comments were: + + How about either flip it to f45 (because Rosie is using that + resolution for science) -- or leave it at f19 and have it run for 9 + months? The 25 months was to take it just past the 2-year spinup + time. From spunup initial conditions 9-months pretty much does a + full harvest cycle. f19 and f09 are the main configurations for + science and it would be good to have something longer than just + really short tests. + + I decided on Lm13, because this still completes in significantly less + than 2-hours, and if we're running for 9 months anyway, it seems + valuable to finish out the year and run a bit into the next year, + since some crop stuff triggers at the end of the year. + +Code reviewed by: Various code reviews done last Fall, when these +changes were first implemented. CLM testing: @@ -1548,7 +155,7 @@ CLM testing: unit-tests (components/clm/src): - cheyenne - pass + cheyenne - PASS tools-tests (components/clm/test/tools): @@ -1560,47 +167,39 @@ CLM testing: regular tests (aux_clm): - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK - ok means tests pass, answer changes as expected, as noted below + OK means tests pass, answers change as expected. -CLM tag used for the baseline comparisons: clm5.0.dev001 +CLM tag used for the baseline comparisons: clm5.0.dev013 Answer changes -------------- -Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ +Changes answers relative to baseline: YES If a tag changes answers relative to baseline comparison the following should be filled in (otherwise remove this section): Summarize any changes to answers, i.e., - - what code configurations: All + - what code configurations: Essentially all (except CLM4) - what platforms/compilers: All - nature of change (roundoff; larger than roundoff/same climate; new climate): - - just changes the diagnostic fields SNOWICE, SNOWLIQ, due to - fixed c2l_scale_type for these fields - - - The test - ERP_P72x2_Ly3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-irrig_o3_reduceOutput - also showed small answer changes just in the cpl field - l2x_Sl_tsrf00, for a single grid cell in Antarctica - (221.485144932008 vs. 221.485144910486). However, I reran it 10 - times, and it was bit-for-bit (other than SNOWICE and SNOWLIQ) in - all 10 of those re-runs. So I'm chalking this up to a machine - fluke. (The restart file from the problematic run showed diffs in - a bunch of fields; from spot-checking one - SNOW_DEPTH - diffs - were just in one point. But since this is a reduceOutput run, - diffs didn't show up in CLM history files. I confirmed that there - were no diffs in finidat_interp_dest or in namelists.) I - regenerated baselines for this test using one of the cases without - this machine fluke. + + Roundoff-level changes for nearly all configurations (except CLM4). + + Greater-than-roundoff-level changes for the following + configurations: + - BGC: see (A1) note above (expected to be same climate, but not + investigated carefully) + - VIC: see (A2) and (A3) notes above (magnitude of change not + investigated carefully) + - QOVER diagnostic field: see (A4) note above If bitwise differences were observed, how did you show they were no worse than roundoff? N/A @@ -1610,7 +209,7 @@ Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ - casename: N/A URL for LMWG diagnostics output used to validate new climate: N/A - + Detailed list of changes ------------------------ @@ -1618,125 +217,9 @@ Detailed list of changes List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#303 - Snow integrated temperature -#306 - Add some land ice diagnostic variables needed for cmip6 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev001 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Feb 14 14:14:34 MST 2018 -One-line Summary: Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM - -Purpose of changes ------------------- - -Fix problem with default LND_TUNING_MODE for cases coupled to CAM. Update some of the README -files. And also bring in a PTCLM version that will work in the new CTSM git checkout directory -structure. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -#255 PTCLMmkdata doesn't work in the CLM git checkout - -Known bugs found in this tag (include github issue ID): - -#262 hirespft option for mksurfdata.pl doesn't work - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: doc - -PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - PASS - - Extra Tests: - -ERS_Ld5.f19_g17.E1850L45TEST.cheyenne_intel.cice-default -SMS_Ld1.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist1d -SMS_Ld7.f09_g17.B1850.cheyenne_intel.allactive-defaultio - -CLM tag used for the baseline comparisons: clm5.0.dev000 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): PTCLM - PTCLM to PTCLM2_180214 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#297 -- README files -#296 -- Make LND_TUNING_MODE correct and consistent when coupled with CAM -#295 -- Bring in a working PTCLMmkdata version -#261 -- Reorder links - -=============================================================== -=============================================================== -Tag name: clm5.0.dev000 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Feb 05 2018 -One-line Summary: Initial version of CLM5.0 - -This is the initial science version of CLM5.0. - -Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly -notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop -modeling. -The updates to CLM science are documented here: - -https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 - -This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary -versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, -and future scenarios. - -Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution -(fv 0.9x1.25 with g1xv6 ocean mask). +- https://github.com/ESCOMP/ctsm/pull/244 +- https://github.com/ESCOMP/ctsm/pull/190 +- Other PRs that existed on the old NCAR/clm-ctsm repository (which has + been deleted), which were not migrated to the new repository =============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index 0fa82e6924..d7bf5702d8 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm1.0.dev001 sacks 06/22/2018 Begin separating SoilHydrology flux calculations clm5.0.dev013 erik 06/12/2018 cleanup and update cime and cism clm5.0.dev012 sacks 05/17/2018 Fixes for variable_year orbital mode clm5.0.dev011 erik 05/16/2018 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing diff --git a/doc/clm5_0_ChangeLog b/doc/clm5_0_ChangeLog new file mode 100644 index 0000000000..368d1742a0 --- /dev/null +++ b/doc/clm5_0_ChangeLog @@ -0,0 +1,1742 @@ +=============================================================== +Tag name: clm5.0.dev013 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Jun 12 13:46:31 MDT 2018 +One-line Summary: cleanup and update cime and cism + +Purpose of changes +------------------ + +Update cime and cism to newer versions used in release. These bring in some answer +changes. The cime version updates the orbit for 2000 compsets. The cism version +changes answers for two fields with NO_EVOLVE and more fields for EVOLVE. + +Fixes an important bug needed for use with Data Assimulation. Several changes +to testing. Adding wallclock as needed, changing a few compsets so science +supported compsets are used, added tput_tolerance to some tests known to be +variable. + +Many changes to the clm tools for creating input files. Added the version by +querying "git describe" and adding it as an attribute to NetCDF files. Changes +to get tools working, and tested. Also changed so that tools can be run in either +a CTSM checkout or a CESM checkout. + +Updated README files so they are accurate. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] + #188 -- Global PTCLM tools test fails + #187 -- PTCLM tools tests fail baseline comparisons due to a seg fault + #259 -- Most README files in ctsm are incorrect + #386 -- Shorten some currently very long debug tests + #387 -- Lots of testmods still set orb_iyear and orb_iyear_align + #388 -- Add "git describe" to input files that are created + #389 -- Post data-assimilation processing broken with multi-driver + #393 -- Increase wallclock + #399 -- minor format update needed in namelist_definition_clm4_5.xml + #402 -- Some smaller tests can be slow.. + #411 -- Refactor tools aren't useful anymore + #414 -- PTCLM tests aren't working + #415 -- mkprocdata_map tests aren't working because of bad return statement in script type: bug - other + #418 -- Path needs to be updated for getco2 script type: bug - other + +Known bugs found since the previous tag (include github issue ID): #404, #413, #414 + #404 -- Carbon balance error in decStart test just after new year + #413 -- Currently can't use DAV cluster to make mapping files + #414 -- With change in repo for fates, had to enter username/password four times + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Yes + Lengthen some of the wallclock times. Remove the 1850 test-mods that just change the orbit. + Change some of the compsets tested to cover the science supported compsets. + Allow decStart test modes to ignore errors, so Crop tests can run. Remove a very long debug test. + Add a setting for tput_tolerance for some tests that are shown to have a large variability. + Add a test mod for data assimulation. Remove some of the settings from the pauseResume test + as already done, or tested seperately in the DA test. + +Code reviewed by: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + hobart --- PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + hobart --- OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev012 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! Because of changes in cism and cime + + Summarize any changes to answers: + - what code configurations: All 2000 compsets and some cases with cism + - what platforms/compilers: All + - nature of change: similar climate + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, rtm, mosart, PTCLM + + cime to cime_cesm2_0_rel_03 (changes answers for 2000 cases because of change to orbit + cism to release-v2.1.01 (changes answers for two fields for NOEVOLVE and more fields for EVOLVE) + PTCLM to PTCLM2_180611 + + rtm and mosart changed to point to cesm2_0 release versions (identical to previous version) + +Pull Requests that document the changes (include PR ids): #398, #400, #407, #408, #417, #394 +(https://github.com/ESCOMP/ctsm/pull) + + #394 -- some final cleanup + #417 -- Make PR template questions less prominent + #408 -- Documentation updates + #407 -- Initial version of templates for contributing, PR's and issues + #400 -- Update CanopyStateType.F90 priority: high type: code cleanup/docs + #398 -- Allow first history tape to have other than one time point per file priority: high type: enhance - science + +=============================================================== +=============================================================== +Tag name: clm5.0.dev012 +Originator(s): sacks (Bill Sacks) +Date: Thu May 17 14:13:34 MDT 2018 +One-line Summary: Fixes for variable_year orbital mode + +Purpose of changes +------------------ + +Fixes for correctness and exact restartability with variable_year +orbital mode: + +(1) Update max day length (max_dayl) each time step, rather than just + updating it once in initialization + +(2) Update to a cime version that has a fix for datm, which updates the + orbital parameters (used for solar zenith angle-based interpolation) + each time step, rather than just once in initialization + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #379 (Problems with Hist decStart restart tests due to variable + orbital year) +- Fixes #260 (max daylength doesn't change over time for varying orbital + parameters) + +CIME Issues fixed (include issue #): +- ESMCI/cime#2598 (datm doesn't restart properly with variable year orbit) + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: Gave extra time to some tests so they would pass + +Code reviewed by: Erik Kluzek + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, some baselines fail as expected + + Also verified that this test (reported in #379) now passes: + ERS_D_P36x1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart + + Also verified that the ctsm code changes alone (without the cime + update) have the expected behavior in terms of baseline + passes/fails: + + FAIL SMS_D_Ld10.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE + Enters the second year + PASS SMS_D_Ld1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE + Stays in first year + PASS SMS_Lm1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-ciso_bombspike1963 BASELINE + Stays in first year + +CLM tag used for the baseline comparisons: clm5.0.dev011 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: multi-year runs with HIST compsets + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but expected to be larger than roundoff/same climate + + Bit-for-bit for runs with fixed orbital parameters (non-HIST + compsets) and for HIST runs that do not span multiple years. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: adds one commit that fixes ESMCI/cime#2598 + +Pull Requests that document the changes (include PR ids): +- #385 (Update max day length (max_dayl) each time step) + +=============================================================== +=============================================================== +Tag name: clm5.0.dev011 +Originator(s): erik (Erik Kluzek) +Date: Wed May 16 20:27:39 MDT 2018 +One-line Summary: 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing + +Purpose of changes +------------------ + +Update ndep file used for fully coupled 1850 cases to one being used in fully coupled +simulations. Update cism to latest release branch: release-v2.1.00. +Update PE layouts for f45, f09, f19. Turn BFBFLAG=TRUE for most CTSM testing. +Fix some issues with tools for batch submission. Remove a write statement for VIC +that was written a ridiculous amount of times. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #) #363 #374 #380 #382 #383: + #363 -- PE Layout + $374 -- Turn BFBFLAG on for testing (so PE layout changes won't appear to change answers) + #382 -- Write statement for VIC + $383 -- mkmapdata intel version + +Known bugs introduced in this tag (include github issue ID): #384 + #384 -- f09 resolution VIC test + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): PE layouts + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): ndep for clm50_cam6 forcing + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Added back tests + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - OK + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev010 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes for some + + Summarize any changes to answers, i.e., + - what code configurations: all with cism, tests as BFBFLAG on + - what platforms/compilers: all + - nature of change: similar + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism + + cism to release-v2.1.00 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #381 -- 1850 fully coupled ndep update, update cism, update PE layouts, turn BFBFLAG on for testing + +=============================================================== +=============================================================== +Tag name: clm5.0.dev010 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue May 15 03:00:38 MDT 2018 +One-line Summary: Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit + +Purpose of changes +------------------ + +Update externals to version in cesm2.0.beta10. Add in f05 crop datasets. Add pauseResume for DART and a +test for it. Fix several issues required for CESM2.0. Add model_doi_url to history files. + +update cism to very latest +Add model_doi_url to history files +Update rtm, mosart +Changes answers because of change in orbit (for testing orbit was already updated for 1850 so will appear to not change answers) +Using cime5.6.6 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #68 --- gnu compiler workaround + #364 -- crop f05 datasets + #362 -- svn checkout + #318 -- quadratic bug + #249 -- bypass balance checks for DART + #341 -- add model_doi_url + +CIME Issues fixed (include issue #): + +Known bugs introduced in this tag (include github issue ID): + #379 -- transient end-of-year exact restart issue + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): + + cime updates: + - manage_testlist was removed. + - Changes to matching behavior in env_mach_specific. + - New option to wait_for_tests. + - case.st_archive now has a --test option. + - New FORCE_BUILD_THREADED. + - New custom script option. + - env_archive.xml + - .case.run.sh file generated for E3SM. + - New selectors allowed for batch directives. + - Source code files beginning in test_ will be ignored in build. + - New prefix attribute available for batch directives. + - xmlquery will now accept derived attributes. + - Users may run on lawrencium lr3/lr2. + - In env_archive.xml. + - (cesm only) create_test and query_testlist now have --supported-only flag + - New allow_error attribute for module systems. + - check_input_data replace --svn-loc with --server and --protocal + - Some Tools with "acme" in the name now say "e3sm". + - env_archive.xml + - .case.run.sh file generated for E3SM. + - New selectors allowed for batch directives. + - Source code files beginning in test_ will be ignored in build. + - New prefix attribute available for batch directives. + - xmlquery will now accept derived attributes. + - Users may run on lawrencium lr3/lr2. + - In env_archive.xml. + - (cesm only) create_test and query_testlist now have --supported-only flag + - New allow_error attribute for module systems. + - check_input_data replace --svn-loc with --server and --protocal + - Some Tools with "acme" in the name now say "e3sm". + - cime_bisect changes. + - New XML variables, PAUSE_ACTIVE_XXX. + - module_lmod no longer a support module type. + - simple-py-prof sets PYTHONPATH for you, list_acme_tests assumes you want + to list tests + - jobid now added to CaseStatus case_submit entry. + -Splits GLC2OCN_RMAPNAME xml variable into + GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for + GLC2OCN_RMAPTYPE + - Better defaults for bless_test_results and compare_test_results. + - New bless_log file in baseline dirs. + - Allow multiple -m args to case.submit. Allows user to put email settings in .cime/config. + - New --retry option to create_test. + - Add --clean-depends to case.build, this argument can take a component list and will + clean all components if one is not provided. + - Some additional output from nl comp code in some cases + - --driver added to create_newcase, new _V$driver testopt. + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + Crop f05 surface datasets + +Substantial timing or memory changes: Seems to be slower and require more memory + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + pause/resume is still under development. This works for DART DA as needed for CESm2.0 + +Changes to tests or testing: + Added new pauseResume test on cheyenne_intel + Remove some of the higher PE count tests on cheyenne_gnu and replace with cheyenne_intel + Lengthen wallclock for a few of the tests on cheyenne + Change I1850Clm50BgcSpinup test to f09 resolution so it will run + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev009 + + +Answer changes +-------------- + +Changes answers relative to baseline: 1850 compsets change because orbit has been changed + + Summarize any changes to answers, i.e., + - what code configurations: 1850 compsets + - what platforms/compilers: all + - nature of change: 1850 orbit rather than 1990 + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, rtm, mosart, cism + + cime to cime5.6.6 + rtm to rtm1_0_66 + mosart to mosart1_0_31 + cism to cism2_1_54 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #377 -- update cime + #376 -- changes needed for DART + #372 -- Update manage_externals + +=============================================================== +=============================================================== +Tag name: clm5.0.dev009 +Originator(s): sacks (Bill Sacks) +Date: Thu May 10 13:48:32 MDT 2018 +One-line Summary: New init_interp method + +Purpose of changes +------------------ + +The main change in this tag is to introduce a new method for +init_interp. This is needed in order for subgrid areas to be the same in +initialization in runs with and without init_interp. + +The choice of init_interp method is controlled by a new namelist +variable, init_interp_method, whose documentation appears below: + + Method to use for init_interp. Only applies when use_init_interp = .true. + + 'general': The general-purpose method that can be used when changing + grids, configurations, etc. This starts off with subgrid areas taken + from the surface dataset. + + 'use_finidat_areas': This starts off with subgrid areas taken from the + input finidat file. This is needed to achieve bit-for-bit results in a + coupled case (where areas in initialization impact initial fields sent + to the atmosphere) (but using the 'general' method will typically have + only a very minor impact on results in this case). For this method to + work, the input finidat file needs to be at the same resolution as the + current configuration. So this is a less general form of + init_interp. However, it can be used when transitioning from a spinup + run to a transient run, or in other cases where the only difference is + in internal memory allocation. In order to catch possible problems, this + uses a different algorithm for finding the input point for each output + point, which ensures that each active output point is associated with + exactly one input point with the same latitude, longitude and type. This + method requires (a) the same grid for input and output, within roundoff; + (b) any non-zero-weight point in the input must have memory allocated + for it in this grid cell in the output (this will be satisfied if the + point is non-zero-weight on the surface dataset or if it's a point for + which we allocate memory even for zero-weight points); (c) any active + point in the output (based on the surface dataset and rules for + determining active points) must have a matching point in this grid cell + in the input. + +This tag also has some other changes: + +- Fixes #347 - endrun message behavior: needed for some of the new unit + tests + +- Fixes #345 - Add a cmip6_evolving_icesheet usermods directory: + unrelated, but folded in here for convenience of testing) + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- #346: New mode of operation for init_interp: Copy subgrid areas, too +- #347: endrun message behavior +- #345: Add a cmip6_evolving_icesheet usermods directory + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable - init_interp_method - documented above. Default + behavior is the same as before ('general') + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Added a new test type, similar to LII, that covers the new init_interp behavior +- Removed some no-longer-needed tests with 'interp' testmods + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + tests pass, namelists differ as expected + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + Unexpected baseline failures for these two tests that are in the + expected fail list for other reasons: + FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest + FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest + + Differences are just in some cism fields that I’m not concerned + about: roundoff-level differences in internal_time; big differences + in tempstag, uvel and vvel, but those fields don’t really make sense + in this configuration (and I have removed them in the latest CISM + tag). (Note that I did two runs of each of these tests from my + branch, and for both tests, the two runs had identical cism hist + files, so I don’t think this is a reproducibility problem.) + + +CLM tag used for the baseline comparisons: clm5.0.dev008 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #352 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev008 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri Apr 27 13:28:41 MDT 2018 +One-line Summary: With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 + +Purpose of changes +------------------ + +Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #351 -- FATES external to https + #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: + +Code reviewed by: wweider, rfischer + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev007 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: All CLM50 BGC with FUN on + - what platforms/compilers: All + - nature of change: climate very nearly the same + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + rfisher case -- clm5_nbug_test_case ----- short f45 resolution + oleson case --- clm5_nbug_test_case ----- AD spinup f45 resolution + oleson case --- clm5_nbug_test_casepAD -- Post AD spinup f45 resolution + + URL for LMWG diagnostics output used to validate new climate: + http://webext.cgd.ucar.edu/I1850/clm5_nbug_test_casepAD/lnd/clm5_nbug_test_casepAD.281_300-clm5_nbug_control_casepAD.281_300/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates changed to https form rather than ssh + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #344 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev007 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Apr 24 14:50:19 MDT 2018 +One-line Summary: Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit + +Purpose of changes +------------------ + +Important updates in land-ice model (CISM) version used that changes answers. Fix some initial condition problems +with CLM5.0 cases. Update the FATES version to a new updated science version that hence changes answers. +Change the default orbit for testing of 1850 cases to use 1850 orbit rather than 1990. +Make sure to use f45_f45_g37 and not f45_f45 in test lists. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #313 -- Issues with initial condition files + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New IC file for clm5_0_CRUv7 + CLM5.0 finidat files choosen will be different for both GSWP3.1 and CRUNCEPv7 forcing + +Substantial timing or memory changes: No + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + When the cime version is updated the changes that make the 1850 orbit explicit in testing can be removed + +Changes to tests or testing: 1850 tests explicitly set a 1850 orbit, f45_f45 tests changed to include mask (f45_f45_mg37) + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev006 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers: + - what code configurations: All 1850 tests, all FATES, all with CISM, CLM50 initial conditions + - what platforms/compilers: All + - nature of change: Significant + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, cism + FATES to SCI_1.8.1_API_3.0.0 + cism to cism2_1_49 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #349 -- Update manage externals to manic_v1.1.3 + #348 -- Update FATES science version to 1.8.1, and bring in some answer changes + +=============================================================== +=============================================================== +Tag name: clm5.0.dev006 +Originator(s): sacks (Bill Sacks) +Date: Thu Apr 12 06:16:16 MDT 2018 +One-line Summary: Don't allocate memory for zero-weight natveg patches and urban + +Purpose of changes +------------------ + +We have previously been allocating memory for all urban columns and all +natural veg PFTs, everywhere. In some cases this may still be desired, +but in some cases - and particularly non-transient cases - this is a +waste of memory and performance without any benefit. + +In timing runs of a CONUS test case set up by Mike Barlage, where there +were 2 PFTs per gridcell (bare plus grass), only allocating memory for +the non-zero-weight points (i.e., 2 natural pfts per gridcell and +nothing else) reduced land run time from 56.4 sec to 21.6 sec. + +This tag puts in place a more general solution, avoiding allocating +memory for zero-weight natural PFTs in non-transient runs, and avoiding +allocating memory for zero-weight urban points unless requested with a +namelist flag. + +For non-transient runs, this change improves performance and decreases +memory and restart file size substantially: For short timing runs on +cheyenne_intel at f09_g16 (I haven't looked closely at memory use, but +it probably is about the same reduction as the restart file size): +- I1850Clm50Sp + - 91% of the runtime (i.e., 9.0% reduction in runtime) + - Restart file size is 32% of original (68% reduction) +- I1850Clm50Bgc + - 77% of the runtime (i.e., 23% reduction in runtime) + - Restart file size is 33% of original (67% reduction) +- I1850Clm50BgcCrop + - 80% of the runtime (i.e., 20% reduction in runtime) + - Restart file size is 37% of original (63% reduction) + +(Non-transient cases should also be improved due to the urban change, +but I haven't investigated the improvement there.) + +This tag also fixes some other bugs, as noted below. + +NOTE: This change requires running init_interp on any existing initial +conditions files! In addition, moving forward, init_interp will always +be needed when going from a non-transient to a transient run (this has +already been the case when running with crop; now it will also be the +case when running without crop, too). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #298: Don't allocate memory for zero-weight PFTs and urban + columns +- Fixes #317: c14 bombspike and c13 timeseries code can use the wrong + year, with irreproducible behavior +- Fixes #320: I1850Clm50Sp compset mistakenly uses SGLC + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- You will need to run init_interp on any existing initial conditions + files +- Moving forward, init_interp will always be needed when going from a + non-transient to a transient run (this has already been the case when + running with crop; now it will also be the case when running without + crop, too) + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable: run_zero_weight_urban: If TRUE, run all urban + landunits everywhere where we have valid urban data. This has two + effects: (1) goes back to the previous behavior of allocating memory + for urban nearly everywhere; (2) makes all urban columns active, even + if they have zero weight. This can be used to evaluate potential urban + behavior globally. + +Changes made to namelist defaults (e.g., changed parameter values): +- Use init_interp for all out-of-the-box finidat files + +Changes to the datasets (e.g., parameter, surface or initial files): +- Remove initial conditions for Fates for 1x1 Brazil + +Substantial timing or memory changes: +- Substantial decreases in memory use and improvements in timing: see + notes above. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed aux_clm Fates tests to use cold start +- Changed the allActive test to be a transient case so that we allocate and run all PFTs + +Code reviewed by: +- Quick review by Erik Kluzek +- Urban change reviewed by Keith Oleson + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + Tests pass, namelists differ as expected + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means: tests pass, some baseline failures as expected: + - DIMSIZEDIFF for vector output + - ERI_D_Ld9.f09_g16.I1850Clm50Sp.cheyenne_gnu.clm-default differs + due to fix of #320 + - ERP_D_Ld9.f09_g16.I1850Clm50SpCru.cheyenne_gnu.clm-default differs + because this uses init_interp whereas on master we did not use + init_interp, and this changes answers for this ERP test due to + #330 + - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 + differs due to fix of #317 + + Note: For changed tests (allActive and Fates tests), I ran the new + versions of the tests from clm5.0.dev005 and confirmed that dev006 + is bit-for-bit with dev005 for these changed tests. + +CLM tag used for the baseline comparisons: clm5.0.dev005 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but only in limited situations + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: see below + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + Changes answers in the following situations: + - Vector output is not directly comparable, because dimension sizes + differ + - I1850Clm50Sp cases change substantially due to fix of #320 + - Cases with carbon isotope bombspike change due to fix of #317 + - In some situations, cases that use init_interp now but did not + before can change answers by roundoff due to #330 + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #311: Avoid allocating memory for zero-weight natveg patches and urban + +=============================================================== +=============================================================== +Tag name: clm5.0.dev005 +Originator(s): sacks (Bill Sacks) +Date: Tue Apr 10 14:15:52 MDT 2018 +One-line Summary: Two fixes for init_interp + +Purpose of changes +------------------ + +Two fixes for init_interp: + +(1) Copy as many snow layers as possible in init_interp + + In most cases, we only need data from the existing snow layers. But in a + few cases - in particular, the flx_abs* variables - we need data even + from non-existing snow layers in order for interpolation to be + bit-for-bit. The change here reworks snow interpolation so that, in + addition to copying the existing snow layers, we also copy as many + non-existing snow layers as will fit in the destination layer structure. + + Fixes #326 + +(2) For glcmec, match col/patch types in some cases + + If glcmec used the same elevation class definitions in input and output, + then match classes as we do for most landunit types, rather than just + using topographic heights. (An exception is output cells with the + single_at_atm_topo behavior, because their types could change once we + enter the run loop.) + + Fixes #325 + +The new behavior is covered by unit tests. This tag also expands some +unit testing infrastructure to facilitate the addition of some of these +unit tests. + +I have confirmed that this test passes: +LII_D_Ld9.f09_g16.I1850Clm50SpCru.hobart_intel.clm-default, when I point +to an initial conditions file that I generated from the dev 002 tag +(because I wasn't sure if the current default initial conditions file +was exactly compatible with the latest master). Before the changes in +this tag, that test was failing. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- #326: init_interp can change answers for absorbed radiation in + non-existent snow layers +- #325: init_interp can change answers over the CISM domain + +Known bugs introduced in this tag (include github issue ID): +- #339: cheyenne_gnu restart test fails exact restart comparison sporadically + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, baselines fail as expected (baseline failures + just for tests that use init_interp) + +CLM tag used for the baseline comparisons: clm5.0.dev004 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: all configurations with use_init_interp = .true. + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but expected to be larger than roundoff / same climate + + Differences arise due to both fixes listed above. + + (1) Copy as many snow layers as possible in init_interp: It + appears that this only changes answers for some radiation + terms in the first time step after initialization when a snow + layer had just melted before the restart file was written. In + this case, the flx_abs* variables are set differently for this + just-disappeared layer. This can affect a lot of grid cells, + but I expect differences from this change to be very small and + not scientifically important. + + (2) For glcmec, match col/patch types in some cases: This seems to + only affect a small number of grid cells in Greenland. So I do + not expect the overall effect on a simulation to be significant. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #328: fixes for init_interp + +=============================================================== +=============================================================== +Tag name: clm5.0.dev004 +Originator(s): erik (Erik Kluzek) +Date: Mon Apr 9 00:20:03 MDT 2018 +One-line Summary: List of important bug fixes + +Purpose of changes +------------------ + +A list of important bug and usability fixes. One of those changes makes it easier for the user to end up with +initial condition files that don't match the start date of their simulation. This is problematic because of the +saved counters for prognostic crop. For sure a mismatched date will end up with bad results for the first season, +but this will also affect subsequent years running averages. So we don't recommend that you do that. + +Jim Edwards also brought in some changes for PIO for 64bit_data, and to fix fill values for integer data. And we updated +manage_externals to the newest version. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] +#213 -- usability issue for CPLHIST that Keith found. +#210 -- Recent request to increase number of tapes to 10. +#169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. +#68 --- workaround for gnu compiler bug +#46 --- needed for multi-instance +#66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work +#65 --– need to change a check from "> 0" to "> [small val]" +#240 -- from Jim +#255 -- get PTCLM working +#253 -- bad clm40 IC file + +Known bugs introduced in this tag (include github issue ID): + #329 -- init_interp doesn't work if finidat points to finidat_interp_dest from a different case + #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers + #325 -- init_interp can change answers over the CISM domain + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + You can bypass the ignore_ic_date error when crop is being used + Matching for initial conditions for crop simulations are allowed to ignore the month/day + When crop is on and the start date doesn't match the date for the initial conditions file, + the counters for the crop model will be incorrect -- and hence the first season will be screwed + up, and the screwed up results will affect the running averages for the future. This was a condition + that we didn't allow you to easily do -- we've made it easier for this to happen now. + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): + Allow ten streams of history tapes rather than just six. + Correct the I1850Clm50BgcSpinup compset + You can bypass the ignore_ic_date error when crop is being used (may affect results) + Matching for initial conditions for crop simulations are allowed to ignore the month/day + The precision control settings for Nitrogen and Carbon are now making it to the namelist + +Changes made to namelist defaults (e.g., changed parameter values): ncrit=1.d-8 (10X looser) + +Changes to the datasets (e.g., parameter, surface or initial files): Correct to a few finidat files (clm4_0_CRUv7) + +Substantial timing or memory changes: Maybe 3% to memory + + There is a 3% increase to memory, but memory high water mark seems to double + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + Added aux_cime_baseline tests + add cplhist test + Add edison to fates testlist + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev003 + + +Answer changes +-------------- + +Changes answers relative to baseline: no but, there are some specific potential or small apparant change to answers + in terms of the test suite + 3 fields have a different missing value pattern: landmask, pftmask, nbedrock + roundoff difference in F_N2O_DENIT due to #65 + LVG_Ld5_D.f10_f10.I1850Clm50Bgc.cheyenne_intel.clm-no_vector_output + landmask was different for two cases: + ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): manic + manage_externals to manicv1.0.2 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #337 Update manage_externals to manicv1.0.2 + #333 Important fixes + #241 Add support for 64bit_data, fix fillvalues + +=============================================================== +=============================================================== +Tag name: clm5.0.dev003 +Originator(s): erik (Erik Kluzek) +Date: Fri Mar 9 00:34:04 MST 2018 +One-line Summary: Bug fixes for energy imbalance associated with surface water and lakes + +Purpose of changes +------------------ + +These are bug fixes for the land energy imbalance over land as determined by coupler diagnostics. +They include bug fixes for surface water phase change and lake/snow interactions developed by +Sean Swenson and Keith Oleson. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #304 + #304 -- Energy imbalance over land per coupler diagnostics + +Known bugs introduced in this tag (include github issue ID): [If none, remove this line] + #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior + #313 -- Problems with CLM5 initial conditions files + #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + There is some dupliciation in calculations by level that could be consolidated + For example, the calculation of c1. + There is a check for ffrac_sno(c) > 0, that probably should be greater than a small value + +Changes to tests or testing: none + +Code reviewed by: self, sacks, swensosc + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev002 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: clm4_5 and clm5_0 + - what platforms/compilers: all + - nature of change: climate similar + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461 + - username: oleson + - machine: cheyenne + + URL for LMWG diagnostics output used to validate new climate: + +http://webext.cgd.ucar.edu/I1850/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850/lnd/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461-clm50_r272_1deg_GSWP3V1_iso_1850.1443_1461/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #307 -- Bug fixes for energy imbalance associated with surface water and lakes + +=============================================================== +=============================================================== +Tag name: clm5.0.dev002 +Originator(s): sacks (Bill Sacks) +Date: Sun Feb 25 06:53:36 MST 2018 +One-line Summary: Add some land ice diagnostic vars needed for CMIP6 + +Purpose of changes +------------------ + +Add some diagnostic variables needed for analyzing land ice that have +been requested by some of the MIPs in CMIP6 (especially ISMIP). + +Also, fixes c2l_scale_type to fix urban scaling for SNOWICE, SNOWLIQ + +Some changes from Leo van Kampenhout. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- https://github.com/ESCOMP/ctsm/issues/271 Add some land ice fields for cmip6 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self, Erik Kluzek + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, answer changes as expected, as noted below + +CLM tag used for the baseline comparisons: clm5.0.dev001 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: All + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + - just changes the diagnostic fields SNOWICE, SNOWLIQ, due to + fixed c2l_scale_type for these fields + + + The test + ERP_P72x2_Ly3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-irrig_o3_reduceOutput + also showed small answer changes just in the cpl field + l2x_Sl_tsrf00, for a single grid cell in Antarctica + (221.485144932008 vs. 221.485144910486). However, I reran it 10 + times, and it was bit-for-bit (other than SNOWICE and SNOWLIQ) in + all 10 of those re-runs. So I'm chalking this up to a machine + fluke. (The restart file from the problematic run showed diffs in + a bunch of fields; from spot-checking one - SNOW_DEPTH - diffs + were just in one point. But since this is a reduceOutput run, + diffs didn't show up in CLM history files. I confirmed that there + were no diffs in finidat_interp_dest or in namelists.) I + regenerated baselines for this test using one of the cases without + this machine fluke. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +#303 - Snow integrated temperature +#306 - Add some land ice diagnostic variables needed for cmip6 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev001 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Feb 14 14:14:34 MST 2018 +One-line Summary: Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM + +Purpose of changes +------------------ + +Fix problem with default LND_TUNING_MODE for cases coupled to CAM. Update some of the README +files. And also bring in a PTCLM version that will work in the new CTSM git checkout directory +structure. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +#255 PTCLMmkdata doesn't work in the CLM git checkout + +Known bugs found in this tag (include github issue ID): + +#262 hirespft option for mksurfdata.pl doesn't work + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: doc + +PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - PASS + + Extra Tests: + +ERS_Ld5.f19_g17.E1850L45TEST.cheyenne_intel.cice-default +SMS_Ld1.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist1d +SMS_Ld7.f09_g17.B1850.cheyenne_intel.allactive-defaultio + +CLM tag used for the baseline comparisons: clm5.0.dev000 + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): PTCLM + PTCLM to PTCLM2_180214 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +#297 -- README files +#296 -- Make LND_TUNING_MODE correct and consistent when coupled with CAM +#295 -- Bring in a working PTCLMmkdata version +#261 -- Reorder links + +=============================================================== +=============================================================== +Tag name: clm5.0.dev000 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Feb 05 2018 +One-line Summary: Initial version of CLM5.0 + +This is the initial science version of CLM5.0. + +Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly +notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop +modeling. +The updates to CLM science are documented here: + +https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 + +This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary +versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, +and future scenarios. + +Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution +(fv 0.9x1.25 with g1xv6 ocean mask). + +=============================================================== From ee6f58624e9fd2ec6450adc880daad586374f6de Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 25 Jun 2018 16:39:11 -0600 Subject: [PATCH 075/144] Renames suggested by Erik Kluzek --- doc/{design_docs/design_docs.rst => design/oo_design.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{design_docs/design_docs.rst => design/oo_design.rst} (100%) diff --git a/doc/design_docs/design_docs.rst b/doc/design/oo_design.rst similarity index 100% rename from doc/design_docs/design_docs.rst rename to doc/design/oo_design.rst From 3e79c7186a670ad45db6d65ae2995ec9ba251c3c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 15 Feb 2018 17:18:40 -0700 Subject: [PATCH 076/144] Move radtemp branch over to git --- src/biogeophys/CanopyFluxesMod.F90 | 11 +++ src/biogeophys/LakeFluxesMod.F90 | 7 +- src/biogeophys/PhotosynthesisMod.F90 | 98 +++++++++++++++++++- src/biogeophys/SoilFluxesMod.F90 | 134 ++++++++++++++++++++++++++- src/biogeophys/TemperatureType.F90 | 23 +++++ src/main/clm_driver.F90 | 12 ++- 6 files changed, 276 insertions(+), 9 deletions(-) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 7c9feb8a25..f9a02366ee 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -452,6 +452,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) t_ref2m_r => temperature_inst%t_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface air temperature (Kelvin) +!ABT + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) +!ABT frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of surface water fwet => waterstate_inst%fwet_patch , & ! Input: [real(r8) (:) ] fraction of canopy that is wet (0 to 1) @@ -1235,6 +1238,14 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb*tlbef(p)**3*(tlbef(p) + & 4._r8*dt_veg(p)) + emg(c)*(1._r8-emv(p))*sb*lw_grnd) +!ABT + ! Calculate the skin temperature as a weighted sum of all the ground and vegetated fraction + ! The weight is the so-called vegetation emissivity, but not that emv is actually an attentuation + ! function that goes to zero as LAI (ELAI + ESAI) go to zero. + + t_skin_patch(p) = emv(p)*t_veg(p) + (1._r8 - emv(p))*sqrt(sqrt(lw_grnd)) +!ABT + ! Derivative of soil energy flux with respect to soil temperature cgrnds(p) = cgrnds(p) + cpair*forc_rho(c)*wtg(p)*wtal(p) diff --git a/src/biogeophys/LakeFluxesMod.F90 b/src/biogeophys/LakeFluxesMod.F90 index a2165ddd0c..ba31428a15 100644 --- a/src/biogeophys/LakeFluxesMod.F90 +++ b/src/biogeophys/LakeFluxesMod.F90 @@ -182,6 +182,9 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) +!ABT + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) +!ABT t_lake => temperature_inst%t_lake_col , & ! Input: [real(r8) (:,:) ] lake temperature (Kelvin) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil (or snow) temperature (Kelvin) @@ -657,7 +660,9 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, t_veg(p) = forc_t(c) eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) qflx_prec_grnd(p) = forc_rain(c) + forc_snow(c) - +!ABT + t_skin_patch(p) = t_veg(p) +!ABT end do end associate diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 8b6e708606..9edbb4477b 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -107,7 +107,10 @@ module PhotosynthesisMod real(r8), pointer, private :: tpu_z_phs_patch (:,:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s) real(r8), pointer, private :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s) real(r8), pointer, private :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s) - +!KO + real(r8), pointer, private :: gs_mol_sun_ln_patch (:,:) ! patch sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + real(r8), pointer, private :: gs_mol_sha_ln_patch (:,:) ! patch shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) +!KO real(r8), pointer, private :: ac_patch (:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: aj_patch (:,:) ! patch RuBP-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: ap_patch (:,:) ! patch product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) @@ -250,6 +253,10 @@ subroutine InitAllocate(this, bounds) allocate(this%kp_z_phs_patch (begp:endp,2,1:nlevcan)) ; this%kp_z_phs_patch (:,:,:) = nan allocate(this%gs_mol_sun_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_patch (:,:) = nan allocate(this%gs_mol_sha_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_patch (:,:) = nan +!KO + allocate(this%gs_mol_sun_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_ln_patch (:,:) = nan + allocate(this%gs_mol_sha_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_ln_patch (:,:) = nan +!KO allocate(this%ac_patch (begp:endp,1:nlevcan)) ; this%ac_patch (:,:) = nan allocate(this%aj_patch (begp:endp,1:nlevcan)) ; this%aj_patch (:,:) = nan allocate(this%ap_patch (begp:endp,1:nlevcan)) ; this%ap_patch (:,:) = nan @@ -485,7 +492,30 @@ subroutine InitHistory(this, bounds) ptr_patch=ptr_1d) endif +!KO + this%gs_mol_sun_ln_patch(begp:endp,:) = spval + this%gs_mol_sha_ln_patch(begp:endp,:) = spval + if (nlevcan>1) then + call hist_addfld2d (fname='GSSUNLN', units='umol H20/m2/s', type2d='nlevcan', & + avgflag='A', long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + ptr_patch=this%gs_mol_sun_ln_patch, set_lake=spval, set_urb=spval) + + call hist_addfld2d (fname='GSSHALN', units='umol H20/m2/s', type2d='nlevcan', & + avgflag='A', long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + ptr_patch=this%gs_mol_sha_ln_patch, set_lake=spval, set_urb=spval) + else + ptr_1d => this%gs_mol_sun_ln_patch(begp:endp,1) + call hist_addfld1d (fname='GSSUNLN', units='umol H20/m2/s', & + avgflag='A', long_name='sunlit leaf stomatal conductance at local noon', & + ptr_patch=ptr_1d) + + ptr_1d => this%gs_mol_sha_ln_patch(begp:endp,1) + call hist_addfld1d (fname='GSSHALN', units='umol H20/m2/s', & + avgflag='A', long_name='shaded leaf stomatal conductance at local noon', & + ptr_patch=ptr_1d) + endif +!KO if(use_luna)then if(nlevcan>1)then call hist_addfld2d (fname='Vcmx25Z', units='umol/m2/s', type2d='nlevcan', & @@ -770,6 +800,20 @@ subroutine Restart(this, bounds, ncid, flag) dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='shaded leaf stomatal conductance', units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_patch) + +!KO + call restartvar(ncid=ncid, flag=flag, varname='GSSUNLN', xtype=ncd_double, & + dim1name='pft', dim2name='levcan', & + long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + units='umol H20/m2/s', & + interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sun_ln_patch) + + call restartvar(ncid=ncid, flag=flag, varname='GSSHALN', xtype=ncd_double, & + dim1name='pft', dim2name='levcan', & + long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & + units='umol H20/m2/s', & + interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_ln_patch) +!KO call restartvar(ncid=ncid, flag=flag, varname='lnca', xtype=ncd_double, & dim1name='pft', long_name='leaf N concentration', units='gN leaf/m^2', & @@ -2368,7 +2412,12 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! method ! ! !USES: - use clm_varcon , only : rgas, tfrz, rpi +!KO use clm_varcon , only : rgas, tfrz, rpi +!KO + use clm_varcon , only : rgas, tfrz, rpi, spval, degpsec, isecspday + use GridcellType , only : grc + use clm_time_manager , only : get_curr_date, get_step_size +!KO use clm_varctl , only : cnallocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use clm_varpar , only : nlevsoi @@ -2558,8 +2607,16 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8) :: sum_nscaler real(r8) :: total_lai integer :: nptreemax +!KO + integer :: local_secp1 ! seconds into current date in local time + real(r8) :: dtime ! land model time step (sec) + integer :: year,month,day,secs ! calendar info for current time step +!KO !scs - integer :: j ! index +!KO integer :: j ! index +!KO + integer :: j,g ! index +!KO real(r8) :: rs_resis ! combined soil-root resistance [s] real(r8) :: r_soil ! root spacing [m] real(r8) :: root_biomass_density ! root biomass density [g/m3] @@ -2578,6 +2635,9 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8), parameter :: croot_lateral_length = 0.25_r8 ! specified lateral coarse root length [m] real(r8), parameter :: c_to_b = 2.0_r8 !(g biomass /g C) !Note that root density is for dry biomass not carbon. CLM provides root biomass as carbon. The conversion is 0.5 g C / g biomass +!KO + integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon +!KO !------------------------------------------------------------------------------ @@ -2670,7 +2730,11 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & an_sun => photosyns_inst%an_sun_patch , & ! Output: [real(r8) (:,:) ] net sunlit leaf photosynthesis (umol CO2/m**2/s) an_sha => photosyns_inst%an_sha_patch , & ! Output: [real(r8) (:,:) ] net shaded leaf photosynthesis (umol CO2/m**2/s) gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance (umol H2O/m**2/s) - gs_mol_sha => photosyns_inst%gs_mol_sha_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) + gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) +!KO + gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) +!KO ) par_z_sun => solarabs_inst%parsun_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) @@ -2710,6 +2774,13 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 !==============================================================================! +!KO + ! Determine seconds off current time step + + dtime = get_step_size() + call get_curr_date (year, month, day, secs) +!KO + ! vcmax25 parameters, from CN fnr = 7.16_r8 @@ -3146,6 +3217,9 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & do f = 1, fn p = filterp(f) c = patch%column(p) +!KO + g = patch%gridcell(p) +!KO ! Leaf boundary layer conductance, umol/m**2/s @@ -3278,6 +3352,22 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & if (an_sun(p,iv) < 0._r8) gs_mol_sun(p,iv) = max( bsun(p)*gsminsun, 1._r8 ) if (an_sha(p,iv) < 0._r8) gs_mol_sha(p,iv) = max( bsha(p)*gsminsha, 1._r8 ) +!KO + ! Get local noon sunlit and shaded stomatal conductance + local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime + local_secp1 = mod(local_secp1,isecspday) +!KO if (local_secp1 == isecspday/2) then +!KO + ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) + if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then +!KO + gs_mol_sun_ln(p,iv) = gs_mol_sun(p,iv) + gs_mol_sha_ln(p,iv) = gs_mol_sha(p,iv) + else + gs_mol_sun_ln(p,iv) = spval + gs_mol_sha_ln(p,iv) = spval + end if +!KO ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 index 1dabba664d..fcde1d5d7e 100644 --- a/src/biogeophys/SoilFluxesMod.F90 +++ b/src/biogeophys/SoilFluxesMod.F90 @@ -22,6 +22,9 @@ module SoilFluxesMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch +!KO + use UrbanParamsType , only : urbanparams_type +!KO ! ! !PUBLIC TYPES: implicit none @@ -34,10 +37,18 @@ module SoilFluxesMod contains !----------------------------------------------------------------------- +!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & +!KO num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & +!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & +!KO waterstate_inst, energyflux_inst, waterflux_inst) +!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & + num_urbanc, filter_urbanc, & + num_urbanp, filter_urbanp, & num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & - waterstate_inst, energyflux_inst, waterflux_inst) + waterstate_inst, energyflux_inst, waterflux_inst, urbanparams_inst) +!KO ! ! !DESCRIPTION: ! Update surface fluxes based on the new ground temperature @@ -46,8 +57,15 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & use clm_time_manager , only : get_step_size use clm_varcon , only : hvap, cpair, grav, vkc, tfrz, sb use landunit_varcon , only : istsoil, istcrop - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv +!KO use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv +!KO + use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv +!KO use subgridAveMod , only : p2c +!KO + use clm_varcon , only : sb + use subgridAveMod , only : p2l +!KO ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -55,6 +73,12 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_urbanl ! number of urban landunits in clump integer , intent(in) :: filter_urbanl(:) ! urban landunit filter +!KO + integer , intent(in) :: num_urbanc ! number of urban columns in clump + integer , intent(in) :: filter_urbanc(:) ! urban column filter + integer , intent(in) :: num_urbanp ! number of urban pfts in clump + integer , intent(in) :: filter_urbanp(:) ! urban pft filter +!KO integer , intent(in) :: num_nolakep ! number of column non-lake points in pft filter integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points type(atm2lnd_type) , intent(in) :: atm2lnd_inst @@ -62,12 +86,18 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & type(temperature_type) , intent(in) :: temperature_inst type(canopystate_type) , intent(in) :: canopystate_inst type(waterstate_type) , intent(in) :: waterstate_inst +!KO + type(urbanparams_type) , intent(in) :: urbanparams_inst +!KO type(waterflux_type) , intent(inout) :: waterflux_inst type(energyflux_type) , intent(inout) :: energyflux_inst ! ! !LOCAL VARIABLES: integer :: p,c,g,j,pi,l ! indices - integer :: fc,fp ! lake filtered column and pft indices +!KO integer :: fc,fp ! lake filtered column and pft indices +!KO + integer :: fc,fp,fl ! lake filtered column and pft indices +!KO real(r8) :: dtime ! land model time step (sec) real(r8) :: egsmax(bounds%begc:bounds%endc) ! max. evaporation which soil can provide at one time step real(r8) :: egirat(bounds%begc:bounds%endc) ! ratio of topsoil_evap_tot : egsmax @@ -80,6 +110,17 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & real(r8) :: t_grnd0(bounds%begc:bounds%endc) ! t_grnd of previous time step real(r8) :: lw_grnd real(r8) :: fsno_eff +!KO + real(r8) :: eflx_lwrad_out_lun(bounds%begl:bounds%endl) ! emitted infrared (longwave) radiation (W/m**2) + real(r8) :: emg_roof(bounds%begl:bounds%endl) ! roof emissivity + real(r8) :: emg_sunwall(bounds%begl:bounds%endl) ! sunwall emissivity + real(r8) :: emg_shadewall(bounds%begl:bounds%endl) ! shadewall emissivity + real(r8) :: emg_road_perv(bounds%begl:bounds%endl) ! pervious road emissivity + real(r8) :: emg_road_imperv(bounds%begl:bounds%endl) ! impervious road emissivity + real(r8) :: emg_road ! road emissivity + real(r8) :: emg_canyon ! canyon emissivity + real(r8) :: emg_urban ! effective urban emissivity +!KO !----------------------------------------------------------------------- associate( & @@ -99,6 +140,19 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] ground emissivity +!ABT +! emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity +! t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) +!ABT +!KO + t_skin_lun => temperature_inst%t_skin_lun , & ! Output: [real(r8) (:) ] landunit skin temperature (K) + t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) + vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road + vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall + wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road + wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:) ] weight of roof with respect to landunit + canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street hwidth (-) +!KO t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] soil/snow temperature before update t_h2osfc_bef => temperature_inst%t_h2osfc_bef_col , & ! Input: [real(r8) (:) ] saved surface water temperature @@ -405,6 +459,19 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & + (1-frac_veg_nosno(p))*emg(c)*sb*lw_grnd & + 4._r8*emg(c)*sb*t_grnd0(c)**3*tinc(c) + +!ABT + ! Calculate the skin temperature as a weighted sum of all the surface contributions (surface water table, snow, etc...) + ! Note: This is the bare ground calculation of skin temperature + ! The Urban and Vegetation are done in other place. Urban=Later in this function Veg=CanopyFluxMod +! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + emv(p)*t_veg(p) +! if( frac_veg_nosno(p).eq.0 ) then +! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + & +! emv(p) * frac_veg_nosno(p) * t_veg(p) +! end if + if(frac_veg_nosno(p).eq.0) t_skin_patch(p) = sqrt(sqrt(lw_grnd)) +!ABT + eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then eflx_lwrad_net_r(p) = eflx_lwrad_out(p) - forc_lwrad(c) @@ -425,6 +492,67 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & errsoi_patch(bounds%begp:bounds%endp), & errsoi_col(bounds%begc:bounds%endc)) +!KO + ! Calculate urban skin temperature. Must be done here instead of in + ! UrbanFluxes because eflx_lwrad_out has been updated above. This section + ! of code could be placed in a subroutine that could be called here or + ! called from within clm_driver after the call to SoilFluxes. +!KO + ! Assign urban surface emissivities + + do fc = 1,num_urbanc + c = filter_urbanc(fc) + l = col%landunit(c) + + if (col%itype(c) == icol_roof ) then + emg_roof(l) = emg(c) + else if (col%itype(c) == icol_sunwall ) then + emg_sunwall(l) = emg(c) + else if (col%itype(c) == icol_shadewall) then + emg_shadewall(l) = emg(c) + else if (col%itype(c) == icol_road_perv) then + emg_road_perv(l) = emg(c) + else if (col%itype(c) == icol_road_imperv) then + emg_road_imperv(l) = emg(c) + end if + + end do + + ! Update landunit level upward longwave radiation + + call p2l(bounds, & + eflx_lwrad_out(bounds%begp:bounds%endp), & + eflx_lwrad_out_lun(bounds%begl:bounds%endl), & + p2c_scale_type = 'unity', c2l_scale_type = 'urbanf') + + ! Calculate urban effective emissivity and skin temperature + + do fl = 1, num_urbanl + l = filter_urbanl(fl) + + + emg_road = emg_road_perv(l)*wtroad_perv(l) + emg_road_imperv(l)*(1._r8-wtroad_perv(l)) + + ! The expression for vf_sw is for per unit wall area + ! So multiply it by canyon_hwr to convert to per unit ground area + ! Then the following should equal one: 2*canyon_hwr*vf_sw + vf_sr + emg_canyon = emg_road*vf_sr(l) + emg_sunwall(l)*vf_sw(l)*canyon_hwr(l) + emg_shadewall(l)*vf_sw(l)*canyon_hwr(l) + + emg_urban = emg_roof(l)*wtlunit_roof(l) + emg_canyon*(1._r8-wtlunit_roof(l)) + t_skin_lun(l) = sqrt(sqrt(eflx_lwrad_out_lun(l)/(sb*emg_urban))) + + end do + + ! Assign landunit-level t_skin to each urban pft + do fp = 1, num_urbanp + p = filter_urbanp(fp) + l = patch%landunit(p) + + t_skin_patch(p) = t_skin_lun(l) + + end do +!KO + call t_stopf('bgp2_loop_4') end associate diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index e2516505e7..0466e81af3 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -23,6 +23,9 @@ module TemperatureType ! Temperatures real(r8), pointer :: t_veg_patch (:) ! patch vegetation temperature (Kelvin) +!KO + real(r8), pointer :: t_skin_patch (:) ! patch skin temperature (Kelvin) +!KO real(r8), pointer :: t_veg_day_patch (:) ! patch daytime accumulative vegetation temperature (Kelvinx*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg_night_patch (:) ! patch night-time accumulative vegetation temperature (Kelvin*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg10_day_patch (:) ! 10 day running mean of patch daytime time vegetation temperature (Kelvin), LUNA specific, but can be reused @@ -45,6 +48,9 @@ module TemperatureType real(r8), pointer :: t_sunw_inner_lun (:) ! lun sunwall inside surface temperature (K) real(r8), pointer :: t_shdw_inner_lun (:) ! lun shadewall inside surface temperature (K) real(r8), pointer :: t_floor_lun (:) ! lun floor temperature (K) +!KO + real(r8), pointer :: t_skin_lun (:) ! lun skin temperature (K) +!KO real(r8), pointer :: snot_top_col (:) ! col temperature of top snow layer [K] real(r8), pointer :: dTdz_top_col (:) ! col temperature gradient in top layer [K m-1] real(r8), pointer :: dt_veg_patch (:) ! patch change in t_veg, last iteration (Kelvin) @@ -187,6 +193,9 @@ subroutine InitAllocate(this, bounds) ! Temperatures allocate(this%t_veg_patch (begp:endp)) ; this%t_veg_patch (:) = nan +!KO + allocate(this%t_skin_patch (begp:endp)) ; this%t_skin_patch (:) = nan +!KO if(use_luna) then allocate(this%t_veg_day_patch (begp:endp)) ; this%t_veg_day_patch (:) = spval allocate(this%t_veg_night_patch (begp:endp)) ; this%t_veg_night_patch (:) = spval @@ -208,6 +217,9 @@ subroutine InitAllocate(this, bounds) allocate(this%t_sunw_inner_lun (begl:endl)) ; this%t_sunw_inner_lun (:) = nan allocate(this%t_shdw_inner_lun (begl:endl)) ; this%t_shdw_inner_lun (:) = nan allocate(this%t_floor_lun (begl:endl)) ; this%t_floor_lun (:) = nan +!KO + allocate(this%t_skin_lun (begl:endl)) ; this%t_skin_lun (:) = nan +!KO allocate(this%snot_top_col (begc:endc)) ; this%snot_top_col (:) = nan allocate(this%dTdz_top_col (begc:endc)) ; this%dTdz_top_col (:) = nan allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan @@ -383,6 +395,17 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='vegetation temperature', & ptr_patch=this%t_veg_patch) +!KO + this%t_skin_patch(begp:endp) = spval + call hist_addfld1d(fname='TSKIN', units='K', & + avgflag='A', long_name='skin temperature', & + ptr_patch=this%t_skin_patch, c2l_scale_type='urbans') +! this%t_skin_lun(begl:endl) = spval +! call hist_addfld1d(fname='TSKIN', units='K', & +! avgflag='A', long_name='skin temperature', & +! ptr_lun=this%t_skin_patch, set_nourb=spval, l2g_scale_type='unity') +!KO + this%t_grnd_col(begc:endc) = spval call hist_addfld1d (fname='TG', units='K', & avgflag='A', long_name='ground temperature', & diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index db2d567a45..8765697c02 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -661,12 +661,22 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! ============================================================================ call t_startf('bgp2') +!KO call SoilFluxes(bounds_clump, & +!KO filter(nc)%num_urbanl, filter(nc)%urbanl, & +!KO filter(nc)%num_nolakec, filter(nc)%nolakec, & +!KO filter(nc)%num_nolakep, filter(nc)%nolakep, & +!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & +!KO energyflux_inst, waterflux_inst) +!KO call SoilFluxes(bounds_clump, & filter(nc)%num_urbanl, filter(nc)%urbanl, & + filter(nc)%num_urbanc, filter(nc)%urbanc, & + filter(nc)%num_urbanp, filter(nc)%urbanp, & filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_nolakep, filter(nc)%nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & - energyflux_inst, waterflux_inst) + energyflux_inst, waterflux_inst, urbanparams_inst) +!KO call t_stopf('bgp2') ! ============================================================================ From 3ee8a5dd5815b969f69fbceb9ca52b1f49682f5e Mon Sep 17 00:00:00 2001 From: ckoven Date: Fri, 23 Feb 2018 16:39:53 -0700 Subject: [PATCH 077/144] added summary N litterfall flux variable --- src/biogeochem/CNVegNitrogenFluxType.F90 | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index 1bb630c687..2616b858a4 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -178,6 +178,7 @@ module CNVegNitrogenFluxType real(r8), pointer :: ndeploy_patch (:) ! patch total N deployed to growth and storage (gN/m2/s) real(r8), pointer :: wood_harvestn_patch (:) ! patch total N losses to wood product pools (gN/m2/s) real(r8), pointer :: wood_harvestn_col (:) ! col total N losses to wood product pools (gN/m2/s) (p2c) + real(r8), pointer :: litfall_n_patch (:) ! total N passed from plant to litter (gN/m2/s) ! phenology: litterfall and crop fluxes real(r8), pointer :: phenology_n_to_litr_met_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s) @@ -441,6 +442,8 @@ subroutine InitAllocate(this, bounds) allocate(this%dwt_crop_productn_gain_patch (begp:endp)) ; this%dwt_crop_productn_gain_patch (:) = nan allocate(this%wood_harvestn_col (begc:endc)) ; this%wood_harvestn_col (:) = nan + allocate(this%litfall_n_patch (begp:endp)) ; this%litfall_n_patch (:) = nan + allocate(this%dwt_frootn_to_litr_met_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_met_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_cel_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_cel_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_lig_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_lig_n_col (:,:) = nan @@ -1034,6 +1037,11 @@ subroutine InitHistory(this, bounds) '(per-area-gridcell; only makes sense with dov2xy=.false.)', & ptr_patch=this%dwt_conv_nflux_patch, default='inactive') + this%litfall_n_patch(begp:endp) = spval + call hist_addfld1d (fname='LITFALL_N', units='gN/m^2/s', & + avgflag='A', long_name='N Flux from vegetation to soil', & + ptr_patch=this%litfall_n_patch) + this%dwt_frootn_to_litr_met_n_col(begc:endc,:) = spval call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_MET_N', units='gN/m^2/s', type2d='levdcmp', & avgflag='A', long_name='fine root to litter due to landcover change', & @@ -1820,6 +1828,49 @@ subroutine Summary_nitrogenflux(this, bounds, num_soilc, filter_soilc, num_soilp this%m_deadcrootn_xfer_to_fire_patch(p) + & this%m_retransn_to_fire_patch(p) + ! total N fluxes from veg to litter + this%litfall_n_patch(p) = & + this%m_leafn_to_litter_patch(p) + & + this%m_frootn_to_litter_patch(p) + & + this%m_leafn_storage_to_litter_patch(p) + & + this%m_frootn_storage_to_litter_patch(p) + & + this%m_livestemn_storage_to_litter_patch(p) + & + this%m_deadstemn_storage_to_litter_patch(p) + & + this%m_livecrootn_storage_to_litter_patch(p) + & + this%m_deadcrootn_storage_to_litter_patch(p) + & + this%m_leafn_xfer_to_litter_patch(p) + & + this%m_frootn_xfer_to_litter_patch(p) + & + this%m_livestemn_xfer_to_litter_patch(p) + & + this%m_deadstemn_xfer_to_litter_patch(p) + & + this%m_livecrootn_xfer_to_litter_patch(p) + & + this%m_deadcrootn_xfer_to_litter_patch(p) + & + this%m_livestemn_to_litter_patch(p) + & + this%m_deadstemn_to_litter_patch(p) + & + this%m_livecrootn_to_litter_patch(p) + & + this%m_deadcrootn_to_litter_patch(p) + & + this%m_retransn_to_litter_patch(p) + & + this%hrv_leafn_to_litter_patch(p) + & + this%hrv_frootn_to_litter_patch(p) + & + this%hrv_leafn_storage_to_litter_patch(p) + & + this%hrv_frootn_storage_to_litter_patch(p) + & + this%hrv_livestemn_storage_to_litter_patch(p) + & + this%hrv_deadstemn_storage_to_litter_patch(p) + & + this%hrv_livecrootn_storage_to_litter_patch(p) + & + this%hrv_deadcrootn_storage_to_litter_patch(p) + & + this%hrv_leafn_xfer_to_litter_patch(p) + & + this%hrv_frootn_xfer_to_litter_patch(p) + & + this%hrv_livestemn_xfer_to_litter_patch(p) + & + this%hrv_deadstemn_xfer_to_litter_patch(p) + & + this%hrv_livecrootn_xfer_to_litter_patch(p) + & + this%hrv_deadcrootn_xfer_to_litter_patch(p) + & + this%hrv_livestemn_to_litter_patch(p) + & + this%hrv_livecrootn_to_litter_patch(p) + & + this%hrv_deadcrootn_to_litter_patch(p) + & + this%hrv_retransn_to_litter_patch(p) + & + this%livestemn_to_litter_patch(p) + & + this%leafn_to_litter_patch(p) + & + this%frootn_to_litter_patch(p) + end do call p2c(bounds, num_soilc, filter_soilc, & From 99a2ea03b219dcdd5a6350fc4e5cf60a4a284eb9 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 6 Mar 2018 17:23:39 -0700 Subject: [PATCH 078/144] Add TSL diagnostic and GSSUNLN/GSSHALN to subroutine Photosynthesis --- src/biogeophys/HydrologyNoDrainageMod.F90 | 5 +++ src/biogeophys/PhotosynthesisMod.F90 | 41 +++++++++++++++++++++-- src/biogeophys/TemperatureType.F90 | 12 +++++-- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index b0953c1e99..05dcb8a145 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -132,6 +132,7 @@ subroutine HydrologyNoDrainage(bounds, & t_grnd => temperature_inst%t_grnd_col , & ! Output: [real(r8) (:) ] ground temperature (Kelvin) t_grnd_u => temperature_inst%t_grnd_u_col , & ! Output: [real(r8) (:) ] Urban ground temperature (Kelvin) t_grnd_r => temperature_inst%t_grnd_r_col , & ! Output: [real(r8) (:) ] Rural ground temperature (Kelvin) + tsl => temperature_inst%tsl_col , & ! Output: [real(r8) (:) ] temperature of near-surface soil layer (Kelvin) t_soi_10cm => temperature_inst%t_soi10cm_col , & ! Output: [real(r8) (:) ] soil temperature in top 10cm of soil (Kelvin) tsoi17 => temperature_inst%t_soi17cm_col , & ! Output: [real(r8) (:) ] soil temperature in top 17cm of soil (Kelvin) t_sno_mul_mss => temperature_inst%t_sno_mul_mss_col , & ! Output: [real(r8) (:) ] col snow temperature multiplied by layer mass, layer sum (K * kg/m2) @@ -344,6 +345,7 @@ subroutine HydrologyNoDrainage(bounds, & end do ! Determine ground temperature, ending water balance and volumetric soil water + ! Calculate temperature of near-surface soil layer ! Calculate soil temperature and total water (liq+ice) in top 10cm of soil ! Calculate soil temperature and total water (liq+ice) in top 17cm of soil do fc = 1, num_nolakec @@ -362,6 +364,9 @@ subroutine HydrologyNoDrainage(bounds, & c = filter_nolakec(fc) l = col%landunit(c) if (.not. lun%urbpoi(l)) then + if (j == 1) then + tsl(c) = t_soisno(c,j) + end if ! soil T at top 17 cm added by F. Li and S. Levis if (zi(c,j) <= 0.17_r8) then fracl = 1._r8 diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 9edbb4477b..99920f4cca 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -803,13 +803,13 @@ subroutine Restart(this, bounds, ncid, flag) !KO call restartvar(ncid=ncid, flag=flag, varname='GSSUNLN', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', & + dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sun_ln_patch) call restartvar(ncid=ncid, flag=flag, varname='GSSHALN', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', & + dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_ln_patch) @@ -963,7 +963,9 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! a multi-layer canopy ! ! !USES: - use clm_varcon , only : rgas, tfrz + use clm_varcon , only : rgas, tfrz, spval, degpsec, isecspday + use GridcellType , only : grc + use clm_time_manager , only : get_curr_date, get_step_size use clm_varctl , only : cnallocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use pftconMod , only : nbrdlf_dcd_tmp_shrub, npcropmin @@ -1106,6 +1108,12 @@ subroutine Photosynthesis ( bounds, fn, filterp, & real(r8) :: sum_nscaler real(r8) :: total_lai integer :: nptreemax + + integer :: local_secp1 ! seconds into current date in local time + real(r8) :: dtime ! land model time step (sec) + integer :: year,month,day,secs ! calendar info for current time step + integer :: g ! index + integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon !------------------------------------------------------------------------------ ! Temperature and soil water response functions @@ -1156,6 +1164,8 @@ subroutine Photosynthesis ( bounds, fn, filterp, & an => photosyns_inst%an_patch , & ! Output: [real(r8) (:,:) ] net leaf photosynthesis (umol CO2/m**2/s) gb_mol => photosyns_inst%gb_mol_patch , & ! Output: [real(r8) (:) ] leaf boundary layer conductance (umol H2O/m**2/s) gs_mol => photosyns_inst%gs_mol_patch , & ! Output: [real(r8) (:,:) ] leaf stomatal conductance (umol H2O/m**2/s) + gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) vcmax_z => photosyns_inst%vcmax_z_patch , & ! Output: [real(r8) (:,:) ] maximum rate of carboxylation (umol co2/m**2/s) cp => photosyns_inst%cp_patch , & ! Output: [real(r8) (:) ] CO2 compensation point (Pa) kc => photosyns_inst%kc_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for CO2 (Pa) @@ -1215,6 +1225,11 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 !==============================================================================! + ! Determine seconds of current time step + + dtime = get_step_size() + call get_curr_date (year, month, day, secs) + ! vcmax25 parameters, from CN fnr = 7.16_r8 @@ -1572,6 +1587,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & do f = 1, fn p = filterp(f) c = patch%column(p) + g = patch%gridcell(p) ! Leaf boundary layer conductance, umol/m**2/s @@ -1646,6 +1662,25 @@ subroutine Photosynthesis ( bounds, fn, filterp, & if (an(p,iv) < 0._r8) gs_mol(p,iv) = bbb(p) + ! Get local noon sunlit and shaded stomatal conductance + local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime + local_secp1 = mod(local_secp1,isecspday) + + ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) + if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then + if (phase == 'sun') then + gs_mol_sun_ln(p,iv) = gs_mol(p,iv) + else if (phase == 'sha') then + gs_mol_sha_ln(p,iv) = gs_mol(p,iv) + end if + else + if (phase == 'sun') then + gs_mol_sun_ln(p,iv) = spval + else if (phase == 'sha') then + gs_mol_sha_ln(p,iv) = spval + end if + end if + ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) cs = cair(p) - 1.4_r8/gb_mol(p) * an(p,iv) * forc_pbot(c) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 0466e81af3..8bef2d3216 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -33,9 +33,10 @@ module TemperatureType integer, pointer :: ndaysteps_patch (:) ! number of daytime steps accumulated from mid-night, LUNA specific integer, pointer :: nnightsteps_patch (:) ! number of nighttime steps accumulated from mid-night, LUNA specific real(r8), pointer :: t_h2osfc_col (:) ! col surface water temperature - real(r8), pointer :: t_h2osfc_bef_col (:) ! col surface water temperature from time-step before - real(r8), pointer :: t_ssbef_col (:,:) ! col soil/snow temperature before update (-nlevsno+1:nlevgrnd) - real(r8), pointer :: t_soisno_col (:,:) ! col soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) + real(r8), pointer :: t_h2osfc_bef_col (:) ! col surface water temperature from time-step before + real(r8), pointer :: t_ssbef_col (:,:) ! col soil/snow temperature before update (-nlevsno+1:nlevgrnd) + real(r8), pointer :: t_soisno_col (:,:) ! col soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) + real(r8), pointer :: tsl_col (:) ! col temperature of near-surface soil layer (Kelvin) real(r8), pointer :: t_soi10cm_col (:) ! col soil temperature in top 10cm of soil (Kelvin) real(r8), pointer :: t_soi17cm_col (:) ! col soil temperature in top 17cm of soil (Kelvin) real(r8), pointer :: t_sno_mul_mss_col (:) ! col snow temperature multiplied by layer mass, layer sum (K * kg/m2) @@ -225,6 +226,7 @@ subroutine InitAllocate(this, bounds) allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan allocate(this%t_sno_mul_mss_col (begc:endc)) ; this%t_sno_mul_mss_col (:) = nan + allocate(this%tsl_col (begc:endc)) ; this%tsl_col (:) = nan allocate(this%t_soi10cm_col (begc:endc)) ; this%t_soi10cm_col (:) = nan allocate(this%t_soi17cm_col (begc:endc)) ; this%t_soi17cm_col (:) = spval allocate(this%dt_grnd_col (begc:endc)) ; this%dt_grnd_col (:) = nan @@ -446,6 +448,10 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) 'to get mass-weighted temperature, divide by (SNOWICE_ICE+SNOWLIQ_ICE)', & ptr_col=this%t_sno_mul_mss_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & default='inactive') + this%tsl_col(begc:endc) = spval + call hist_addfld1d (fname='TSL', units='K', & + avgflag='A', long_name='temperature of near-surface soil layer (vegetated landunits only)', & + ptr_col=this%tsl_col, l2g_scale_type='veg') if (use_cndv .or. use_crop) then active = "active" From 79d4b86369f28ea3b5933c6eb7baf925bb51cb34 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 1 Jun 2018 09:56:24 -0600 Subject: [PATCH 079/144] Change urban skin temperature from longwave-derived to surface temperature (TG). --- src/biogeophys/SoilFluxesMod.F90 | 110 ++--------------------------- src/biogeophys/TemperatureType.F90 | 16 ----- src/main/clm_driver.F90 | 11 +-- 3 files changed, 7 insertions(+), 130 deletions(-) diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 index fcde1d5d7e..701bb22fcd 100644 --- a/src/biogeophys/SoilFluxesMod.F90 +++ b/src/biogeophys/SoilFluxesMod.F90 @@ -22,9 +22,6 @@ module SoilFluxesMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch -!KO - use UrbanParamsType , only : urbanparams_type -!KO ! ! !PUBLIC TYPES: implicit none @@ -37,18 +34,11 @@ module SoilFluxesMod contains !----------------------------------------------------------------------- -!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & -!KO num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & -!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & -!KO waterstate_inst, energyflux_inst, waterflux_inst) -!KO subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & - num_urbanc, filter_urbanc, & num_urbanp, filter_urbanp, & num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & - waterstate_inst, energyflux_inst, waterflux_inst, urbanparams_inst) -!KO + waterstate_inst, energyflux_inst, waterflux_inst) ! ! !DESCRIPTION: ! Update surface fluxes based on the new ground temperature @@ -57,15 +47,8 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & use clm_time_manager , only : get_step_size use clm_varcon , only : hvap, cpair, grav, vkc, tfrz, sb use landunit_varcon , only : istsoil, istcrop -!KO use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv -!KO - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv -!KO + use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv use subgridAveMod , only : p2c -!KO - use clm_varcon , only : sb - use subgridAveMod , only : p2l -!KO ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -73,12 +56,8 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_urbanl ! number of urban landunits in clump integer , intent(in) :: filter_urbanl(:) ! urban landunit filter -!KO - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter integer , intent(in) :: num_urbanp ! number of urban pfts in clump integer , intent(in) :: filter_urbanp(:) ! urban pft filter -!KO integer , intent(in) :: num_nolakep ! number of column non-lake points in pft filter integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points type(atm2lnd_type) , intent(in) :: atm2lnd_inst @@ -86,18 +65,12 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & type(temperature_type) , intent(in) :: temperature_inst type(canopystate_type) , intent(in) :: canopystate_inst type(waterstate_type) , intent(in) :: waterstate_inst -!KO - type(urbanparams_type) , intent(in) :: urbanparams_inst -!KO type(waterflux_type) , intent(inout) :: waterflux_inst type(energyflux_type) , intent(inout) :: energyflux_inst ! ! !LOCAL VARIABLES: integer :: p,c,g,j,pi,l ! indices -!KO integer :: fc,fp ! lake filtered column and pft indices -!KO - integer :: fc,fp,fl ! lake filtered column and pft indices -!KO + integer :: fc,fp ! lake filtered column and pft indices real(r8) :: dtime ! land model time step (sec) real(r8) :: egsmax(bounds%begc:bounds%endc) ! max. evaporation which soil can provide at one time step real(r8) :: egirat(bounds%begc:bounds%endc) ! ratio of topsoil_evap_tot : egsmax @@ -110,17 +83,6 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & real(r8) :: t_grnd0(bounds%begc:bounds%endc) ! t_grnd of previous time step real(r8) :: lw_grnd real(r8) :: fsno_eff -!KO - real(r8) :: eflx_lwrad_out_lun(bounds%begl:bounds%endl) ! emitted infrared (longwave) radiation (W/m**2) - real(r8) :: emg_roof(bounds%begl:bounds%endl) ! roof emissivity - real(r8) :: emg_sunwall(bounds%begl:bounds%endl) ! sunwall emissivity - real(r8) :: emg_shadewall(bounds%begl:bounds%endl) ! shadewall emissivity - real(r8) :: emg_road_perv(bounds%begl:bounds%endl) ! pervious road emissivity - real(r8) :: emg_road_imperv(bounds%begl:bounds%endl) ! impervious road emissivity - real(r8) :: emg_road ! road emissivity - real(r8) :: emg_canyon ! canyon emissivity - real(r8) :: emg_urban ! effective urban emissivity -!KO !----------------------------------------------------------------------- associate( & @@ -144,15 +106,7 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & ! emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity ! t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) !ABT -!KO - t_skin_lun => temperature_inst%t_skin_lun , & ! Output: [real(r8) (:) ] landunit skin temperature (K) t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) - vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road - vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall - wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road - wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:) ] weight of roof with respect to landunit - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street hwidth (-) -!KO t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] soil/snow temperature before update t_h2osfc_bef => temperature_inst%t_h2osfc_bef_col , & ! Input: [real(r8) (:) ] saved surface water temperature @@ -492,66 +446,14 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & errsoi_patch(bounds%begp:bounds%endp), & errsoi_col(bounds%begc:bounds%endc)) -!KO - ! Calculate urban skin temperature. Must be done here instead of in - ! UrbanFluxes because eflx_lwrad_out has been updated above. This section - ! of code could be placed in a subroutine that could be called here or - ! called from within clm_driver after the call to SoilFluxes. -!KO - ! Assign urban surface emissivities - - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - - if (col%itype(c) == icol_roof ) then - emg_roof(l) = emg(c) - else if (col%itype(c) == icol_sunwall ) then - emg_sunwall(l) = emg(c) - else if (col%itype(c) == icol_shadewall) then - emg_shadewall(l) = emg(c) - else if (col%itype(c) == icol_road_perv) then - emg_road_perv(l) = emg(c) - else if (col%itype(c) == icol_road_imperv) then - emg_road_imperv(l) = emg(c) - end if - - end do - - ! Update landunit level upward longwave radiation - - call p2l(bounds, & - eflx_lwrad_out(bounds%begp:bounds%endp), & - eflx_lwrad_out_lun(bounds%begl:bounds%endl), & - p2c_scale_type = 'unity', c2l_scale_type = 'urbanf') - - ! Calculate urban effective emissivity and skin temperature - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - - - emg_road = emg_road_perv(l)*wtroad_perv(l) + emg_road_imperv(l)*(1._r8-wtroad_perv(l)) - - ! The expression for vf_sw is for per unit wall area - ! So multiply it by canyon_hwr to convert to per unit ground area - ! Then the following should equal one: 2*canyon_hwr*vf_sw + vf_sr - emg_canyon = emg_road*vf_sr(l) + emg_sunwall(l)*vf_sw(l)*canyon_hwr(l) + emg_shadewall(l)*vf_sw(l)*canyon_hwr(l) - - emg_urban = emg_roof(l)*wtlunit_roof(l) + emg_canyon*(1._r8-wtlunit_roof(l)) - t_skin_lun(l) = sqrt(sqrt(eflx_lwrad_out_lun(l)/(sb*emg_urban))) - - end do - - ! Assign landunit-level t_skin to each urban pft + ! Assign column-level t_soisno(snl+1) to t_skin for each urban pft do fp = 1, num_urbanp p = filter_urbanp(fp) - l = patch%landunit(p) + c = patch%column(p) - t_skin_patch(p) = t_skin_lun(l) + t_skin_patch(p) = t_soisno(c,col%snl(c)+1) end do -!KO call t_stopf('bgp2_loop_4') diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 8bef2d3216..354a6cac7f 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -23,9 +23,7 @@ module TemperatureType ! Temperatures real(r8), pointer :: t_veg_patch (:) ! patch vegetation temperature (Kelvin) -!KO real(r8), pointer :: t_skin_patch (:) ! patch skin temperature (Kelvin) -!KO real(r8), pointer :: t_veg_day_patch (:) ! patch daytime accumulative vegetation temperature (Kelvinx*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg_night_patch (:) ! patch night-time accumulative vegetation temperature (Kelvin*nsteps), LUNA specific, from midnight to current step real(r8), pointer :: t_veg10_day_patch (:) ! 10 day running mean of patch daytime time vegetation temperature (Kelvin), LUNA specific, but can be reused @@ -49,9 +47,6 @@ module TemperatureType real(r8), pointer :: t_sunw_inner_lun (:) ! lun sunwall inside surface temperature (K) real(r8), pointer :: t_shdw_inner_lun (:) ! lun shadewall inside surface temperature (K) real(r8), pointer :: t_floor_lun (:) ! lun floor temperature (K) -!KO - real(r8), pointer :: t_skin_lun (:) ! lun skin temperature (K) -!KO real(r8), pointer :: snot_top_col (:) ! col temperature of top snow layer [K] real(r8), pointer :: dTdz_top_col (:) ! col temperature gradient in top layer [K m-1] real(r8), pointer :: dt_veg_patch (:) ! patch change in t_veg, last iteration (Kelvin) @@ -194,9 +189,7 @@ subroutine InitAllocate(this, bounds) ! Temperatures allocate(this%t_veg_patch (begp:endp)) ; this%t_veg_patch (:) = nan -!KO allocate(this%t_skin_patch (begp:endp)) ; this%t_skin_patch (:) = nan -!KO if(use_luna) then allocate(this%t_veg_day_patch (begp:endp)) ; this%t_veg_day_patch (:) = spval allocate(this%t_veg_night_patch (begp:endp)) ; this%t_veg_night_patch (:) = spval @@ -218,9 +211,6 @@ subroutine InitAllocate(this, bounds) allocate(this%t_sunw_inner_lun (begl:endl)) ; this%t_sunw_inner_lun (:) = nan allocate(this%t_shdw_inner_lun (begl:endl)) ; this%t_shdw_inner_lun (:) = nan allocate(this%t_floor_lun (begl:endl)) ; this%t_floor_lun (:) = nan -!KO - allocate(this%t_skin_lun (begl:endl)) ; this%t_skin_lun (:) = nan -!KO allocate(this%snot_top_col (begc:endc)) ; this%snot_top_col (:) = nan allocate(this%dTdz_top_col (begc:endc)) ; this%dTdz_top_col (:) = nan allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan @@ -397,16 +387,10 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='vegetation temperature', & ptr_patch=this%t_veg_patch) -!KO this%t_skin_patch(begp:endp) = spval call hist_addfld1d(fname='TSKIN', units='K', & avgflag='A', long_name='skin temperature', & ptr_patch=this%t_skin_patch, c2l_scale_type='urbans') -! this%t_skin_lun(begl:endl) = spval -! call hist_addfld1d(fname='TSKIN', units='K', & -! avgflag='A', long_name='skin temperature', & -! ptr_lun=this%t_skin_patch, set_nourb=spval, l2g_scale_type='unity') -!KO this%t_grnd_col(begc:endc) = spval call hist_addfld1d (fname='TG', units='K', & diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 8765697c02..a50a57abe3 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -661,22 +661,13 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! ============================================================================ call t_startf('bgp2') -!KO call SoilFluxes(bounds_clump, & -!KO filter(nc)%num_urbanl, filter(nc)%urbanl, & -!KO filter(nc)%num_nolakec, filter(nc)%nolakec, & -!KO filter(nc)%num_nolakep, filter(nc)%nolakep, & -!KO atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & -!KO energyflux_inst, waterflux_inst) -!KO call SoilFluxes(bounds_clump, & filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & filter(nc)%num_urbanp, filter(nc)%urbanp, & filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_nolakep, filter(nc)%nolakep, & atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & - energyflux_inst, waterflux_inst, urbanparams_inst) -!KO + energyflux_inst, waterflux_inst) call t_stopf('bgp2') ! ============================================================================ From ff1a0d0fbc24dda45e1be343c1c868a0aa3a92db Mon Sep 17 00:00:00 2001 From: wwieder Date: Thu, 28 Jun 2018 14:37:11 -0600 Subject: [PATCH 080/144] Addresses bugs with gridcell averaging of FUN vars Addresses issue #426 where special land units were assigned spval in InitCold for FUN variables. As noted by Bill Sacks noted in #431 "BGC variables are all set to 0 for special landunits via the SetValues subroutines in each *Type.F90 module". Most changes in CNVegNitrogenFluxType.F90 including: * Set these FUN variables to 0 for special land units. (This may be rudundant?) * Reset spval to 0 in the Restart subroutine, to overwrite existing restart files. Similar, but less extensive modifications need for CNVegCarbonFluxType.F90 Added conditional to SoilBiogeochemNitrogenFluxType.F90 where NFIX_TO_SMINN is only on by default if FUN is off, as the variable is redundant with NFIX. --- src/biogeochem/CNVegCarbonFluxType.F90 | 8 +- src/biogeochem/CNVegNitrogenFluxType.F90 | 135 ++++++++++++++---- .../SoilBiogeochemNitrogenFluxType.F90 | 15 +- 3 files changed, 118 insertions(+), 40 deletions(-) diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 57cee383d5..3049fe2a91 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -397,7 +397,6 @@ subroutine Init(this, bounds, carbon_type) call this%InitAllocate ( bounds, carbon_type) call this%InitHistory ( bounds, carbon_type ) - call this%InitCold (bounds ) end subroutine Init @@ -1662,13 +1661,11 @@ subroutine InitHistory(this, bounds, carbon_type) avgflag='A', long_name='Total C used by N uptake in FUN', & ptr_patch=this%npp_Nuptake_patch) - this%npp_growth_patch(begp:endp) = spval + this%npp_growth_patch(begp:endp) = spval call hist_addfld1d (fname='NPP_GROWTH', units='gC/m^2/s', & avgflag='A', long_name='Total C used for growth in FUN', & ptr_patch=this%npp_growth_patch) - - this%leafc_change_patch(begp:endp) = spval call hist_addfld1d (fname='LEAFC_CHANGE', units='gC/m^2/s', & avgflag='A', long_name='C change in leaf', & @@ -3322,7 +3319,7 @@ subroutine InitCold(this, bounds) do p = bounds%begp,bounds%endp l = patch%landunit(p) this%gpp_before_downreg_patch(p) = 0._r8 - + ! WW should these be considered spval or 0? if (lun%ifspecial(l)) then this%availc_patch(p) = spval this%xsmrpool_recover_patch(p) = spval @@ -3574,6 +3571,7 @@ subroutine RestartBulkOnly ( this, bounds, ncid, flag ) dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%leafc_to_litter_fun_patch) + call set_missing_vals_to_constant(this%leafc_to_litter_fun_patch, 0._r8) end if end subroutine RestartBulkOnly diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index 1bb630c687..f28cfbfc62 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -178,6 +178,7 @@ module CNVegNitrogenFluxType real(r8), pointer :: ndeploy_patch (:) ! patch total N deployed to growth and storage (gN/m2/s) real(r8), pointer :: wood_harvestn_patch (:) ! patch total N losses to wood product pools (gN/m2/s) real(r8), pointer :: wood_harvestn_col (:) ! col total N losses to wood product pools (gN/m2/s) (p2c) + real(r8), pointer :: litfall_n_patch (:) ! total N passed from plant to litter (gN/m2/s) ! phenology: litterfall and crop fluxes real(r8), pointer :: phenology_n_to_litr_met_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s) @@ -441,6 +442,8 @@ subroutine InitAllocate(this, bounds) allocate(this%dwt_crop_productn_gain_patch (begp:endp)) ; this%dwt_crop_productn_gain_patch (:) = nan allocate(this%wood_harvestn_col (begc:endc)) ; this%wood_harvestn_col (:) = nan + allocate(this%litfall_n_patch (begp:endp)) ; this%litfall_n_patch (:) = nan + allocate(this%dwt_frootn_to_litr_met_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_met_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_cel_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_cel_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_lig_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_lig_n_col (:,:) = nan @@ -1034,6 +1037,11 @@ subroutine InitHistory(this, bounds) '(per-area-gridcell; only makes sense with dov2xy=.false.)', & ptr_patch=this%dwt_conv_nflux_patch, default='inactive') + this%litfall_n_patch(begp:endp) = spval + call hist_addfld1d (fname='LITFALL_N', units='gN/m^2/s', & + avgflag='A', long_name='N Flux from vegetation to soil', & + ptr_patch=this%litfall_n_patch) + this%dwt_frootn_to_litr_met_n_col(begc:endc,:) = spval call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_MET_N', units='gN/m^2/s', type2d='levdcmp', & avgflag='A', long_name='fine root to litter due to landcover change', & @@ -1267,42 +1275,42 @@ subroutine InitCold(this, bounds) if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then this%fert_counter_patch(p) = 0._r8 end if - if ( use_fun ) then + if ( use_fun ) then !previously set to spval for special land units if (lun%ifspecial(l)) then - this%plant_ndemand_patch(p) = spval - this%avail_retransn_patch(p) = spval - this%plant_nalloc_patch(p) = spval - this%Npassive_patch(p) = spval - this%Nactive_patch(p) = spval - this%Nnonmyc_patch(p) = spval - this%Nam_patch(p) = spval - this%Necm_patch(p) = spval + this%plant_ndemand_patch(p) = 0._r8 + this%avail_retransn_patch(p) = 0._r8 + this%plant_nalloc_patch(p) = 0._r8 + this%Npassive_patch(p) = 0._r8 + this%Nactive_patch(p) = 0._r8 + this%Nnonmyc_patch(p) = 0._r8 + this%Nam_patch(p) = 0._r8 + this%Necm_patch(p) = 0._r8 if (use_nitrif_denitrif) then - this%Nactive_no3_patch(p) = spval - this%Nactive_nh4_patch(p) = spval - this%Nnonmyc_no3_patch(p) = spval - this%Nnonmyc_nh4_patch(p) = spval - this%Nam_no3_patch(p) = spval - this%Nam_nh4_patch(p) = spval - this%Necm_no3_patch(p) = spval - this%Necm_nh4_patch(p) = spval + this%Nactive_no3_patch(p) = 0._r8 + this%Nactive_nh4_patch(p) = 0._r8 + this%Nnonmyc_no3_patch(p) = 0._r8 + this%Nnonmyc_nh4_patch(p) = 0._r8 + this%Nam_no3_patch(p) = 0._r8 + this%Nam_nh4_patch(p) = 0._r8 + this%Necm_no3_patch(p) = 0._r8 + this%Necm_nh4_patch(p) = 0._r8 end if - this%Nfix_patch(p) = spval - this%Nretrans_patch(p) = spval - this%Nretrans_org_patch(p) = spval - this%Nretrans_season_patch(p) = spval - this%Nretrans_stress_patch(p) = spval - this%Nuptake_patch(p) = spval - this%sminn_to_plant_fun_patch(p) = spval - this%cost_nfix_patch = spval - this%cost_nactive_patch = spval - this%cost_nretrans_patch = spval - this%nuptake_npp_fraction_patch = spval + this%Nfix_patch(p) = 0._r8 + this%Nretrans_patch(p) = 0._r8 + this%Nretrans_org_patch(p) = 0._r8 + this%Nretrans_season_patch(p) = 0._r8 + this%Nretrans_stress_patch(p) = 0._r8 + this%Nuptake_patch(p) = 0._r8 + this%sminn_to_plant_fun_patch(p) = 0._r8 + this%cost_nfix_patch = 0._r8 + this%cost_nactive_patch = 0._r8 + this%cost_nretrans_patch = 0._r8 + this%nuptake_npp_fraction_patch = 0._r8 do j = 1, nlevdecomp - this%sminn_to_plant_fun_vr_patch(p,j) = spval - this%sminn_to_plant_fun_no3_vr_patch(p,j) = spval - this%sminn_to_plant_fun_nh4_vr_patch(p,j) = spval + this%sminn_to_plant_fun_vr_patch(p,j) = 0._r8 + this%sminn_to_plant_fun_no3_vr_patch(p,j) = 0._r8 + this%sminn_to_plant_fun_nh4_vr_patch(p,j) = 0._r8 end do end if end if @@ -1409,107 +1417,129 @@ subroutine Restart (this, bounds, ncid, flag ) interpinic_flag='interp', readvar=readvar, data=this%plant_nalloc_patch) if ( use_fun ) then +! special land units previously set to spval, not 0 +! modifications here should correct this call restartvar(ncid=ncid, flag=flag, varname='Nactive', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nactive_patch) + call set_missing_vals_to_constant(this%Nactive_patch, 0._r8) ! call restartvar(ncid=ncid, flag=flag, varname='Nnonmyc', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nnonmyc_patch) + call set_missing_vals_to_constant(this%Nnonmyc_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nam', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nam_patch) + call set_missing_vals_to_constant(this%Nam_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Necm', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Necm_patch) + call set_missing_vals_to_constant(this%Necm_patch, 0._r8) if (use_nitrif_denitrif) then call restartvar(ncid=ncid, flag=flag, varname='Nactive_no3', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nactive_no3_patch) + call set_missing_vals_to_constant(this%Nactive_no3_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nactive_nh4', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nactive_nh4_patch) + call set_missing_vals_to_constant(this%Nactive_nh4_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nnonmyc_no3', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nnonmyc_no3_patch) + call set_missing_vals_to_constant(this%Nnonmyc_no3_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nnonmyc_nh4', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nnonmyc_nh4_patch) + call set_missing_vals_to_constant(this%Nnonmyc_nh4_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nam_no3', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nam_no3_patch) + call set_missing_vals_to_constant(this%Nam_no3_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nam_nh4', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nam_nh4_patch) + call set_missing_vals_to_constant(this%Nam_nh4_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Necm_no3', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Necm_no3_patch) + call set_missing_vals_to_constant(this%Necm_no3_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Necm_nh4', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Necm_nh4_patch) + call set_missing_vals_to_constant(this%Necm_nh4_patch, 0._r8) end if ! call restartvar(ncid=ncid, flag=flag, varname='Npassive', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Npassive_patch) + call set_missing_vals_to_constant(this%Npassive_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nfix', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nfix_patch) + call set_missing_vals_to_constant(this%Nfix_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nretrans', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nretrans_patch) + call set_missing_vals_to_constant(this%Nretrans_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nretrans_org', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nretrans_org_patch) + call set_missing_vals_to_constant(this%Nretrans_org_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nretrans_season', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nretrans_season_patch) + call set_missing_vals_to_constant(this%Nretrans_season_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nretrans_stress', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nretrans_stress_patch) + call set_missing_vals_to_constant(this%Nretrans_stress_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='Nuptake', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%Nuptake_patch) + call set_missing_vals_to_constant(this%Nuptake_patch, 0._r8) call restartvar(ncid=ncid, flag=flag, varname='sminn_to_plant_fun', xtype=ncd_double, & dim1name='pft', & long_name='Total soil N uptake of FUN', units='gN/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%sminn_to_plant_fun_patch) + call set_missing_vals_to_constant(this%sminn_to_plant_fun_patch, 0._r8) end if end subroutine Restart @@ -1820,6 +1850,49 @@ subroutine Summary_nitrogenflux(this, bounds, num_soilc, filter_soilc, num_soilp this%m_deadcrootn_xfer_to_fire_patch(p) + & this%m_retransn_to_fire_patch(p) + ! total N fluxes from veg to litter + this%litfall_n_patch(p) = & + this%m_leafn_to_litter_patch(p) + & + this%m_frootn_to_litter_patch(p) + & + this%m_leafn_storage_to_litter_patch(p) + & + this%m_frootn_storage_to_litter_patch(p) + & + this%m_livestemn_storage_to_litter_patch(p) + & + this%m_deadstemn_storage_to_litter_patch(p) + & + this%m_livecrootn_storage_to_litter_patch(p) + & + this%m_deadcrootn_storage_to_litter_patch(p) + & + this%m_leafn_xfer_to_litter_patch(p) + & + this%m_frootn_xfer_to_litter_patch(p) + & + this%m_livestemn_xfer_to_litter_patch(p) + & + this%m_deadstemn_xfer_to_litter_patch(p) + & + this%m_livecrootn_xfer_to_litter_patch(p) + & + this%m_deadcrootn_xfer_to_litter_patch(p) + & + this%m_livestemn_to_litter_patch(p) + & + this%m_deadstemn_to_litter_patch(p) + & + this%m_livecrootn_to_litter_patch(p) + & + this%m_deadcrootn_to_litter_patch(p) + & + this%m_retransn_to_litter_patch(p) + & + this%hrv_leafn_to_litter_patch(p) + & + this%hrv_frootn_to_litter_patch(p) + & + this%hrv_leafn_storage_to_litter_patch(p) + & + this%hrv_frootn_storage_to_litter_patch(p) + & + this%hrv_livestemn_storage_to_litter_patch(p) + & + this%hrv_deadstemn_storage_to_litter_patch(p) + & + this%hrv_livecrootn_storage_to_litter_patch(p) + & + this%hrv_deadcrootn_storage_to_litter_patch(p) + & + this%hrv_leafn_xfer_to_litter_patch(p) + & + this%hrv_frootn_xfer_to_litter_patch(p) + & + this%hrv_livestemn_xfer_to_litter_patch(p) + & + this%hrv_deadstemn_xfer_to_litter_patch(p) + & + this%hrv_livecrootn_xfer_to_litter_patch(p) + & + this%hrv_deadcrootn_xfer_to_litter_patch(p) + & + this%hrv_livestemn_to_litter_patch(p) + & + this%hrv_livecrootn_to_litter_patch(p) + & + this%hrv_deadcrootn_to_litter_patch(p) + & + this%hrv_retransn_to_litter_patch(p) + & + this%livestemn_to_litter_patch(p) + & + this%leafn_to_litter_patch(p) + & + this%frootn_to_litter_patch(p) + end do call p2c(bounds, num_soilc, filter_soilc, & diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 index f1ff0e48ca..e0fc73040a 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 @@ -316,10 +316,17 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='atmospheric N deposition to soil mineral N', & ptr_col=this%ndep_to_sminn_col) - this%nfix_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & - ptr_col=this%nfix_to_sminn_col) + if ( use_fun ) then ! redundant & confusing to write this out if FUN is on + this%nfix_to_sminn_col(begc:endc) = spval + call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & + avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & + ptr_col=this%nfix_to_sminn_col, default='inactive') + else + this%nfix_to_sminn_col(begc:endc) = spval + call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & + avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & + ptr_col=this%nfix_to_sminn_col) + end if this%ffix_to_sminn_col(begc:endc) = spval call hist_addfld1d (fname='FFIX_TO_SMINN', units='gN/m^2/s', & From 542568c765f8cd90fa49b2f7e96c57162ea2f1cf Mon Sep 17 00:00:00 2001 From: wwieder Date: Thu, 28 Jun 2018 15:43:08 -0600 Subject: [PATCH 081/144] corrections to nfix_bug pull request --- src/biogeochem/CNVegCarbonFluxType.F90 | 2 ++ src/biogeochem/CNVegNitrogenFluxType.F90 | 2 ++ .../SoilBiogeochemNitrogenFluxType.F90 | 17 ++++++++--------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 3049fe2a91..2ec35353f0 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -397,6 +397,7 @@ subroutine Init(this, bounds, carbon_type) call this%InitAllocate ( bounds, carbon_type) call this%InitHistory ( bounds, carbon_type ) + call this%InitCold (bounds ) end subroutine Init @@ -3571,6 +3572,7 @@ subroutine RestartBulkOnly ( this, bounds, ncid, flag ) dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%leafc_to_litter_fun_patch) + ! BACKWARDS_COMPATIBILITY(wrw, 2018-06-28) re. issue #426 call set_missing_vals_to_constant(this%leafc_to_litter_fun_patch, 0._r8) end if diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index f28cfbfc62..b7ede09308 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -1417,6 +1417,7 @@ subroutine Restart (this, bounds, ncid, flag ) interpinic_flag='interp', readvar=readvar, data=this%plant_nalloc_patch) if ( use_fun ) then +! set_missing_vals_to_constant for BACKWARDS_COMPATIBILITY(wrw, 2018-06-28) re. issue #426 ! special land units previously set to spval, not 0 ! modifications here should correct this call restartvar(ncid=ncid, flag=flag, varname='Nactive', xtype=ncd_double, & @@ -1541,6 +1542,7 @@ subroutine Restart (this, bounds, ncid, flag ) interpinic_flag='interp', readvar=readvar, data=this%sminn_to_plant_fun_patch) call set_missing_vals_to_constant(this%sminn_to_plant_fun_patch, 0._r8) end if +! End BACKWARDS_COMPATIBILITY(wrw, 2018-06-28) re. issue #426 end subroutine Restart diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 index e0fc73040a..4fec2e0806 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 @@ -316,23 +316,22 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='atmospheric N deposition to soil mineral N', & ptr_col=this%ndep_to_sminn_col) - if ( use_fun ) then ! redundant & confusing to write this out if FUN is on - this%nfix_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & - ptr_col=this%nfix_to_sminn_col, default='inactive') + if (use_fun) then + default = 'inactive' else - this%nfix_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & - ptr_col=this%nfix_to_sminn_col) + default = 'active' end if + this%nfix_to_sminn_col(begc:endc) = spval + call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & + avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & + ptr_col=this%nfix_to_sminn_col) this%ffix_to_sminn_col(begc:endc) = spval call hist_addfld1d (fname='FFIX_TO_SMINN', units='gN/m^2/s', & avgflag='A', long_name='free living N fixation to soil mineral N', & ptr_col=this%ffix_to_sminn_col) + default = 'active' do l = 1, ndecomp_cascade_transitions ! vertically integrated fluxes !-- mineralization/immobilization fluxes (none from CWD) From 9f88c649b0f3884e76c872f2cae3440e6908d85a Mon Sep 17 00:00:00 2001 From: wwieder Date: Fri, 29 Jun 2018 06:39:57 -0600 Subject: [PATCH 082/144] fixes a few more bugs I introduced modifies history files when FUN is on --- src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 index 4fec2e0806..49371a8c9d 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 @@ -294,7 +294,7 @@ subroutine InitHistory(this, bounds) integer :: begc, endc character(24) :: fieldname character(100) :: longname - character(8) :: vr_suffix + character(8) :: vr_suffix,default real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays !------------------------------------------------------------------------ @@ -324,14 +324,13 @@ subroutine InitHistory(this, bounds) this%nfix_to_sminn_col(begc:endc) = spval call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & - ptr_col=this%nfix_to_sminn_col) + ptr_col=this%nfix_to_sminn_col, default=default) this%ffix_to_sminn_col(begc:endc) = spval call hist_addfld1d (fname='FFIX_TO_SMINN', units='gN/m^2/s', & avgflag='A', long_name='free living N fixation to soil mineral N', & - ptr_col=this%ffix_to_sminn_col) + ptr_col=this%ffix_to_sminn_col, default=default) - default = 'active' do l = 1, ndecomp_cascade_transitions ! vertically integrated fluxes !-- mineralization/immobilization fluxes (none from CWD) From ef45d0d205f7028b68150640ae0bbaf11afb8ccf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 29 Jun 2018 13:16:19 -0600 Subject: [PATCH 083/144] Remove copy of adding TSL to history --- src/biogeophys/TemperatureType.F90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 81a047de65..5dfc3bc704 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -437,10 +437,6 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) 'to get mass-weighted temperature, divide by (SNOWICE_ICE+SNOWLIQ_ICE)', & ptr_col=this%t_sno_mul_mss_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & default='inactive') - this%tsl_col(begc:endc) = spval - call hist_addfld1d (fname='TSL', units='K', & - avgflag='A', long_name='temperature of near-surface soil layer (vegetated landunits only)', & - ptr_col=this%tsl_col, l2g_scale_type='veg') if (use_cndv .or. use_crop) then active = "active" From 395a863b46eb006ab87482ee6c4a184a6a6b438a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 1 Jul 2018 00:24:13 -0600 Subject: [PATCH 084/144] Update ndep forcing for all 1850 control cases for clm5_0 --- bld/namelist_files/use_cases/1850_control.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 0091aaa81e..b1104afc4e 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -32,8 +32,8 @@ 1850 1850 -lnd/clm2/ndepdata/fndep_clm_hist_simyr1850_0.9x1.25_CMIP6alpha02_c180426.nc +lnd/clm2/ndepdata/fndep_clm_hist_simyr1850_0.9x1.25_CMIP6_c180617.nc cycle From c12765f75af1e18d28fa5329adbf92c3c944d16e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Jul 2018 11:19:12 -0600 Subject: [PATCH 085/144] Use 1850 CMIP6 ndep file only with CLM50, remove lit_fall_nitrogen from Charlie as causing problems --- bld/namelist_files/use_cases/1850_control.xml | 4 +- src/biogeochem/CNVegNitrogenFluxType.F90 | 52 ------------------- 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index b1104afc4e..1bce46e1e0 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -35,8 +35,8 @@ lnd/clm2/ndepdata/fndep_clm_hist_simyr1850_0.9x1.25_CMIP6_c180617.nc -cycle +cycle -NDEP_month +NDEP_month diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index b7ede09308..6836fd74a1 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -178,8 +178,6 @@ module CNVegNitrogenFluxType real(r8), pointer :: ndeploy_patch (:) ! patch total N deployed to growth and storage (gN/m2/s) real(r8), pointer :: wood_harvestn_patch (:) ! patch total N losses to wood product pools (gN/m2/s) real(r8), pointer :: wood_harvestn_col (:) ! col total N losses to wood product pools (gN/m2/s) (p2c) - real(r8), pointer :: litfall_n_patch (:) ! total N passed from plant to litter (gN/m2/s) - ! phenology: litterfall and crop fluxes real(r8), pointer :: phenology_n_to_litr_met_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s) real(r8), pointer :: phenology_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gN/m3/s) @@ -442,8 +440,6 @@ subroutine InitAllocate(this, bounds) allocate(this%dwt_crop_productn_gain_patch (begp:endp)) ; this%dwt_crop_productn_gain_patch (:) = nan allocate(this%wood_harvestn_col (begc:endc)) ; this%wood_harvestn_col (:) = nan - allocate(this%litfall_n_patch (begp:endp)) ; this%litfall_n_patch (:) = nan - allocate(this%dwt_frootn_to_litr_met_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_met_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_cel_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_cel_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_lig_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_lig_n_col (:,:) = nan @@ -1037,11 +1033,6 @@ subroutine InitHistory(this, bounds) '(per-area-gridcell; only makes sense with dov2xy=.false.)', & ptr_patch=this%dwt_conv_nflux_patch, default='inactive') - this%litfall_n_patch(begp:endp) = spval - call hist_addfld1d (fname='LITFALL_N', units='gN/m^2/s', & - avgflag='A', long_name='N Flux from vegetation to soil', & - ptr_patch=this%litfall_n_patch) - this%dwt_frootn_to_litr_met_n_col(begc:endc,:) = spval call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_MET_N', units='gN/m^2/s', type2d='levdcmp', & avgflag='A', long_name='fine root to litter due to landcover change', & @@ -1852,49 +1843,6 @@ subroutine Summary_nitrogenflux(this, bounds, num_soilc, filter_soilc, num_soilp this%m_deadcrootn_xfer_to_fire_patch(p) + & this%m_retransn_to_fire_patch(p) - ! total N fluxes from veg to litter - this%litfall_n_patch(p) = & - this%m_leafn_to_litter_patch(p) + & - this%m_frootn_to_litter_patch(p) + & - this%m_leafn_storage_to_litter_patch(p) + & - this%m_frootn_storage_to_litter_patch(p) + & - this%m_livestemn_storage_to_litter_patch(p) + & - this%m_deadstemn_storage_to_litter_patch(p) + & - this%m_livecrootn_storage_to_litter_patch(p) + & - this%m_deadcrootn_storage_to_litter_patch(p) + & - this%m_leafn_xfer_to_litter_patch(p) + & - this%m_frootn_xfer_to_litter_patch(p) + & - this%m_livestemn_xfer_to_litter_patch(p) + & - this%m_deadstemn_xfer_to_litter_patch(p) + & - this%m_livecrootn_xfer_to_litter_patch(p) + & - this%m_deadcrootn_xfer_to_litter_patch(p) + & - this%m_livestemn_to_litter_patch(p) + & - this%m_deadstemn_to_litter_patch(p) + & - this%m_livecrootn_to_litter_patch(p) + & - this%m_deadcrootn_to_litter_patch(p) + & - this%m_retransn_to_litter_patch(p) + & - this%hrv_leafn_to_litter_patch(p) + & - this%hrv_frootn_to_litter_patch(p) + & - this%hrv_leafn_storage_to_litter_patch(p) + & - this%hrv_frootn_storage_to_litter_patch(p) + & - this%hrv_livestemn_storage_to_litter_patch(p) + & - this%hrv_deadstemn_storage_to_litter_patch(p) + & - this%hrv_livecrootn_storage_to_litter_patch(p) + & - this%hrv_deadcrootn_storage_to_litter_patch(p) + & - this%hrv_leafn_xfer_to_litter_patch(p) + & - this%hrv_frootn_xfer_to_litter_patch(p) + & - this%hrv_livestemn_xfer_to_litter_patch(p) + & - this%hrv_deadstemn_xfer_to_litter_patch(p) + & - this%hrv_livecrootn_xfer_to_litter_patch(p) + & - this%hrv_deadcrootn_xfer_to_litter_patch(p) + & - this%hrv_livestemn_to_litter_patch(p) + & - this%hrv_livecrootn_to_litter_patch(p) + & - this%hrv_deadcrootn_to_litter_patch(p) + & - this%hrv_retransn_to_litter_patch(p) + & - this%livestemn_to_litter_patch(p) + & - this%leafn_to_litter_patch(p) + & - this%frootn_to_litter_patch(p) - end do call p2c(bounds, num_soilc, filter_soilc, & From 8e96f42e73817d0adf8276f3f565e77023abf21d Mon Sep 17 00:00:00 2001 From: Peter Lawrence Date: Tue, 27 Mar 2018 14:12:18 -0600 Subject: [PATCH 086/144] Added code to put the PCT_NAT_PFT_MAX and PCT_CFT_MAX on the landuse.timeseries file to register the maximum values for PCT_NAT_PFT and PCT_CFT through the time series. This is used to determine how many PFTs and CFTs are instantiated at run time in CLM5 --- tools/mksurfdata_map/src/mkpctPftTypeMod.F90 | 46 +++++++++++++++++++- tools/mksurfdata_map/src/mkpftMod.F90 | 6 +++ tools/mksurfdata_map/src/mksurfdat.F90 | 24 ++++++++-- 3 files changed, 70 insertions(+), 6 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 index a47d67dd2a..67c839eea8 100644 --- a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 +++ b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 @@ -46,6 +46,7 @@ module mkpctPftTypeMod end type pct_pft_type ! !PUBLIC MEMBER FUNCTIONS + public :: set_max_p2l_array ! given an array of pct_pft_type variables update the max_p2l values from pct_p2l public :: get_pct_p2l_array ! given an array of pct_pft_type variables, return a 2-d array of pct_p2l public :: get_pct_l2g_array ! given an array of pct_pft_type variables, return an array of pct_l2g @@ -409,8 +410,6 @@ subroutine remove_small_cover(this, too_small, nsmall) deallocate(pct_p2g, is_small, is_zero) end subroutine remove_small_cover - - ! ======================================================================== ! Private member functions ! ======================================================================== @@ -511,6 +510,49 @@ end subroutine check_vals ! Module-level routines (not member functions) ! ======================================================================== + !----------------------------------------------------------------------- + subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) + ! + ! !DESCRIPTION: + ! Given an array of pct_pft_type variables, set all max_p2l. + ! + ! Assumes that all elements of pct_pft_arr have the same size and lower bound for + ! their pct_p2l array. + ! + ! !ARGUMENTS: + ! workaround for gfortran bug (58043): declare this 'type' rather than 'class': + type(pct_pft_type), intent(inout) :: pct_pft_max_arr(:) + type(pct_pft_type), intent(in) :: pct_pft_arr(:) + ! + ! !LOCAL VARIABLES: + integer :: pft_lbound + integer :: pft_ubound + integer :: arr_index + integer :: pft_index + + character(len=*), parameter :: subname = 'get_pct_p2l_array' + !----------------------------------------------------------------------- + + pft_lbound = lbound(pct_pft_arr(1)%pct_p2l, 1) + pft_ubound = ubound(pct_pft_arr(1)%pct_p2l, 1) + + do arr_index = 1, size(pct_pft_arr) + if (lbound(pct_pft_arr(arr_index)%pct_p2l, 1) /= pft_lbound .or. & + ubound(pct_pft_arr(arr_index)%pct_p2l, 1) /= pft_ubound) then + write(6,*) subname//' ERROR: all elements of pct_pft_arr must have' + write(6,*) 'the same size and lower bound for their pct_p2l array' + call abort() + end if + + do pft_index = pft_lbound, pft_ubound + if (pct_pft_arr(arr_index)%pct_p2l(pft_index) > pct_pft_max_arr(arr_index)%pct_p2l(pft_index)) then + pct_pft_max_arr(arr_index)%pct_p2l(pft_index) = pct_pft_arr(arr_index)%pct_p2l(pft_index) + end if + end do + end do + + end subroutine set_max_p2l_array + !----------------------------------------------------------------------- function get_pct_p2l_array(pct_pft_arr) result(pct_p2l) ! diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 5a3686a0ae..4f1067c427 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -1019,6 +1019,9 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) call ncd_def_spatial_var(ncid=ncid, varname='PCT_NAT_PFT', xtype=xtype, & lev1name='natpft', lev2name='time', & long_name='percent plant functional type on the natural veg landunit (% of landunit)', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='PCT_NAT_PFT_MAX', xtype=xtype, & + lev1name='natpft', & + long_name='maximum percent plant functional type during time period (% of landunit)', units='unitless') end if ! PCT_CFT @@ -1031,6 +1034,9 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) call ncd_def_spatial_var(ncid=ncid, varname='PCT_CFT', xtype=xtype, & lev1name='cft', lev2name='time', & long_name='percent crop functional type on the crop landunit (% of landunit)', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='PCT_CFT_MAX', xtype=xtype, & + lev1name='cft', & + long_name='maximum percent crop functional type during time period (% of landunit)', units='unitless') end if end if diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 28a46165f9..01925a0d74 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -15,7 +15,7 @@ program mksurfdat use shr_kind_mod , only : r8 => shr_kind_r8, r4 => shr_kind_r4 use fileutils , only : opnfil, getavu use mklaiMod , only : mklai - use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array + use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array, set_max_p2l_array use mkpftConstantsMod , only : natpft_lb, natpft_ub, cft_lb, cft_ub, num_cft use mkpftMod , only : pft_idx, pft_frc, mkpft, mkpftInit, mkpft_parse_oride use mksoilMod , only : soil_sand, soil_clay, mksoiltex, mksoilInit, & @@ -90,9 +90,11 @@ program mksurfdat real(r8), allocatable :: pctlnd_pft(:) ! PFT data: % of gridcell for PFTs real(r8), allocatable :: pctlnd_pft_dyn(:) ! PFT data: % of gridcell for dyn landuse PFTs integer , allocatable :: pftdata_mask(:) ! mask indicating real or fake land type - type(pct_pft_type), allocatable :: pctnatpft(:) ! % of grid cell that is nat veg, and breakdown into PFTs - type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs - type(pct_pft_type), allocatable :: pctcft_saved(:) ! version of pctcft saved from the initial call to mkpft + type(pct_pft_type), allocatable :: pctnatpft(:) ! % of grid cell that is nat veg, and breakdown into PFTs + type(pct_pft_type), allocatable :: pctnatpft_max(:) ! % of grid cell maximum PFTs of the time series + type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs + type(pct_pft_type), allocatable :: pctcft_max(:) ! % of grid cell maximum CFTs of the time series + type(pct_pft_type), allocatable :: pctcft_saved(:) ! version of pctcft saved from the initial call to mkpft real(r8), pointer :: harvest1D(:) ! harvest 1D data: normalized harvesting real(r8), pointer :: harvest2D(:,:) ! harvest 1D data: normalized harvesting real(r8), allocatable :: pctgla(:) ! percent of grid cell that is glacier @@ -416,7 +418,9 @@ program mksurfdat pctlnd_pft(ns_o) , & pftdata_mask(ns_o) , & pctnatpft(ns_o) , & + pctnatpft_max(ns_o) , & pctcft(ns_o) , & + pctcft_max(ns_o) , & pctcft_saved(ns_o) , & pctgla(ns_o) , & pctlak(ns_o) , & @@ -804,6 +808,9 @@ program mksurfdat landfrac_pft(n) = pctlnd_pft(n)/100._r8 end do + pctnatpft_max = pctnatpft + pctcft_max = pctcft + ! ---------------------------------------------------------------------- ! Create surface dataset ! ---------------------------------------------------------------------- @@ -1158,6 +1165,9 @@ program mksurfdat call change_landuse(ldomain, dynpft=.true.) call normalizencheck_landuse(ldomain) + + call set_max_p2l_array(pctnatpft_max,pctnatpft) + call set_max_p2l_array(pctcft_max,pctcft) ! Output time-varying data for current year @@ -1200,6 +1210,12 @@ program mksurfdat end do ! end of read loop + call check_ret(nf_inq_varid(ncid, 'PCT_NAT_PFT_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctnatpft_max)), subname) + + call check_ret(nf_inq_varid(ncid, 'PCT_CFT_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctcft_max)), subname) + call check_ret(nf_close(ncid), subname) end if ! end of if-create dynamic landust dataset From 668370a5b5dfc5774d16fe71522194a9f840d93c Mon Sep 17 00:00:00 2001 From: Peter Lawrence Date: Mon, 2 Apr 2018 11:38:28 -0600 Subject: [PATCH 087/144] Following suggestions by Bill Sacks the code has been updated to output PCT_CROP_MAX in addition to PCT_NAT_PFT_MAX and PCT_CFT_MAX. This involved modifying the new subroutine to update both p2l and l2g and renaming it update_max_array. Additional changes were made to match Bill's suggestions of the sub_routine subname parameter and moving the initial assignment of the max array within the if (mksrf_fdynuse /= ' ') then code The code has been tested and produces the maximum PCT_CROP_MAX variable as expected. PJL --- tools/mksurfdata_map/src/mkpctPftTypeMod.F90 | 21 ++++++++++++-------- tools/mksurfdata_map/src/mkpftMod.F90 | 2 ++ tools/mksurfdata_map/src/mksurfdat.F90 | 21 ++++++++++++-------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 index 67c839eea8..8c2c9b7c53 100644 --- a/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 +++ b/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 @@ -46,7 +46,7 @@ module mkpctPftTypeMod end type pct_pft_type ! !PUBLIC MEMBER FUNCTIONS - public :: set_max_p2l_array ! given an array of pct_pft_type variables update the max_p2l values from pct_p2l + public :: update_max_array ! given an array of pct_pft_type variables update the max_p2l values from pct_p2l public :: get_pct_p2l_array ! given an array of pct_pft_type variables, return a 2-d array of pct_p2l public :: get_pct_l2g_array ! given an array of pct_pft_type variables, return an array of pct_l2g @@ -511,13 +511,13 @@ end subroutine check_vals ! ======================================================================== !----------------------------------------------------------------------- - subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) + subroutine update_max_array(pct_pft_max_arr,pct_pft_arr) ! ! !DESCRIPTION: - ! Given an array of pct_pft_type variables, set all max_p2l. + ! Given an array of pct_pft_type variables, update all the max_p2l variables. ! - ! Assumes that all elements of pct_pft_arr have the same size and lower bound for - ! their pct_p2l array. + ! Assumes that all elements of pct_pft_max_arr and pct_pft_arr have the same + ! size and lower bound for their pct_p2l array. ! ! !ARGUMENTS: ! workaround for gfortran bug (58043): declare this 'type' rather than 'class': @@ -530,9 +530,10 @@ subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) integer :: arr_index integer :: pft_index - character(len=*), parameter :: subname = 'get_pct_p2l_array' + character(len=*), parameter :: subname = 'update_max_array' !----------------------------------------------------------------------- - + + pft_lbound = lbound(pct_pft_arr(1)%pct_p2l, 1) pft_ubound = ubound(pct_pft_arr(1)%pct_p2l, 1) @@ -544,6 +545,10 @@ subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) call abort() end if + if (pct_pft_arr(arr_index)%pct_l2g > pct_pft_max_arr(arr_index)%pct_l2g) then + pct_pft_max_arr(arr_index)%pct_l2g = pct_pft_arr(arr_index)%pct_l2g + end if + do pft_index = pft_lbound, pft_ubound if (pct_pft_arr(arr_index)%pct_p2l(pft_index) > pct_pft_max_arr(arr_index)%pct_p2l(pft_index)) then pct_pft_max_arr(arr_index)%pct_p2l(pft_index) = pct_pft_arr(arr_index)%pct_p2l(pft_index) @@ -551,7 +556,7 @@ subroutine set_max_p2l_array(pct_pft_max_arr,pct_pft_arr) end do end do - end subroutine set_max_p2l_array + end subroutine update_max_array !----------------------------------------------------------------------- function get_pct_p2l_array(pct_pft_arr) result(pct_p2l) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 4f1067c427..c99d66c9ac 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -1008,6 +1008,8 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) call ncd_def_spatial_var(ncid=ncid, varname='PCT_CROP', xtype=xtype, & lev1name='time', & long_name='total percent crop landunit', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='PCT_CROP_MAX', xtype=xtype, & + long_name='maximum total percent crop landunit during time period', units='unitless') end if ! PCT_NAT_PFT diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 01925a0d74..fbbf57171a 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -15,7 +15,7 @@ program mksurfdat use shr_kind_mod , only : r8 => shr_kind_r8, r4 => shr_kind_r4 use fileutils , only : opnfil, getavu use mklaiMod , only : mklai - use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array, set_max_p2l_array + use mkpctPftTypeMod , only : pct_pft_type, get_pct_p2l_array, get_pct_l2g_array, update_max_array use mkpftConstantsMod , only : natpft_lb, natpft_ub, cft_lb, cft_ub, num_cft use mkpftMod , only : pft_idx, pft_frc, mkpft, mkpftInit, mkpft_parse_oride use mksoilMod , only : soil_sand, soil_clay, mksoiltex, mksoilInit, & @@ -808,9 +808,6 @@ program mksurfdat landfrac_pft(n) = pctlnd_pft(n)/100._r8 end do - pctnatpft_max = pctnatpft - pctcft_max = pctcft - ! ---------------------------------------------------------------------- ! Create surface dataset ! ---------------------------------------------------------------------- @@ -1104,6 +1101,9 @@ program mksurfdat nfdyn = getavu(); call opnfil (mksrf_fdynuse, nfdyn, 'f') + pctnatpft_max = pctnatpft + pctcft_max = pctcft + ntim = 0 do ! Read input pft data @@ -1166,8 +1166,8 @@ program mksurfdat call normalizencheck_landuse(ldomain) - call set_max_p2l_array(pctnatpft_max,pctnatpft) - call set_max_p2l_array(pctcft_max,pctcft) + call update_max_array(pctnatpft_max,pctnatpft) + call update_max_array(pctcft_max,pctcft) ! Output time-varying data for current year @@ -1213,8 +1213,13 @@ program mksurfdat call check_ret(nf_inq_varid(ncid, 'PCT_NAT_PFT_MAX', varid), subname) call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctnatpft_max)), subname) - call check_ret(nf_inq_varid(ncid, 'PCT_CFT_MAX', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctcft_max)), subname) + call check_ret(nf_inq_varid(ncid, 'PCT_CROP_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_l2g_array(pctcft_max)), subname) + + if (num_cft > 0) then + call check_ret(nf_inq_varid(ncid, 'PCT_CFT_MAX', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, get_pct_p2l_array(pctcft_max)), subname) + end if call check_ret(nf_close(ncid), subname) From d0b83b8d6cfbb065b44dc2ae101fde53328ec64a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Jul 2018 15:05:26 -0600 Subject: [PATCH 088/144] Better way to handle gen_domain directory, if fail on set of cfgdir, use a directory based on CIME_ROOT, this is more reliable --- test/tools/TCBCFGtools.sh | 6 +++++- test/tools/input_tests_master | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/tools/TCBCFGtools.sh b/test/tools/TCBCFGtools.sh index 3b7e6fc9d3..5c0b015123 100755 --- a/test/tools/TCBCFGtools.sh +++ b/test/tools/TCBCFGtools.sh @@ -32,7 +32,11 @@ if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then fi fi -cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}*` +cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}` +if [ $? -ne 0 ];then + cfgdir=`ls -1d ${CIME_ROOT}/tools/mapping/${1}*` + echo "use: $cfgdir" +fi blddir=${CLM_TESTDIR}/${test_name}/src if [ -d ${blddir} ]; then rm -r ${blddir} diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master index c45bc2c2db..84b98883eb 100644 --- a/test/tools/input_tests_master +++ b/test/tools/input_tests_master @@ -3,10 +3,10 @@ smc#4 TSMscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds blc#4 TBLscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds -sme14 TSMCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds T31.runoptions -ble14 TBLCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds T31.runoptions -sme@4 TSMCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds ne30.runoptions -ble@4 TBLCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds ne30.runoptions +sme14 TSMCFGtools.sh gen_domain CFGtools__ds T31.runoptions +ble14 TBLCFGtools.sh gen_domain CFGtools__ds T31.runoptions +sme@4 TSMCFGtools.sh gen_domain CFGtools__ds ne30.runoptions +ble@4 TBLCFGtools.sh gen_domain CFGtools__ds ne30.runoptions smg54 TSMtools.sh mksurfdata_map tools__s namelist blg54 TBLtools.sh mksurfdata_map tools__s namelist From e6fa0bb427865cd4bf617807ffea3b7d024e51a4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 5 Jul 2018 12:29:22 -0600 Subject: [PATCH 089/144] Add note about setting wallclock time when running test_driver.sh --- test/tools/README | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/tools/README b/test/tools/README index 43a5f42a20..4929144b20 100644 --- a/test/tools/README +++ b/test/tools/README @@ -13,9 +13,7 @@ To use... on cheyenne -qcmd -- ./test_driver.sh -i >& run.out & -execgy -./test_driver.sh -i >& run.out & +qcmd -l walltime=06:00:00 -- ./test_driver.sh -i >& run.out & Intended for use on NCAR machines cheyenne, geyser (DAV) and hobart. From 919dd7abe66e244aaa087856635e2b4a6534da82 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 5 Jul 2018 12:32:49 -0600 Subject: [PATCH 090/144] Change openmp option for intel to qopenmp, required in intel version 18 --- tools/mkprocdata_map/src/Makefile.common | 12 ++++++------ tools/mksurfdata_map/src/Makefile.common | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/mkprocdata_map/src/Makefile.common b/tools/mkprocdata_map/src/Makefile.common index bf8c80eed6..ab79f94144 100644 --- a/tools/mkprocdata_map/src/Makefile.common +++ b/tools/mkprocdata_map/src/Makefile.common @@ -190,8 +190,8 @@ ifeq ($(FC),ifort) FFLAGS += -O2 endif ifeq ($(SMP),TRUE) - FFLAGS += -openmp - LDFLAGS += -openmp + FFLAGS += -qopenmp + LDFLAGS += -qopenmp endif endif @@ -215,7 +215,7 @@ endif ifeq ($(CC),icc) CFLAGS += -m64 -g ifeq ($(SMP),TRUE) - CFLAGS += -openmp + CFLAGS += -qopenmp endif endif ifeq ($(CC),pgcc) @@ -307,9 +307,9 @@ ifeq ($(UNAMES),Linux) FFLAGS += -O2 endif ifeq ($(SMP),TRUE) - FFLAGS += -openmp - CFLAGS += -openmp - LDFLAGS += -openmp + FFLAGS += -qopenmp + CFLAGS += -qopenmp + LDFLAGS += -qopenmp endif endif FFLAGS += -c -I$(INC_NETCDF) $(CPPDEF) $(cpp_path) diff --git a/tools/mksurfdata_map/src/Makefile.common b/tools/mksurfdata_map/src/Makefile.common index bf8c80eed6..ab79f94144 100644 --- a/tools/mksurfdata_map/src/Makefile.common +++ b/tools/mksurfdata_map/src/Makefile.common @@ -190,8 +190,8 @@ ifeq ($(FC),ifort) FFLAGS += -O2 endif ifeq ($(SMP),TRUE) - FFLAGS += -openmp - LDFLAGS += -openmp + FFLAGS += -qopenmp + LDFLAGS += -qopenmp endif endif @@ -215,7 +215,7 @@ endif ifeq ($(CC),icc) CFLAGS += -m64 -g ifeq ($(SMP),TRUE) - CFLAGS += -openmp + CFLAGS += -qopenmp endif endif ifeq ($(CC),pgcc) @@ -307,9 +307,9 @@ ifeq ($(UNAMES),Linux) FFLAGS += -O2 endif ifeq ($(SMP),TRUE) - FFLAGS += -openmp - CFLAGS += -openmp - LDFLAGS += -openmp + FFLAGS += -qopenmp + CFLAGS += -qopenmp + LDFLAGS += -qopenmp endif endif FFLAGS += -c -I$(INC_NETCDF) $(CPPDEF) $(cpp_path) From c6047a9a0693dfd9ea996f2242c8c9b392e17569 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 5 Jul 2018 12:36:12 -0600 Subject: [PATCH 091/144] Update intel compiler for hobart --- test/tools/test_driver.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index 8faace3e89..2e5a316a03 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -210,7 +210,8 @@ export INITMODULES="/usr/share/Modules/init/sh" . \$INITMODULES module purge -module load compiler/intel/15.0.2.164 +module load compiler/intel/18.0.3 +module load tool/nco export NETCDF_DIR=\$NETCDF_PATH export INC_NETCDF=\${NETCDF_PATH}/include From ac358a788f43f12004d4c0b5be5137ee4b09cb4a Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 6 Jul 2018 11:18:02 -0600 Subject: [PATCH 092/144] ChangeLog: ask about significant changes to various configurations It no longer will work to denote these changes via a tag numbering convention, so Dave, Erik and I decided that we should call this out in the ChangeLog. --- doc/.ChangeLog_template | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 3a47980dfa..080f8a16a5 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -21,6 +21,15 @@ Known bugs introduced in this tag (include github issue ID): [If none, remove th Known bugs found since the previous tag (include github issue ID): [If none, remove this line] +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following configurations? + +- CLM5.0: [Y/N] + +- CLM4.5: [Y/N] + Notes of particular relevance for users --------------------------------------- From 7d6497f2f548c54450bd0a93e90c9d8866120a8e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Jul 2018 12:08:34 -0600 Subject: [PATCH 093/144] Update .ChangeLog_template A little bit of editing to the physics configuration section. Use the same name used for CLM_CONFIG_OPTS, and also point to the details in the "Answer changes" section. Add clm4_0 for now. --- doc/.ChangeLog_template | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 080f8a16a5..0eca0578d0 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -24,11 +24,14 @@ Known bugs found since the previous tag (include github issue ID): [If none, rem Significant changes to scientifically-supported configurations -------------------------------------------------------------- -Does this tag change answers significantly for any of the following configurations? +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below) -- CLM5.0: [Y/N] +- clm5_0: [Y/N] -- CLM4.5: [Y/N] +- clm4_5: [Y/N] + +- clm4_0: [Y/N] Notes of particular relevance for users --------------------------------------- From 9d327393a3dbd196f6289710fd32b7396d5013c1 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 6 Jul 2018 12:28:12 -0600 Subject: [PATCH 094/144] Change format for denoting answer changes I think this will make it easier for readers to see which configurations are changed if they are just quickly skimming through the ChangeLog. --- doc/.ChangeLog_template | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 0eca0578d0..97cca3994f 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -25,13 +25,15 @@ Significant changes to scientifically-supported configurations -------------------------------------------------------------- Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below) +(Details of any changes will be given in the "Answer changes" section below.) -- clm5_0: [Y/N] + [Put an [X] in the box for any configuration with significant answer changes.] -- clm4_5: [Y/N] +[ ] clm5_0 -- clm4_0: [Y/N] +[ ] clm4_5 + +[ ] clm4_0 Notes of particular relevance for users --------------------------------------- From 2c0235264e416fc1cc48062251deba71610d6870 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Jul 2018 14:32:17 -0600 Subject: [PATCH 095/144] Explicitly list the nco version to use, change use of cshell limit function to bourne shell ulimit function on hobart. --- test/tools/test_driver.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index 2e5a316a03..2ef95670ea 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -199,8 +199,8 @@ export P4_GLOBMEMSIZE=500000000 export CESM_MACH="hobart" -limit stacksize unlimited -limit coredumpsize unlimited +ulimit -s unlimited +ulimit -c unlimited export CESM_COMP="intel" export TOOLS_MAKE_STRING="USER_FC=ifort USER_CC=icc " @@ -211,7 +211,8 @@ export INITMODULES="/usr/share/Modules/init/sh" . \$INITMODULES module purge module load compiler/intel/18.0.3 -module load tool/nco +module load tool/nco/4.7.5 +tool/netcdf/4.6.1/intel export NETCDF_DIR=\$NETCDF_PATH export INC_NETCDF=\${NETCDF_PATH}/include From a268a8296f6f01b29cb1a5585896efe03ff55e04 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Jul 2018 14:40:04 -0600 Subject: [PATCH 096/144] Add a bunch of the output from mksurfdata_map and mkmapdata to the git ignore file --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 77da6f1745..abebdd6657 100644 --- a/.gitignore +++ b/.gitignore @@ -58,18 +58,27 @@ test_driver_*.sh # mksurfdata output surfdata_*.log surfdata_*.namelist +landuse.timeseries_*.namelist +landuse.timeseries_*.log +landuse_timeseries_*.txt clm.input_data_list clm.input_data_list.previous +*.stdout.txt.o* # Tools executables tools/mksurfdata_map/mksurfdata_map tools/mkprocdata_map/mkprocdata_map +# mksurfdata output files +tools/mksurfdata_map/surfdata_*.nc +tools/mksurfdata_map/landuse.timeseries_*.nc + # mkmapdata output files tools/mkmapdata/PET*.RegridWeightGen.Log tools/mkmapdata/regrid.*.out tools/mkmapdata/regrid.*.err tools/mkmapdata/regrid.o* +tools/mkmapdata/map*.nc # build output *.o From dffe5726744dc37cc229d74368161aa5d171c137 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Jul 2018 14:42:48 -0600 Subject: [PATCH 097/144] Switch fv-4x5 for f05 which is needed for coupled simulations with full chemistry models, add f4x5 to the standard list. Add some documentation about why some of the resolutions are needed, note that f05 is now a standard resolution we need to do out of the box --- tools/mksurfdata_map/Makefile.data | 38 +++++++++++++++++------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tools/mksurfdata_map/Makefile.data b/tools/mksurfdata_map/Makefile.data index 74636175eb..abac6af279 100644 --- a/tools/mksurfdata_map/Makefile.data +++ b/tools/mksurfdata_map/Makefile.data @@ -54,17 +54,22 @@ endif MKSURFDATA = $(BATCHJOBS) $(PWD)/mksurfdata.pl -STANDARD_RES = 360x720cru,48x96,0.9x1.25,1.9x2.5,10x15,ne30np4 +# f19 and f09 are standard resolutions, f10 is used for testing, f45 is used for FATES +# ne30np4 is standard resolution for SE dycore in CAM, T31 is for paleo, 360x720cru is for same resolution as forcing data +STANDARD_RES = 360x720cru,48x96,0.9x1.25,1.9x2.5,10x15,4x5,ne30np4 +# ne120np4 is for high resolution SE dycore, ne16 is for testing SE dycore +# T42 is for SCAM +# f05 is needed for running full chemistry model STANDARD = \ global-present \ - global-present-f45 \ + global-present-f05 \ global-present-ne16np4 \ global-present-ne120np4 \ global-present-T42 \ global-historical \ global-historical-ne120np4 \ - global-transient-f45 \ + global-transient-f05 \ global-transient \ global-transient-ne120np4 @@ -78,7 +83,7 @@ TROPICS = \ CROP = \ crop-global-present \ - crop-global-present-f45 \ + crop-global-present-f05 \ crop-global-present-ne16np4 \ crop-global-present-ne120np4 \ crop-numa-present \ @@ -86,9 +91,9 @@ CROP = \ crop-smallville \ crop-smallville-historical \ crop-global-historical \ - crop-global-historical-f45 \ + crop-global-historical-f05 \ crop-global-historical-ne120np4 \ - crop-global-transient-f45 \ + crop-global-transient-f05 \ crop-global-transient \ crop-global-transient-ne120np4 @@ -107,9 +112,10 @@ standard : $(STANDARD) global-present : FORCE $(MKSURFDATA) -no-crop -glc_nec 10 -y 2000 -res $(STANDARD_RES) $(BACKGROUND) -global-present-f45 : FORCE - $(MKSURFDATA) -no-crop -glc_nec 10 -y 1850,2000 -res 4x5 $(BACKGROUND) +global-present-f05 : FORCE + $(MKSURFDATA) -no-crop -glc_nec 10 -y 1850,2000 -res 0.47x0.63 $(BACKGROUND) +# T42 is needed for SCAM global-present-T42 : FORCE $(MKSURFDATA) -no-crop -glc_nec 10 -y 2000 -res 64x128 $(BACKGROUND) @@ -134,8 +140,8 @@ global-transient : FORCE global-transient-ne120np4 : FORCE $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2000 -res ne120np4 $(BACKGROUND) -global-transient-f45 : FORCE - $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2000 -res 4x5 $(BACKGROUND) +global-transient-f05 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2000 -res 0.47x0.63 $(BACKGROUND) # # tropics @@ -171,8 +177,8 @@ crop-global-present : FORCE crop-global-present-0.125 : FORCE $(MKSURFDATA) -hirespft -glc_nec 10 -y 2000 -r 0.125x0.125 $(BACKGROUND) -crop-global-present-f45 : FORCE - $(MKSURFDATA) -glc_nec 10 -y 1850,2000 -res 4x5 $(BACKGROUND) +crop-global-present-f05 : FORCE + $(MKSURFDATA) -glc_nec 10 -y 1850,2000 -res 0.47x0.63 $(BACKGROUND) crop-numa-present : FORCE $(MKSURFDATA) -glc_nec 10 -y 2000 -r 1x1_numaIA $(BACKGROUND) @@ -202,8 +208,8 @@ crop-smallville-historical : FORCE crop-global-historical : FORCE $(MKSURFDATA) -glc_nec 10 -y 1850 -res $(STANDARD_RES) $(BACKGROUND) -crop-global-historical-f45 : FORCE - $(MKSURFDATA) -glc_nec 10 -y 1850 -r 4x5 $(BACKGROUND) +crop-global-historical-f05 : FORCE + $(MKSURFDATA) -glc_nec 10 -y 1850 -r 0.47x0.63 $(BACKGROUND) crop-global-historical-ne120np4 : FORCE $(MKSURFDATA) -glc_nec 10 -y 1850 -res ne120np4 $(BACKGROUND) @@ -214,8 +220,8 @@ crop-global-transient: FORCE crop-global-transient-ne120np4 : FORCE $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2000 -res ne120np4 $(BACKGROUND) -crop-global-transient-f45 : FORCE - $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2000 -res 4x5 $(BACKGROUND) +crop-global-transient-f05 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2000 -res 0.47x0.63 $(BACKGROUND) # # urban # From 8308488d4b1faf4f2ef916fb61caa896f624b99b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Jul 2018 16:00:48 -0600 Subject: [PATCH 098/144] Add needed "module load" to netcdf package that was accidentally missing. --- test/tools/test_driver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index 2ef95670ea..935b7d2dd2 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -212,7 +212,7 @@ export INITMODULES="/usr/share/Modules/init/sh" module purge module load compiler/intel/18.0.3 module load tool/nco/4.7.5 -tool/netcdf/4.6.1/intel +module load tool/netcdf/4.6.1/intel export NETCDF_DIR=\$NETCDF_PATH export INC_NETCDF=\${NETCDF_PATH}/include From 07b4e5910480a555b7b5d0160f2e9cca7d3c1aac Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Jul 2018 16:33:31 -0600 Subject: [PATCH 099/144] Update changelog --- doc/ChangeLog | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 120 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0cbc486a62..3ee6b69a9b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,123 @@ =============================================================== +Tag name: ctsm1.0.dev002 +Originator(s): erik (Erik Kluzek) +Date: Fri Jul 6 16:33:03 MDT 2018 +One-line Summary: Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases + +Purpose of changes +------------------ + +Nitrogen Fixation flux arrays were being set to missing value over non-vegetated landunits. This sets them to zero everywhere +and averages in the zero's at the gridcell level for history output. It also reads in restarts with missing values and converts +them to zero's. + +There are also some tools updates, getting the tools working on the new upgraded hobart.cgd.ucar.edu. + +And mksurfdata_map is updated to add some *_MAX files on the landuse.timeseries files that will allow us to conserve memory +for transient cases. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #435, #436, #433 (for tools) + #435 -- intel build for tools + #426 -- Nitrogen Fixation flux variables + #433 -- hobart broken, got it working for tools + +Known bugs found since the previous tag (include github issue ID): #433, #431 + + #433 -- with hobart upgrade, hobart build isn't working + #431 -- When set_* options are used to hist_addfld be careful of ordering + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[X] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): ndep file updated for clm5_0 for 1850 + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): NFIX flux variables + NFIX flux variables when read from restart have special-values (missing on non veg landunits) converted to zero's + They are now initialized to zero everywhere. + +Changes to tests or testing: None + +Code reviewed by: self, wwieder, and lawrence, sacks (mksurfdata_map code) + +CLM testing: regular (although none on hobart!) + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (5 tests differ from previous version) + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + +CLM tag used for the baseline comparisons: ctsm1.0.dev001 + + +Answer changes +-------------- + +Changes answers relative to baseline: clm5_0 BGC configurations with FUN and clm5_0 with BGC for new 1850 ndep file + + Summarize any changes to answers, i.e., + - what code configurations: All clm5_0 BGC due to NFIX fields, and clm5_0 1850 BGC due to new ndep file + - what platforms/compilers: All + - nature of change: similar climate + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #437 -- ChangeLog template + #432 -- nfix + #331 -- _MAX fields on mksurfdata_map + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev001 Originator(s): sacks (Bill Sacks) Date: Fri Jun 22 07:31:43 MDT 2018 diff --git a/doc/ChangeSum b/doc/ChangeSum index d7bf5702d8..8b7183b549 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm1.0.dev002 erik 07/06/2018 Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases ctsm1.0.dev001 sacks 06/22/2018 Begin separating SoilHydrology flux calculations clm5.0.dev013 erik 06/12/2018 cleanup and update cime and cism clm5.0.dev012 sacks 05/17/2018 Fixes for variable_year orbital mode From 12435d40f5e2349bc1543d915f0a4c4a2f0ec5b1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 7 Jul 2018 15:25:26 -0600 Subject: [PATCH 100/144] Update cime and cism --- Externals.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 454a2bc845..4fc1aa951a 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -8,7 +8,7 @@ required = True local_path = components/cism protocol = git repo_url = https://github.com/ESCOMP/cism-wrapper -tag = release-v2.1.01 +tag = cism2_1_61 externals = Externals_CISM.cfg required = True @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime_cesm2_0_rel_03 +tag = cime5.6.9 required = True [externals_description] From ff3203d0a40cf6299d3c9559c578db5cd63085eb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 9 Jul 2018 15:17:30 -0600 Subject: [PATCH 101/144] Fix for #438, Illegal argument aliasing caught by nag6.2 This is in Photosynthesis in the PHS code. I also initialize an array that wasn't being initialized to zero to zero. --- src/biogeophys/PhotosynthesisMod.F90 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 8b6e708606..6477025812 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -3578,6 +3578,8 @@ subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, bflag = .false. b0sun = -1._r8 b0sha = -1._r8 + gs0sun = 0._r8 + gs0sha = 0._r8 bsun = 1._r8 bsha = 1._r8 iter1 = 0 @@ -3769,6 +3771,8 @@ subroutine brent_PHS(xsun, x1sun, x2sun, f1sun, f2sun, xsha, x1sha, x2sha, f1sha type(temperature_type) , intent(in) :: temperature_inst !------------------------------------------------------------------------------ ! !LOCAL VARIABLES: + real(r8) :: gs0sun ! sunlit leaf stomatal conductance (umol H2O/m**2/s) + real(r8) :: gs0sha ! shaded leaf stomatal conductance (umol H2O/m**2/s) integer :: phase ! sun==1, sha==2 integer , parameter :: nphs = 2 ! number of phases for sun/shade integer , parameter :: itmax = 20 ! maximum number of iterations @@ -3860,7 +3864,9 @@ subroutine brent_PHS(xsun, x1sun, x2sun, f1sun, f2sun, xsha, x1sha, x2sha, f1sha endif enddo - call ci_func_PHS(x,b(sun), b(sha), fb(sun), fb(sha), ip, iv, ic, bsun, bsha, bflag, gb_mol, gs_mol_sun, gs_mol_sha,& + gs0sun = gs_mol_sun + gs0sha = gs_mol_sha + call ci_func_PHS(x,b(sun), b(sha), fb(sun), fb(sha), ip, iv, ic, bsun, bsha, bflag, gb_mol, gs0sun, gs0sha, & gs_mol_sun, gs_mol_sha, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & qsatl, qaf, atm2lnd_inst, photosyns_inst, canopystate_inst, waterstate_inst, soilstate_inst, & temperature_inst, waterflux_inst) From 90b4df4db6ec2c3e87cba2667683cbc03705b3ca Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 9 Jul 2018 16:19:22 -0600 Subject: [PATCH 102/144] Update cism to version with hobart upgrade in place --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 4fc1aa951a..8008d6155c 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -8,7 +8,7 @@ required = True local_path = components/cism protocol = git repo_url = https://github.com/ESCOMP/cism-wrapper -tag = cism2_1_61 +tag = release-cesm2.0.04 externals = Externals_CISM.cfg required = True From 03bcf1ebab96120019787fe7a1fc51abae017de0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 10 Jul 2018 15:45:00 -0600 Subject: [PATCH 103/144] Increase wall clock for a test thats ending early --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index f0c1586d15..f439dab29c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1023,7 +1023,7 @@ - + From f0ef3a9483c6e192979db41fa48c44d31a56acd0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 13 Jul 2018 15:03:24 -0600 Subject: [PATCH 104/144] Add some gnu tests to parallel hobart_pgi tests --- cime_config/testdefs/testlist_clm.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index f439dab29c..5adc7d615d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -497,6 +497,7 @@ + @@ -1129,6 +1130,7 @@ + @@ -1155,6 +1157,7 @@ + @@ -1163,6 +1166,7 @@ + From 1ce634a91587f82e62aeb3bca55afa78e6322e60 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 13 Jul 2018 15:07:28 -0600 Subject: [PATCH 105/144] Add new expected fails for PGI tests on hobart --- cime_config/testdefs/ExpectedTestFails.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index ab3e96aaac..e22a297ed7 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -6,6 +6,8 @@ FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN + FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN + FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL ERP_Ld9.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-FatesAllVars COMPARE_base_rest From c83544445fde4a6e4c3ef5828b1d7a2cbd106300 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 13 Jul 2018 15:14:12 -0600 Subject: [PATCH 106/144] Update cime version for update of DIN_LOC_ROOT_CLMFORC on cheyenne --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 8008d6155c..db147599f9 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.9 +tag = cime5.6.10 required = True [externals_description] From 8960cf05f6105991f42bfb6661ce5364fb28f93b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 13 Jul 2018 20:39:44 -0600 Subject: [PATCH 107/144] Add comment about initializating of gs0sun/sha --- src/biogeophys/PhotosynthesisMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 6477025812..ea55641362 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -3578,8 +3578,8 @@ subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, bflag = .false. b0sun = -1._r8 b0sha = -1._r8 - gs0sun = 0._r8 - gs0sha = 0._r8 + gs0sun = 0._r8 ! Initialize to zero as good form, not used on first itteration below because of bflag + gs0sha = 0._r8 ! Initialize to zero as good form, not used on first itteration below because of bflag bsun = 1._r8 bsha = 1._r8 iter1 = 0 From df3dfb881157cb4eb190a6310c13015f304a60ba Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 14 Jul 2018 17:00:35 -0600 Subject: [PATCH 108/144] Point to p_old location so will work in new glade environment --- .../testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 | 2 +- .../testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 index 279790a585..62299f7ee4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 +++ b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 @@ -10,4 +10,4 @@ hist_type1d_pertape = ' ',' ',' ' use_init_interp = .true. - finidat = '/glade/p/image/RDA_strawman/CESM_ensembles/CLM/CLM5BGC-Crop/ctsm_2001-01-01-00000/clm5_f09_spinup80.clm2_0001.r.2001-01-01-00000.nc' + finidat = '/glade/p_old/image/RDA_strawman/CESM_ensembles/CLM/CLM5BGC-Crop/ctsm_2001-01-01-00000/clm5_f09_spinup80.clm2_0001.r.2001-01-01-00000.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 index f22be214e0..0df6e5a2a2 100644 --- a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 +++ b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 @@ -10,4 +10,4 @@ hist_type1d_pertape = ' ',' ',' ' use_init_interp = .true. - finidat = '/glade/p/image/RDA_strawman/CESM_ensembles/CLM/CLM5BGC-Crop/ctsm_2001-01-01-00000/clm5_f09_spinup80.clm2_0002.r.2001-01-01-00000.nc' + finidat = '/glade/p_old/image/RDA_strawman/CESM_ensembles/CLM/CLM5BGC-Crop/ctsm_2001-01-01-00000/clm5_f09_spinup80.clm2_0002.r.2001-01-01-00000.nc' From 81c541ddf1df7b8973442b7375ac6cfc07605edc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Jul 2018 00:27:15 -0600 Subject: [PATCH 109/144] Update changelog --- doc/ChangeLog | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 120 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3ee6b69a9b..7afcc59d5d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,123 @@ =============================================================== +Tag name: ctsm1.0.dev003 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Sun Jul 15 00:26:46 MDT 2018 +One-line Summary: Update cime/cism to work on upgraded hobart and with glade changes on cheyenne + +Purpose of changes +------------------ + +Update cime and cism so can work on upgraded hobart. Also fix an issue that the Nag6.2 compiler found +in CTSM. Also get working with glade changes that happened on cheyenne, DIN_LOC_ROOT_CLMFORC was +changed to a new directory. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] + #441 -- Changes in glade invalidate previous softlinks and data locations + #438 -- Illegal argument aliasing caught by nag6.2 + #433 -- with hobart upgrade CTSM not working + +Known bugs introduced in this tag (include github issue ID): + #444 -- PGI fails on cheyenne and hobart + +Known bugs found since the previous tag (include github issue ID): + #443 -- Wood C:N ratios + $440 -- leafcn_max < target leafcn? + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): DIN_LOC_ROOT_CLMFORC on cheyenne + DIN_LOC_ROOT_CLMFORC was change on cheyenne + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: path for cheyenne specific test had to be changed + Add some gnu tests on hobart + Lengthen wallclock on a test + Fix path for DA test_mod + +Code reviewed by: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- FAIL + hobart_gnu -------- PASS + hobart_intel ------ PASS + +CLM tag used for the baseline comparisons: ctsm1.0.dev002 + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism + cism-wrapper to release-cesm2.0.04 + cime to cime5.6.10 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #444 -- Get working on upgraded hobart and with glade changes on cheyenne + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev002 Originator(s): erik (Erik Kluzek) Date: Fri Jul 6 16:33:03 MDT 2018 diff --git a/doc/ChangeSum b/doc/ChangeSum index 8b7183b549..4b97733664 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm1.0.dev003 erik 07/15/2018 Update cime/cism to work on upgraded hobart and with glade changes on cheyenne ctsm1.0.dev002 erik 07/06/2018 Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases ctsm1.0.dev001 sacks 06/22/2018 Begin separating SoilHydrology flux calculations clm5.0.dev013 erik 06/12/2018 cleanup and update cime and cism From 76cc1f5762459972919de2beb635c7222b69a23d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Jul 2018 18:22:25 -0600 Subject: [PATCH 110/144] Update cmip6 output according to Keith Oleson's case: clm50_cesm20R_1deg_GSWP3V1_iso_CMIP6out_hist --- .../usermods_dirs/cmip6_output/user_nl_clm | 53 +++++++++++++++---- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_clm b/cime_config/usermods_dirs/cmip6_output/user_nl_clm index bd333a213b..2cdde00a3f 100644 --- a/cime_config/usermods_dirs/cmip6_output/user_nl_clm +++ b/cime_config/usermods_dirs/cmip6_output/user_nl_clm @@ -18,26 +18,61 @@ ! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable !---------------------------------------------------------------------------------- +! h0 stream (monthly average, gridcell-level) +! Emon, Lmon, LIMon hist_fexcl1 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', -'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr' +'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', +'PCT_NAT_PFT','SMIN_NO3_vr','CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' +! h0 stream ICE variables and other variables inactive by default (monthly average, gridcell-level) +! Emon, Lmon, LIMon hist_fincl1 = 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE', 'QFLX_SUB_SNOW_ICE', 'QRUNOFF_ICE', 'QSNOFRZ_ICE', 'QSNOMELT_ICE', 'RAIN_ICE', 'SNOW_ICE', -'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE' +'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE', +'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', +'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' +! h1 stream (monthly average, finest sub-grid) +! Emon, Lmon hist_fincl2 = 'GPP', 'NPP', 'AGNPP', 'TLAI', 'TOTVEGC', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'NPP_NUPTAKE', 'GRAINC_TO_FOOD', -'Vcmx25Z', 'FSH', 'NFERTILIZATION', 'AR', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP' +'Vcmx25Z', 'FSH', 'NFERTILIZATION', 'AR', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP', +'FIRA', 'FSA', 'HR', 'GSSUNLN', 'GSSHALN', 'TSKIN' +! h2 stream (monthly average, landunit-level) +! Emon +! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level hist_fincl3 = 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', 'EFLX_LH_TOT', 'RH2M', 'TLAI', 'GPP', 'NPP', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'U10', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'GRAINC_TO_FOOD', 'SLASH_HARVESTC', 'TSOI_10CM', 'COL_FIRE_CLOSS', -'DWT_SLASH_CFLUX','TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', +'DWT_SLASH_CFLUX', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'HTOP', 'TOT_WOODPRODC:I', 'CROPPROD1C:I', 'NEE', 'TSKIN' 'FROOTC:I' +! h3 stream (yearly average, gridcell-level) +! Eyr hist_fincl4 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', -'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'FSNO_ICE', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC' +'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC' +'PCT_NAT_PFT','PCT_LANDUNIT','TOTLITC:I','TOT_WOODPRODC:I','CROPPROD1C:I','TOTSOMC:I','TOTVEGC:I','FSNO_ICE' -hist_mfilt = 1,1,1,1 -hist_dov2xy = .true.,.false.,.false.,.true. -hist_nhtfrq = 0,0,0,-8760 -hist_type1d_pertape = '','','LAND','' +! h4 stream (yearly average, landunit-level) +! Eyr landuse tiles +hist_fincl5 = 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' + +! h5 stream (daily average, gridcell-level) +! day, Eday +hist_fincl6 = 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'GPP', 'NPP', 'AR', 'HR', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'ALT', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW' + +! h6 stream (daily average, landunit-level) +! Eday +hist_fincl7 = 'TREFMXAV','TREFMNAV' + +! h7 stream (3-hourly average, gridcell-level) +! 3hr, E3hr, CF3hr +! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I) +! E3hr requires GPP, AR, HR for time mean +! CF3hr requires QFLX_SUB_SNOW for time point (I) +hist_fincl8 = 'GPP','AR','HR','TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I' + +hist_mfilt = 1,1,1,1,1,365,365,2920 +hist_dov2xy = .true.,.false.,.false.,.true.,.false.,.true.,.false.,.true. +hist_nhtfrq = 0,0,0,-8760,-8760,-24,-24,-3 +hist_type1d_pertape = ' ',' ','LAND',' ','LAND',' ','LAND',' ' From 438376924836d3abbed2a3df4a7df785f1980a6b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Jul 2018 18:27:56 -0600 Subject: [PATCH 111/144] Add check for reasonable range of CO2 10 to 15000 ppmv. Issue #427 --- src/cpl/lnd_import_export.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpl/lnd_import_export.F90 b/src/cpl/lnd_import_export.F90 index f4c5b42474..c4e0dacb9f 100644 --- a/src/cpl/lnd_import_export.F90 +++ b/src/cpl/lnd_import_export.F90 @@ -247,6 +247,9 @@ subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst) else co2_ppmv_val = co2_ppmv end if + if ( (co2_ppmv_val < 10.0_r8) .or. (co2_ppmv_val > 15000.0_r8) )then + call endrun( sub//' ERROR: CO2 is outside of an expected range' ) + end if atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv_val * 1.e-6_r8 * forc_pbot if (use_c13) then atm2lnd_inst%forc_pc13o2_grc(g) = co2_ppmv_val * c13ratio * 1.e-6_r8 * forc_pbot From 282c8161e8a58f2a1dfd4cc11137cc290aaeee8d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Jul 2018 18:29:38 -0600 Subject: [PATCH 112/144] Changes needed for additional history tapes to namelist read Fix issue #210 --- src/main/controlMod.F90 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 5e4378ae2c..ae9c2fcafe 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -23,8 +23,10 @@ module controlMod use histFileMod , only: max_tapes, max_namlen use histFileMod , only: hist_empty_htapes, hist_dov2xy, hist_avgflag_pertape, hist_type1d_pertape use histFileMod , only: hist_nhtfrq, hist_ndens, hist_mfilt, hist_fincl1, hist_fincl2, hist_fincl3 - use histFileMod , only: hist_fincl4, hist_fincl5, hist_fincl6, hist_fexcl1, hist_fexcl2, hist_fexcl3 - use histFileMod , only: hist_fexcl4, hist_fexcl5, hist_fexcl6 + use histFileMod , only: hist_fincl4, hist_fincl5, hist_fincl6, hist_fincl7, hist_fincl8 + use histFileMod , only: hist_fincl9, hist_fincl10 + use histFileMod , only: hist_fexcl1, hist_fexcl2, hist_fexcl3, hist_fexcl4, hist_fexcl5, hist_fexcl6 + use histFileMod , only: hist_fexcl7, hist_fexcl8, hist_fexcl9, hist_fexcl10 use initInterpMod , only: initInterp_readnl use LakeCon , only: deepmixing_depthcrit, deepmixing_mixfact use CanopyfluxesMod , only: perchroot, perchroot_alt @@ -158,8 +160,12 @@ subroutine control_init( ) hist_nhtfrq, hist_ndens, hist_mfilt, & hist_fincl1, hist_fincl2, hist_fincl3, & hist_fincl4, hist_fincl5, hist_fincl6, & + hist_fincl7, hist_fincl8, & + hist_fincl9, hist_fincl10, & hist_fexcl1, hist_fexcl2, hist_fexcl3, & - hist_fexcl4, hist_fexcl5, hist_fexcl6 + hist_fexcl4, hist_fexcl5, hist_fexcl6, & + hist_fexcl7, hist_fexcl8, & + hist_fexcl9, hist_fexcl10 namelist /clm_inparm/ hist_wrtch4diag ! BGC info @@ -730,12 +736,20 @@ subroutine control_spmd() call mpi_bcast (hist_fexcl4, max_namlen*size(hist_fexcl4), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fexcl5, max_namlen*size(hist_fexcl5), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fexcl6, max_namlen*size(hist_fexcl6), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fexcl7, max_namlen*size(hist_fexcl7), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fexcl8, max_namlen*size(hist_fexcl8), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fexcl9, max_namlen*size(hist_fexcl9), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fexcl10,max_namlen*size(hist_fexcl10),MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fincl1, (max_namlen+2)*size(hist_fincl1), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fincl2, (max_namlen+2)*size(hist_fincl2), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fincl3, (max_namlen+2)*size(hist_fincl3), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fincl4, (max_namlen+2)*size(hist_fincl4), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fincl5, (max_namlen+2)*size(hist_fincl5), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fincl6, (max_namlen+2)*size(hist_fincl6), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fincl7, (max_namlen+2)*size(hist_fincl7), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fincl8, (max_namlen+2)*size(hist_fincl8), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fincl9, (max_namlen+2)*size(hist_fincl9), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_fincl10,(max_namlen+2)*size(hist_fincl10),MPI_CHARACTER, 0, mpicom, ier) ! restart file variables From a62f5c603381b0129e78bc42692b484d0adbcd9f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Jul 2018 19:14:33 -0600 Subject: [PATCH 113/144] Add new interpolated initial condition file for f19 2000 Fixes issue #429 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index e4fe10aca1..222d55a93b 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -502,7 +502,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid=1.9x2.5 maxpft=79 mask=gx1v6 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 -lnd/clm2/initdata_map/clmi.IGM2000GSWP3CLM50BGCCROPIRR.2011-01-01.1.9x2.5_gx1v6_gl5_simyr2000_c170419.nc + ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." use_init_interp=".false." +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc From 8c484dfd2f01a1eef52900f0b262134f7c189d3d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Jul 2018 10:19:03 -0600 Subject: [PATCH 114/144] Remove Charlie Koven's addition of the litfall_n_patch variable as it's not working and causing failed tests. --- src/biogeochem/CNVegNitrogenFluxType.F90 | 52 ------------------------ 1 file changed, 52 deletions(-) diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index b7ede09308..6836fd74a1 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -178,8 +178,6 @@ module CNVegNitrogenFluxType real(r8), pointer :: ndeploy_patch (:) ! patch total N deployed to growth and storage (gN/m2/s) real(r8), pointer :: wood_harvestn_patch (:) ! patch total N losses to wood product pools (gN/m2/s) real(r8), pointer :: wood_harvestn_col (:) ! col total N losses to wood product pools (gN/m2/s) (p2c) - real(r8), pointer :: litfall_n_patch (:) ! total N passed from plant to litter (gN/m2/s) - ! phenology: litterfall and crop fluxes real(r8), pointer :: phenology_n_to_litr_met_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s) real(r8), pointer :: phenology_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gN/m3/s) @@ -442,8 +440,6 @@ subroutine InitAllocate(this, bounds) allocate(this%dwt_crop_productn_gain_patch (begp:endp)) ; this%dwt_crop_productn_gain_patch (:) = nan allocate(this%wood_harvestn_col (begc:endc)) ; this%wood_harvestn_col (:) = nan - allocate(this%litfall_n_patch (begp:endp)) ; this%litfall_n_patch (:) = nan - allocate(this%dwt_frootn_to_litr_met_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_met_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_cel_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_cel_n_col (:,:) = nan allocate(this%dwt_frootn_to_litr_lig_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_lig_n_col (:,:) = nan @@ -1037,11 +1033,6 @@ subroutine InitHistory(this, bounds) '(per-area-gridcell; only makes sense with dov2xy=.false.)', & ptr_patch=this%dwt_conv_nflux_patch, default='inactive') - this%litfall_n_patch(begp:endp) = spval - call hist_addfld1d (fname='LITFALL_N', units='gN/m^2/s', & - avgflag='A', long_name='N Flux from vegetation to soil', & - ptr_patch=this%litfall_n_patch) - this%dwt_frootn_to_litr_met_n_col(begc:endc,:) = spval call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_MET_N', units='gN/m^2/s', type2d='levdcmp', & avgflag='A', long_name='fine root to litter due to landcover change', & @@ -1852,49 +1843,6 @@ subroutine Summary_nitrogenflux(this, bounds, num_soilc, filter_soilc, num_soilp this%m_deadcrootn_xfer_to_fire_patch(p) + & this%m_retransn_to_fire_patch(p) - ! total N fluxes from veg to litter - this%litfall_n_patch(p) = & - this%m_leafn_to_litter_patch(p) + & - this%m_frootn_to_litter_patch(p) + & - this%m_leafn_storage_to_litter_patch(p) + & - this%m_frootn_storage_to_litter_patch(p) + & - this%m_livestemn_storage_to_litter_patch(p) + & - this%m_deadstemn_storage_to_litter_patch(p) + & - this%m_livecrootn_storage_to_litter_patch(p) + & - this%m_deadcrootn_storage_to_litter_patch(p) + & - this%m_leafn_xfer_to_litter_patch(p) + & - this%m_frootn_xfer_to_litter_patch(p) + & - this%m_livestemn_xfer_to_litter_patch(p) + & - this%m_deadstemn_xfer_to_litter_patch(p) + & - this%m_livecrootn_xfer_to_litter_patch(p) + & - this%m_deadcrootn_xfer_to_litter_patch(p) + & - this%m_livestemn_to_litter_patch(p) + & - this%m_deadstemn_to_litter_patch(p) + & - this%m_livecrootn_to_litter_patch(p) + & - this%m_deadcrootn_to_litter_patch(p) + & - this%m_retransn_to_litter_patch(p) + & - this%hrv_leafn_to_litter_patch(p) + & - this%hrv_frootn_to_litter_patch(p) + & - this%hrv_leafn_storage_to_litter_patch(p) + & - this%hrv_frootn_storage_to_litter_patch(p) + & - this%hrv_livestemn_storage_to_litter_patch(p) + & - this%hrv_deadstemn_storage_to_litter_patch(p) + & - this%hrv_livecrootn_storage_to_litter_patch(p) + & - this%hrv_deadcrootn_storage_to_litter_patch(p) + & - this%hrv_leafn_xfer_to_litter_patch(p) + & - this%hrv_frootn_xfer_to_litter_patch(p) + & - this%hrv_livestemn_xfer_to_litter_patch(p) + & - this%hrv_deadstemn_xfer_to_litter_patch(p) + & - this%hrv_livecrootn_xfer_to_litter_patch(p) + & - this%hrv_deadcrootn_xfer_to_litter_patch(p) + & - this%hrv_livestemn_to_litter_patch(p) + & - this%hrv_livecrootn_to_litter_patch(p) + & - this%hrv_deadcrootn_to_litter_patch(p) + & - this%hrv_retransn_to_litter_patch(p) + & - this%livestemn_to_litter_patch(p) + & - this%leafn_to_litter_patch(p) + & - this%frootn_to_litter_patch(p) - end do call p2c(bounds, num_soilc, filter_soilc, & From 252120da877840e760a40d12d71e612257d36f2c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Jul 2018 10:20:15 -0600 Subject: [PATCH 115/144] Correct handling of init_interp for new finidat file --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 222d55a93b..ba51cee3c9 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -579,7 +579,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc From 0874a6fe57db465571165e386ec76d25466ca0da Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 00:48:48 -0600 Subject: [PATCH 116/144] Remove 'TOT_WOODPRODC:I', 'CROPPROD1C:I', 'NEE' from landunit level output for cmip6 as they are only on the gridcell level --- cime_config/usermods_dirs/cmip6_output/user_nl_clm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_clm b/cime_config/usermods_dirs/cmip6_output/user_nl_clm index 2cdde00a3f..5c9890a64f 100644 --- a/cime_config/usermods_dirs/cmip6_output/user_nl_clm +++ b/cime_config/usermods_dirs/cmip6_output/user_nl_clm @@ -44,8 +44,7 @@ hist_fincl2 = 'GPP', 'NPP', 'AGNPP', 'TLAI', 'TOTVEGC', 'TSA','TREFMNAV','TREFMX hist_fincl3 = 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', 'EFLX_LH_TOT', 'RH2M', 'TLAI', 'GPP', 'NPP', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'U10', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'GRAINC_TO_FOOD', 'SLASH_HARVESTC', 'TSOI_10CM', 'COL_FIRE_CLOSS', -'DWT_SLASH_CFLUX', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'HTOP', 'TOT_WOODPRODC:I', 'CROPPROD1C:I', 'NEE', 'TSKIN' -'FROOTC:I' +'DWT_SLASH_CFLUX', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'HTOP', 'TSKIN', 'FROOTC:I' ! h3 stream (yearly average, gridcell-level) ! Eyr From 0bfa0f6b5508657e9c16f43a17225e0035f3dc5e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 01:40:40 -0600 Subject: [PATCH 117/144] Get rid of ABT and KO comments in the new code --- src/biogeophys/CanopyFluxesMod.F90 | 4 --- src/biogeophys/LakeFluxesMod.F90 | 4 --- src/biogeophys/PhotosynthesisMod.F90 | 48 ---------------------------- src/biogeophys/SoilFluxesMod.F90 | 4 --- 4 files changed, 60 deletions(-) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index f9a02366ee..9b662bb372 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -452,9 +452,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) t_ref2m_r => temperature_inst%t_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface air temperature (Kelvin) -!ABT t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) -!ABT frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of surface water fwet => waterstate_inst%fwet_patch , & ! Input: [real(r8) (:) ] fraction of canopy that is wet (0 to 1) @@ -1238,13 +1236,11 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb*tlbef(p)**3*(tlbef(p) + & 4._r8*dt_veg(p)) + emg(c)*(1._r8-emv(p))*sb*lw_grnd) -!ABT ! Calculate the skin temperature as a weighted sum of all the ground and vegetated fraction ! The weight is the so-called vegetation emissivity, but not that emv is actually an attentuation ! function that goes to zero as LAI (ELAI + ESAI) go to zero. t_skin_patch(p) = emv(p)*t_veg(p) + (1._r8 - emv(p))*sqrt(sqrt(lw_grnd)) -!ABT ! Derivative of soil energy flux with respect to soil temperature diff --git a/src/biogeophys/LakeFluxesMod.F90 b/src/biogeophys/LakeFluxesMod.F90 index ba31428a15..3d447ec111 100644 --- a/src/biogeophys/LakeFluxesMod.F90 +++ b/src/biogeophys/LakeFluxesMod.F90 @@ -182,9 +182,7 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) -!ABT t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) -!ABT t_lake => temperature_inst%t_lake_col , & ! Input: [real(r8) (:,:) ] lake temperature (Kelvin) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil (or snow) temperature (Kelvin) @@ -660,9 +658,7 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, t_veg(p) = forc_t(c) eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) qflx_prec_grnd(p) = forc_rain(c) + forc_snow(c) -!ABT t_skin_patch(p) = t_veg(p) -!ABT end do end associate diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 6ea68a4d44..e735d74ce0 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -107,10 +107,8 @@ module PhotosynthesisMod real(r8), pointer, private :: tpu_z_phs_patch (:,:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s) real(r8), pointer, private :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s) real(r8), pointer, private :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s) -!KO real(r8), pointer, private :: gs_mol_sun_ln_patch (:,:) ! patch sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) real(r8), pointer, private :: gs_mol_sha_ln_patch (:,:) ! patch shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) -!KO real(r8), pointer, private :: ac_patch (:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: aj_patch (:,:) ! patch RuBP-limited gross photosynthesis (umol CO2/m**2/s) real(r8), pointer, private :: ap_patch (:,:) ! patch product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) @@ -253,10 +251,8 @@ subroutine InitAllocate(this, bounds) allocate(this%kp_z_phs_patch (begp:endp,2,1:nlevcan)) ; this%kp_z_phs_patch (:,:,:) = nan allocate(this%gs_mol_sun_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_patch (:,:) = nan allocate(this%gs_mol_sha_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_patch (:,:) = nan -!KO allocate(this%gs_mol_sun_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_ln_patch (:,:) = nan allocate(this%gs_mol_sha_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_ln_patch (:,:) = nan -!KO allocate(this%ac_patch (begp:endp,1:nlevcan)) ; this%ac_patch (:,:) = nan allocate(this%aj_patch (begp:endp,1:nlevcan)) ; this%aj_patch (:,:) = nan allocate(this%ap_patch (begp:endp,1:nlevcan)) ; this%ap_patch (:,:) = nan @@ -492,7 +488,6 @@ subroutine InitHistory(this, bounds) ptr_patch=ptr_1d) endif -!KO this%gs_mol_sun_ln_patch(begp:endp,:) = spval this%gs_mol_sha_ln_patch(begp:endp,:) = spval if (nlevcan>1) then @@ -515,7 +510,6 @@ subroutine InitHistory(this, bounds) ptr_patch=ptr_1d) endif -!KO if(use_luna)then if(nlevcan>1)then call hist_addfld2d (fname='Vcmx25Z', units='umol/m2/s', type2d='nlevcan', & @@ -801,7 +795,6 @@ subroutine Restart(this, bounds, ncid, flag) long_name='shaded leaf stomatal conductance', units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_patch) -!KO call restartvar(ncid=ncid, flag=flag, varname='GSSUNLN', xtype=ncd_double, & dim1name='pft', dim2name='levcan', switchdim=.true., & long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & @@ -813,7 +806,6 @@ subroutine Restart(this, bounds, ncid, flag) long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & units='umol H20/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_ln_patch) -!KO call restartvar(ncid=ncid, flag=flag, varname='lnca', xtype=ncd_double, & dim1name='pft', long_name='leaf N concentration', units='gN leaf/m^2', & @@ -2447,12 +2439,9 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! method ! ! !USES: -!KO use clm_varcon , only : rgas, tfrz, rpi -!KO use clm_varcon , only : rgas, tfrz, rpi, spval, degpsec, isecspday use GridcellType , only : grc use clm_time_manager , only : get_curr_date, get_step_size -!KO use clm_varctl , only : cnallocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use clm_varpar , only : nlevsoi @@ -2642,16 +2631,10 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8) :: sum_nscaler real(r8) :: total_lai integer :: nptreemax -!KO integer :: local_secp1 ! seconds into current date in local time real(r8) :: dtime ! land model time step (sec) integer :: year,month,day,secs ! calendar info for current time step -!KO -!scs -!KO integer :: j ! index -!KO integer :: j,g ! index -!KO real(r8) :: rs_resis ! combined soil-root resistance [s] real(r8) :: r_soil ! root spacing [m] real(r8) :: root_biomass_density ! root biomass density [g/m3] @@ -2670,9 +2653,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & real(r8), parameter :: croot_lateral_length = 0.25_r8 ! specified lateral coarse root length [m] real(r8), parameter :: c_to_b = 2.0_r8 !(g biomass /g C) !Note that root density is for dry biomass not carbon. CLM provides root biomass as carbon. The conversion is 0.5 g C / g biomass -!KO integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon -!KO !------------------------------------------------------------------------------ @@ -2766,10 +2747,8 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & an_sha => photosyns_inst%an_sha_patch , & ! Output: [real(r8) (:,:) ] net shaded leaf photosynthesis (umol CO2/m**2/s) gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance (umol H2O/m**2/s) gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) -!KO gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) -!KO ) par_z_sun => solarabs_inst%parsun_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) @@ -2809,12 +2788,10 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 !==============================================================================! -!KO ! Determine seconds off current time step dtime = get_step_size() call get_curr_date (year, month, day, secs) -!KO ! vcmax25 parameters, from CN @@ -3252,9 +3229,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & do f = 1, fn p = filterp(f) c = patch%column(p) -!KO g = patch%gridcell(p) -!KO ! Leaf boundary layer conductance, umol/m**2/s @@ -3289,14 +3264,11 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & aj(p,sun,iv) = 0._r8 ap(p,sun,iv) = 0._r8 ag(p,sun,iv) = 0._r8 -!KO an_sun(p,iv) = ag(p,sun,iv) - bsun(p) * lmr_z_sun(p,iv) -!KO if(crop(patch%itype(p))== 0 .or. .not. modifyphoto_and_lmr_forcrop) then an_sun(p,iv) = ag(p,sun,iv) - bsun(p) * lmr_z_sun(p,iv) else an_sun(p,iv) = ag(p,sun,iv) - lmr_z_sun(p,iv) endif -!KO psn_z_sun(p,iv) = 0._r8 psn_wc_z_sun(p,iv) = 0._r8 psn_wj_z_sun(p,iv) = 0._r8 @@ -3309,14 +3281,11 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & aj(p,sha,iv) = 0._r8 ap(p,sha,iv) = 0._r8 ag(p,sha,iv) = 0._r8 -!KO an_sha(p,iv) = ag(p,sha,iv) - bsha(p) * lmr_z_sha(p,iv) -!KO if(crop(patch%itype(p))== 0 .or. .not. modifyphoto_and_lmr_forcrop) then an_sha(p,iv) = ag(p,sha,iv) - bsha(p) * lmr_z_sha(p,iv) else an_sha(p,iv) = ag(p,sha,iv) - lmr_z_sha(p,iv) endif -!KO psn_z_sha(p,iv) = 0._r8 psn_wc_z_sha(p,iv) = 0._r8 psn_wj_z_sha(p,iv) = 0._r8 @@ -3387,22 +3356,17 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & if (an_sun(p,iv) < 0._r8) gs_mol_sun(p,iv) = max( bsun(p)*gsminsun, 1._r8 ) if (an_sha(p,iv) < 0._r8) gs_mol_sha(p,iv) = max( bsha(p)*gsminsha, 1._r8 ) -!KO ! Get local noon sunlit and shaded stomatal conductance local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime local_secp1 = mod(local_secp1,isecspday) -!KO if (local_secp1 == isecspday/2) then -!KO ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then -!KO gs_mol_sun_ln(p,iv) = gs_mol_sun(p,iv) gs_mol_sha_ln(p,iv) = gs_mol_sha(p,iv) else gs_mol_sun_ln(p,iv) = spval gs_mol_sha_ln(p,iv) = spval end if -!KO ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) @@ -3522,17 +3486,11 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & psncan_wc_sun = psncan_wc_sun + psn_wc_z_sun(p,iv) * lai_z_sun(p,iv) psncan_wj_sun = psncan_wj_sun + psn_wj_z_sun(p,iv) * lai_z_sun(p,iv) psncan_wp_sun = psncan_wp_sun + psn_wp_z_sun(p,iv) * lai_z_sun(p,iv) -!KO lmrcan_sun = lmrcan_sun + lmr_z_sun(p,iv) * lai_z_sun(p,iv) -!KO -! lmrcan_sun = lmrcan_sun + lmr_z_sun(p,iv) * lai_z_sun(p,iv) * bsun(p) -!KO -!KO if(crop(patch%itype(p))== 0 .and. modifyphoto_and_lmr_forcrop) then lmrcan_sun = lmrcan_sun + lmr_z_sun(p,iv) * lai_z_sun(p,iv) * bsun(p) else lmrcan_sun = lmrcan_sun + lmr_z_sun(p,iv) * lai_z_sun(p,iv) endif -!KO gscan_sun = gscan_sun + lai_z_sun(p,iv) / (rb(p)+rs_z_sun(p,iv)) laican_sun = laican_sun + lai_z_sun(p,iv) end do @@ -3563,17 +3521,11 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & psncan_wc_sha = psncan_wc_sha + psn_wc_z_sha(p,iv) * lai_z_sha(p,iv) psncan_wj_sha = psncan_wj_sha + psn_wj_z_sha(p,iv) * lai_z_sha(p,iv) psncan_wp_sha = psncan_wp_sha + psn_wp_z_sha(p,iv) * lai_z_sha(p,iv) -!KO lmrcan_sha = lmrcan_sha + lmr_z_sha(p,iv) * lai_z_sha(p,iv) -!KO -! lmrcan_sha = lmrcan_sha + lmr_z_sha(p,iv) * lai_z_sha(p,iv) * bsha(p) -!KO -!KO if(crop(patch%itype(p))== 0 .and. modifyphoto_and_lmr_forcrop) then lmrcan_sha = lmrcan_sha + lmr_z_sha(p,iv) * lai_z_sha(p,iv) * bsha(p) else lmrcan_sha = lmrcan_sha + lmr_z_sha(p,iv) * lai_z_sha(p,iv) endif -!KO gscan_sha = gscan_sha + lai_z_sha(p,iv) / (rb(p)+rs_z_sha(p,iv)) laican_sha = laican_sha + lai_z_sha(p,iv) end do diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 index 701bb22fcd..fefb8e617f 100644 --- a/src/biogeophys/SoilFluxesMod.F90 +++ b/src/biogeophys/SoilFluxesMod.F90 @@ -102,10 +102,8 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] ground emissivity -!ABT ! emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity ! t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) -!ABT t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] soil/snow temperature before update @@ -414,7 +412,6 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & + 4._r8*emg(c)*sb*t_grnd0(c)**3*tinc(c) -!ABT ! Calculate the skin temperature as a weighted sum of all the surface contributions (surface water table, snow, etc...) ! Note: This is the bare ground calculation of skin temperature ! The Urban and Vegetation are done in other place. Urban=Later in this function Veg=CanopyFluxMod @@ -424,7 +421,6 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & ! emv(p) * frac_veg_nosno(p) * t_veg(p) ! end if if(frac_veg_nosno(p).eq.0) t_skin_patch(p) = sqrt(sqrt(lw_grnd)) -!ABT eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then From e762ba616e94e05cc1fbcdf3a709803f1cc3cb28 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 02:11:03 -0600 Subject: [PATCH 118/144] Update changelog and change some of the CTSM documentation file to use CTSM over CLM --- .CLMTrunkChecklist => .CTSMTrunkChecklist | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .CLMTrunkChecklist => .CTSMTrunkChecklist (100%) diff --git a/.CLMTrunkChecklist b/.CTSMTrunkChecklist similarity index 100% rename from .CLMTrunkChecklist rename to .CTSMTrunkChecklist From bd4ffaa2f9081f5b21f7304db4d7e728a4507eb8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 02:12:11 -0600 Subject: [PATCH 119/144] Update changelog and change some of the CTSM documentation file to use CTSM over CLM --- .CTSMTrunkChecklist | 4 +- doc/.ChangeLog_template | 10 ++-- doc/ChangeLog | 114 +++++++++++++++++++++++++++++++++++++++- doc/ChangeSum | 1 + 4 files changed, 120 insertions(+), 9 deletions(-) diff --git a/.CTSMTrunkChecklist b/.CTSMTrunkChecklist index de48172bb3..116233a969 100644 --- a/.CTSMTrunkChecklist +++ b/.CTSMTrunkChecklist @@ -1,6 +1,6 @@ -Checklist of steps to do to make a CLM Trunk Tag Mar/7th/2017 +Checklist of steps to do to make a CTSM Trunk Tag Mar/7th/2017 -CLM Code Management team. +CTSM Software Management team. See the wiki page for this on: diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 97cca3994f..b86cbbae0f 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -40,7 +40,7 @@ Notes of particular relevance for users Caveats for users (e.g., need to interpolate initial conditions): -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Changes made to namelist defaults (e.g., changed parameter values): @@ -50,7 +50,7 @@ Substantial timing or memory changes: Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide Caveats for developers (e.g., code that is duplicated that requires double maintenance): @@ -59,14 +59,14 @@ Changes to tests or testing: Code reviewed by: -CLM testing: +CTSM testing: [... Remove before making trunk_tag. Available test levels: a) regular (must be run before handing off a tag to SEs and must be run before committing a tag) b) build_namelist (if namelists and/or build_system changed)) - c) tools (only if tools are modified and no CLM source is modified) + c) tools (only if tools are modified and no CTSM source is modified) d) short (for use during development and in rare cases where only a small change with known behavior is added ... eg. a minor bug fix) e) doc (no source testing required) @@ -99,7 +99,7 @@ CLM testing: hobart_pgi -------- hobart_intel ------ -CLM tag used for the baseline comparisons: +CTSM tag used for the baseline comparisons: Answer changes diff --git a/doc/ChangeLog b/doc/ChangeLog index 7afcc59d5d..1d5384216f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,114 @@ =============================================================== +Tag name: ctsm1.0.dev004 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Jul 18 02:10:23 MDT 2018 +One-line Summary: Add some new diagnostic fields, fix a few issues, update cmip6 output + +Purpose of changes +------------------ + +Add some new diagnostic fields. Some needed for CMIP6. Update the CMIP6 user-mods output. +Fix a couple issues. Get full list of history tapes working correctly. Check for valid range +of CO2. New IC file interpolated from the previous one for f19_g17_gl4 for 2000 Clm50BgcCrop. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): $210, #427, #429 + #210 -- increase number of history tapes + $427 -- Check for zero CO2 + #429 -- New IC for present day + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): New history fields + TSKIN --- skin temperature + TSL ----- temperature of near-surface soil layer + GSSUNLN - sunlit leaf stomatal conductance at local noon + GSSHALN - shaded leaf stomatal conductance at local noon + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New finidat file f19_g17_gl4 2000 Clm50BgcCrop + New file is just interpolate from the previous file to a f19_g17_gl4 gridfor Clm50BgcCrop and 2000 simulation year + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: None + +Code reviewed by: self, oleson, abtawfik + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - OK (95 are different because of finidat file change) + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- PASS + hobart_pgi -------- FAIL + hobart_intel ------ PASS + +CTSM tag used for the baseline comparisons: ctsm1.0.dev003 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes -- only 2000 cases because of new IC + + Summarize any changes to answers, i.e., + - what code configurations: Just 2000 cases + - what platforms/compilers: All + - nature of change: same climate + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + + #338 -- Radtemp and other new diagnostic fields + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev003 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Sun Jul 15 00:26:46 MDT 2018 @@ -25,7 +135,7 @@ Known bugs introduced in this tag (include github issue ID): Known bugs found since the previous tag (include github issue ID): #443 -- Wood C:N ratios - $440 -- leafcn_max < target leafcn? + #440 -- leafcn_max < target leafcn? Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -57,7 +167,7 @@ Substantial timing or memory changes: None Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide Caveats for developers (e.g., code that is duplicated that requires double maintenance): None diff --git a/doc/ChangeSum b/doc/ChangeSum index 4b97733664..f28571cd93 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm1.0.dev004 erik 07/18/2018 Add some new diagnostic fields, fix a few issues, update cmip6 output ctsm1.0.dev003 erik 07/15/2018 Update cime/cism to work on upgraded hobart and with glade changes on cheyenne ctsm1.0.dev002 erik 07/06/2018 Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases ctsm1.0.dev001 sacks 06/22/2018 Begin separating SoilHydrology flux calculations From afa68fb0e117b6448e9703800acccd28c0b47700 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 02:31:37 -0600 Subject: [PATCH 120/144] Revert the ctsm1.0.dev001 commit, so we can put it on the release branch --- cime_config/testdefs/ExpectedTestFails.xml | 1 + cime_config/testdefs/testlist_clm.xml | 3 +- doc/ChangeLog | 1765 +++++++++++++++-- doc/ChangeSum | 1 - doc/UpdateChangelog.pl | 6 +- doc/clm5_0_ChangeLog | 1742 ---------------- src/biogeochem/CNDriverMod.F90 | 8 +- src/biogeochem/CNFireBaseMod.F90 | 6 +- src/biogeochem/CNFireLi2014Mod.F90 | 8 +- src/biogeochem/CNFireLi2016Mod.F90 | 8 +- src/biogeochem/CNFireMethodMod.F90 | 6 +- src/biogeochem/CNFireNoFireMod.F90 | 6 +- src/biogeochem/CNVegetationFacade.F90 | 8 +- src/biogeochem/ch4Mod.F90 | 2 +- src/biogeophys/BalanceCheckMod.F90 | 6 +- src/biogeophys/HydrologyDrainageMod.F90 | 6 +- src/biogeophys/HydrologyNoDrainageMod.F90 | 60 +- .../InfiltrationExcessRunoffMod.F90 | 283 --- src/biogeophys/LakeHydrologyMod.F90 | 6 +- src/biogeophys/SaturatedExcessRunoffMod.F90 | 375 ---- src/biogeophys/SnowHydrologyMod.F90 | 6 +- .../SoilHydrologyInitTimeConstMod.F90 | 2 + src/biogeophys/SoilHydrologyMod.F90 | 980 ++++----- src/biogeophys/SoilHydrologyType.F90 | 28 +- src/biogeophys/WaterfluxType.F90 | 20 +- src/cpl/lnd_import_export.F90 | 4 +- src/main/ColumnType.F90 | 5 - src/main/clm_driver.F90 | 7 +- src/main/clm_instMod.F90 | 9 +- src/main/initSubgridMod.F90 | 1 - src/main/lnd2atmMod.F90 | 5 + src/main/lnd2atmType.F90 | 2 + .../SoilBiogeochemNLeachingMod.F90 | 2 +- .../unittestFilterBuilderMod.F90 | 2 +- src/utils/CMakeLists.txt | 1 - src/utils/NumericsMod.F90 | 89 - src/utils/test/CMakeLists.txt | 1 - src/utils/test/numerics_test/CMakeLists.txt | 10 - .../test_truncate_small_values.pf | 120 -- 39 files changed, 2154 insertions(+), 3446 deletions(-) delete mode 100644 doc/clm5_0_ChangeLog delete mode 100644 src/biogeophys/InfiltrationExcessRunoffMod.F90 delete mode 100644 src/biogeophys/SaturatedExcessRunoffMod.F90 delete mode 100644 src/utils/NumericsMod.F90 delete mode 100644 src/utils/test/numerics_test/CMakeLists.txt delete mode 100644 src/utils/test/numerics_test/test_truncate_small_values.pf diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index e22a297ed7..ae07999599 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -5,6 +5,7 @@ FAIL ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN + FAIL ERS_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_gnu.clm-default COMPARE_base_rest FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 5adc7d615d..a38d7e36f7 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1541,13 +1541,12 @@ - + - diff --git a/doc/ChangeLog b/doc/ChangeLog index 1d5384216f..4a76ea33f0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -347,151 +347,1544 @@ Pull Requests that document the changes (include PR ids): =============================================================== =============================================================== -Tag name: ctsm1.0.dev001 +Tag name: clm5.0.dev013 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Jun 12 13:46:31 MDT 2018 +One-line Summary: cleanup and update cime and cism + +Purpose of changes +------------------ + +Update cime and cism to newer versions used in release. These bring in some answer +changes. The cime version updates the orbit for 2000 compsets. The cism version +changes answers for two fields with NO_EVOLVE and more fields for EVOLVE. + +Fixes an important bug needed for use with Data Assimulation. Several changes +to testing. Adding wallclock as needed, changing a few compsets so science +supported compsets are used, added tput_tolerance to some tests known to be +variable. + +Many changes to the clm tools for creating input files. Added the version by +querying "git describe" and adding it as an attribute to NetCDF files. Changes +to get tools working, and tested. Also changed so that tools can be run in either +a CTSM checkout or a CESM checkout. + +Updated README files so they are accurate. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] + #188 -- Global PTCLM tools test fails + #187 -- PTCLM tools tests fail baseline comparisons due to a seg fault + #259 -- Most README files in ctsm are incorrect + #386 -- Shorten some currently very long debug tests + #387 -- Lots of testmods still set orb_iyear and orb_iyear_align + #388 -- Add "git describe" to input files that are created + #389 -- Post data-assimilation processing broken with multi-driver + #393 -- Increase wallclock + #399 -- minor format update needed in namelist_definition_clm4_5.xml + #402 -- Some smaller tests can be slow.. + #411 -- Refactor tools aren't useful anymore + #414 -- PTCLM tests aren't working + #415 -- mkprocdata_map tests aren't working because of bad return statement in script type: bug - other + #418 -- Path needs to be updated for getco2 script type: bug - other + +Known bugs found since the previous tag (include github issue ID): #404, #413, #414 + #404 -- Carbon balance error in decStart test just after new year + #413 -- Currently can't use DAV cluster to make mapping files + #414 -- With change in repo for fates, had to enter username/password four times + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Yes + Lengthen some of the wallclock times. Remove the 1850 test-mods that just change the orbit. + Change some of the compsets tested to cover the science supported compsets. + Allow decStart test modes to ignore errors, so Crop tests can run. Remove a very long debug test. + Add a setting for tput_tolerance for some tests that are shown to have a large variability. + Add a test mod for data assimulation. Remove some of the settings from the pauseResume test + as already done, or tested seperately in the DA test. + +Code reviewed by: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + hobart --- PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + hobart --- OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev012 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! Because of changes in cism and cime + + Summarize any changes to answers: + - what code configurations: All 2000 compsets and some cases with cism + - what platforms/compilers: All + - nature of change: similar climate + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, rtm, mosart, PTCLM + + cime to cime_cesm2_0_rel_03 (changes answers for 2000 cases because of change to orbit + cism to release-v2.1.01 (changes answers for two fields for NOEVOLVE and more fields for EVOLVE) + PTCLM to PTCLM2_180611 + + rtm and mosart changed to point to cesm2_0 release versions (identical to previous version) + +Pull Requests that document the changes (include PR ids): #398, #400, #407, #408, #417, #394 +(https://github.com/ESCOMP/ctsm/pull) + + #394 -- some final cleanup + #417 -- Make PR template questions less prominent + #408 -- Documentation updates + #407 -- Initial version of templates for contributing, PR's and issues + #400 -- Update CanopyStateType.F90 priority: high type: code cleanup/docs + #398 -- Allow first history tape to have other than one time point per file priority: high type: enhance - science + +=============================================================== +=============================================================== +Tag name: clm5.0.dev012 +Originator(s): sacks (Bill Sacks) +Date: Thu May 17 14:13:34 MDT 2018 +One-line Summary: Fixes for variable_year orbital mode + +Purpose of changes +------------------ + +Fixes for correctness and exact restartability with variable_year +orbital mode: + +(1) Update max day length (max_dayl) each time step, rather than just + updating it once in initialization + +(2) Update to a cime version that has a fix for datm, which updates the + orbital parameters (used for solar zenith angle-based interpolation) + each time step, rather than just once in initialization + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #379 (Problems with Hist decStart restart tests due to variable + orbital year) +- Fixes #260 (max daylength doesn't change over time for varying orbital + parameters) + +CIME Issues fixed (include issue #): +- ESMCI/cime#2598 (datm doesn't restart properly with variable year orbit) + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: Gave extra time to some tests so they would pass + +Code reviewed by: Erik Kluzek + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, some baselines fail as expected + + Also verified that this test (reported in #379) now passes: + ERS_D_P36x1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart + + Also verified that the ctsm code changes alone (without the cime + update) have the expected behavior in terms of baseline + passes/fails: + + FAIL SMS_D_Ld10.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE + Enters the second year + PASS SMS_D_Ld1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE + Stays in first year + PASS SMS_Lm1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-ciso_bombspike1963 BASELINE + Stays in first year + +CLM tag used for the baseline comparisons: clm5.0.dev011 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: multi-year runs with HIST compsets + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but expected to be larger than roundoff/same climate + + Bit-for-bit for runs with fixed orbital parameters (non-HIST + compsets) and for HIST runs that do not span multiple years. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: adds one commit that fixes ESMCI/cime#2598 + +Pull Requests that document the changes (include PR ids): +- #385 (Update max day length (max_dayl) each time step) + +=============================================================== +=============================================================== +Tag name: clm5.0.dev011 +Originator(s): erik (Erik Kluzek) +Date: Wed May 16 20:27:39 MDT 2018 +One-line Summary: 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing + +Purpose of changes +------------------ + +Update ndep file used for fully coupled 1850 cases to one being used in fully coupled +simulations. Update cism to latest release branch: release-v2.1.00. +Update PE layouts for f45, f09, f19. Turn BFBFLAG=TRUE for most CTSM testing. +Fix some issues with tools for batch submission. Remove a write statement for VIC +that was written a ridiculous amount of times. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #) #363 #374 #380 #382 #383: + #363 -- PE Layout + $374 -- Turn BFBFLAG on for testing (so PE layout changes won't appear to change answers) + #382 -- Write statement for VIC + $383 -- mkmapdata intel version + +Known bugs introduced in this tag (include github issue ID): #384 + #384 -- f09 resolution VIC test + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): PE layouts + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): ndep for clm50_cam6 forcing + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Added back tests + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - OK + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev010 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes for some + + Summarize any changes to answers, i.e., + - what code configurations: all with cism, tests as BFBFLAG on + - what platforms/compilers: all + - nature of change: similar + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism + + cism to release-v2.1.00 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #381 -- 1850 fully coupled ndep update, update cism, update PE layouts, turn BFBFLAG on for testing + +=============================================================== +=============================================================== +Tag name: clm5.0.dev010 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue May 15 03:00:38 MDT 2018 +One-line Summary: Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit + +Purpose of changes +------------------ + +Update externals to version in cesm2.0.beta10. Add in f05 crop datasets. Add pauseResume for DART and a +test for it. Fix several issues required for CESM2.0. Add model_doi_url to history files. + +update cism to very latest +Add model_doi_url to history files +Update rtm, mosart +Changes answers because of change in orbit (for testing orbit was already updated for 1850 so will appear to not change answers) +Using cime5.6.6 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #68 --- gnu compiler workaround + #364 -- crop f05 datasets + #362 -- svn checkout + #318 -- quadratic bug + #249 -- bypass balance checks for DART + #341 -- add model_doi_url + +CIME Issues fixed (include issue #): + +Known bugs introduced in this tag (include github issue ID): + #379 -- transient end-of-year exact restart issue + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): + + cime updates: + - manage_testlist was removed. + - Changes to matching behavior in env_mach_specific. + - New option to wait_for_tests. + - case.st_archive now has a --test option. + - New FORCE_BUILD_THREADED. + - New custom script option. + - env_archive.xml + - .case.run.sh file generated for E3SM. + - New selectors allowed for batch directives. + - Source code files beginning in test_ will be ignored in build. + - New prefix attribute available for batch directives. + - xmlquery will now accept derived attributes. + - Users may run on lawrencium lr3/lr2. + - In env_archive.xml. + - (cesm only) create_test and query_testlist now have --supported-only flag + - New allow_error attribute for module systems. + - check_input_data replace --svn-loc with --server and --protocal + - Some Tools with "acme" in the name now say "e3sm". + - env_archive.xml + - .case.run.sh file generated for E3SM. + - New selectors allowed for batch directives. + - Source code files beginning in test_ will be ignored in build. + - New prefix attribute available for batch directives. + - xmlquery will now accept derived attributes. + - Users may run on lawrencium lr3/lr2. + - In env_archive.xml. + - (cesm only) create_test and query_testlist now have --supported-only flag + - New allow_error attribute for module systems. + - check_input_data replace --svn-loc with --server and --protocal + - Some Tools with "acme" in the name now say "e3sm". + - cime_bisect changes. + - New XML variables, PAUSE_ACTIVE_XXX. + - module_lmod no longer a support module type. + - simple-py-prof sets PYTHONPATH for you, list_acme_tests assumes you want + to list tests + - jobid now added to CaseStatus case_submit entry. + -Splits GLC2OCN_RMAPNAME xml variable into + GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for + GLC2OCN_RMAPTYPE + - Better defaults for bless_test_results and compare_test_results. + - New bless_log file in baseline dirs. + - Allow multiple -m args to case.submit. Allows user to put email settings in .cime/config. + - New --retry option to create_test. + - Add --clean-depends to case.build, this argument can take a component list and will + clean all components if one is not provided. + - Some additional output from nl comp code in some cases + - --driver added to create_newcase, new _V$driver testopt. + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + Crop f05 surface datasets + +Substantial timing or memory changes: Seems to be slower and require more memory + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + pause/resume is still under development. This works for DART DA as needed for CESm2.0 + +Changes to tests or testing: + Added new pauseResume test on cheyenne_intel + Remove some of the higher PE count tests on cheyenne_gnu and replace with cheyenne_intel + Lengthen wallclock for a few of the tests on cheyenne + Change I1850Clm50BgcSpinup test to f09 resolution so it will run + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev009 + + +Answer changes +-------------- + +Changes answers relative to baseline: 1850 compsets change because orbit has been changed + + Summarize any changes to answers, i.e., + - what code configurations: 1850 compsets + - what platforms/compilers: all + - nature of change: 1850 orbit rather than 1990 + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, rtm, mosart, cism + + cime to cime5.6.6 + rtm to rtm1_0_66 + mosart to mosart1_0_31 + cism to cism2_1_54 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #377 -- update cime + #376 -- changes needed for DART + #372 -- Update manage_externals + +=============================================================== +=============================================================== +Tag name: clm5.0.dev009 +Originator(s): sacks (Bill Sacks) +Date: Thu May 10 13:48:32 MDT 2018 +One-line Summary: New init_interp method + +Purpose of changes +------------------ + +The main change in this tag is to introduce a new method for +init_interp. This is needed in order for subgrid areas to be the same in +initialization in runs with and without init_interp. + +The choice of init_interp method is controlled by a new namelist +variable, init_interp_method, whose documentation appears below: + + Method to use for init_interp. Only applies when use_init_interp = .true. + + 'general': The general-purpose method that can be used when changing + grids, configurations, etc. This starts off with subgrid areas taken + from the surface dataset. + + 'use_finidat_areas': This starts off with subgrid areas taken from the + input finidat file. This is needed to achieve bit-for-bit results in a + coupled case (where areas in initialization impact initial fields sent + to the atmosphere) (but using the 'general' method will typically have + only a very minor impact on results in this case). For this method to + work, the input finidat file needs to be at the same resolution as the + current configuration. So this is a less general form of + init_interp. However, it can be used when transitioning from a spinup + run to a transient run, or in other cases where the only difference is + in internal memory allocation. In order to catch possible problems, this + uses a different algorithm for finding the input point for each output + point, which ensures that each active output point is associated with + exactly one input point with the same latitude, longitude and type. This + method requires (a) the same grid for input and output, within roundoff; + (b) any non-zero-weight point in the input must have memory allocated + for it in this grid cell in the output (this will be satisfied if the + point is non-zero-weight on the surface dataset or if it's a point for + which we allocate memory even for zero-weight points); (c) any active + point in the output (based on the surface dataset and rules for + determining active points) must have a matching point in this grid cell + in the input. + +This tag also has some other changes: + +- Fixes #347 - endrun message behavior: needed for some of the new unit + tests + +- Fixes #345 - Add a cmip6_evolving_icesheet usermods directory: + unrelated, but folded in here for convenience of testing) + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- #346: New mode of operation for init_interp: Copy subgrid areas, too +- #347: endrun message behavior +- #345: Add a cmip6_evolving_icesheet usermods directory + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable - init_interp_method - documented above. Default + behavior is the same as before ('general') + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Added a new test type, similar to LII, that covers the new init_interp behavior +- Removed some no-longer-needed tests with 'interp' testmods + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + tests pass, namelists differ as expected + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + Unexpected baseline failures for these two tests that are in the + expected fail list for other reasons: + FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest + FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest + + Differences are just in some cism fields that I’m not concerned + about: roundoff-level differences in internal_time; big differences + in tempstag, uvel and vvel, but those fields don’t really make sense + in this configuration (and I have removed them in the latest CISM + tag). (Note that I did two runs of each of these tests from my + branch, and for both tests, the two runs had identical cism hist + files, so I don’t think this is a reproducibility problem.) + + +CLM tag used for the baseline comparisons: clm5.0.dev008 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #352 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev008 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri Apr 27 13:28:41 MDT 2018 +One-line Summary: With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 + +Purpose of changes +------------------ + +Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #351 -- FATES external to https + #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: + +Code reviewed by: wweider, rfischer + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev007 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: All CLM50 BGC with FUN on + - what platforms/compilers: All + - nature of change: climate very nearly the same + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + rfisher case -- clm5_nbug_test_case ----- short f45 resolution + oleson case --- clm5_nbug_test_case ----- AD spinup f45 resolution + oleson case --- clm5_nbug_test_casepAD -- Post AD spinup f45 resolution + + URL for LMWG diagnostics output used to validate new climate: + http://webext.cgd.ucar.edu/I1850/clm5_nbug_test_casepAD/lnd/clm5_nbug_test_casepAD.281_300-clm5_nbug_control_casepAD.281_300/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates changed to https form rather than ssh + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #344 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev007 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Apr 24 14:50:19 MDT 2018 +One-line Summary: Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit + +Purpose of changes +------------------ + +Important updates in land-ice model (CISM) version used that changes answers. Fix some initial condition problems +with CLM5.0 cases. Update the FATES version to a new updated science version that hence changes answers. +Change the default orbit for testing of 1850 cases to use 1850 orbit rather than 1990. +Make sure to use f45_f45_g37 and not f45_f45 in test lists. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #313 -- Issues with initial condition files + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New IC file for clm5_0_CRUv7 + CLM5.0 finidat files choosen will be different for both GSWP3.1 and CRUNCEPv7 forcing + +Substantial timing or memory changes: No + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + When the cime version is updated the changes that make the 1850 orbit explicit in testing can be removed + +Changes to tests or testing: 1850 tests explicitly set a 1850 orbit, f45_f45 tests changed to include mask (f45_f45_mg37) + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev006 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers: + - what code configurations: All 1850 tests, all FATES, all with CISM, CLM50 initial conditions + - what platforms/compilers: All + - nature of change: Significant + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, cism + FATES to SCI_1.8.1_API_3.0.0 + cism to cism2_1_49 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #349 -- Update manage externals to manic_v1.1.3 + #348 -- Update FATES science version to 1.8.1, and bring in some answer changes + +=============================================================== +=============================================================== +Tag name: clm5.0.dev006 +Originator(s): sacks (Bill Sacks) +Date: Thu Apr 12 06:16:16 MDT 2018 +One-line Summary: Don't allocate memory for zero-weight natveg patches and urban + +Purpose of changes +------------------ + +We have previously been allocating memory for all urban columns and all +natural veg PFTs, everywhere. In some cases this may still be desired, +but in some cases - and particularly non-transient cases - this is a +waste of memory and performance without any benefit. + +In timing runs of a CONUS test case set up by Mike Barlage, where there +were 2 PFTs per gridcell (bare plus grass), only allocating memory for +the non-zero-weight points (i.e., 2 natural pfts per gridcell and +nothing else) reduced land run time from 56.4 sec to 21.6 sec. + +This tag puts in place a more general solution, avoiding allocating +memory for zero-weight natural PFTs in non-transient runs, and avoiding +allocating memory for zero-weight urban points unless requested with a +namelist flag. + +For non-transient runs, this change improves performance and decreases +memory and restart file size substantially: For short timing runs on +cheyenne_intel at f09_g16 (I haven't looked closely at memory use, but +it probably is about the same reduction as the restart file size): +- I1850Clm50Sp + - 91% of the runtime (i.e., 9.0% reduction in runtime) + - Restart file size is 32% of original (68% reduction) +- I1850Clm50Bgc + - 77% of the runtime (i.e., 23% reduction in runtime) + - Restart file size is 33% of original (67% reduction) +- I1850Clm50BgcCrop + - 80% of the runtime (i.e., 20% reduction in runtime) + - Restart file size is 37% of original (63% reduction) + +(Non-transient cases should also be improved due to the urban change, +but I haven't investigated the improvement there.) + +This tag also fixes some other bugs, as noted below. + +NOTE: This change requires running init_interp on any existing initial +conditions files! In addition, moving forward, init_interp will always +be needed when going from a non-transient to a transient run (this has +already been the case when running with crop; now it will also be the +case when running without crop, too). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #298: Don't allocate memory for zero-weight PFTs and urban + columns +- Fixes #317: c14 bombspike and c13 timeseries code can use the wrong + year, with irreproducible behavior +- Fixes #320: I1850Clm50Sp compset mistakenly uses SGLC + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- You will need to run init_interp on any existing initial conditions + files +- Moving forward, init_interp will always be needed when going from a + non-transient to a transient run (this has already been the case when + running with crop; now it will also be the case when running without + crop, too) + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable: run_zero_weight_urban: If TRUE, run all urban + landunits everywhere where we have valid urban data. This has two + effects: (1) goes back to the previous behavior of allocating memory + for urban nearly everywhere; (2) makes all urban columns active, even + if they have zero weight. This can be used to evaluate potential urban + behavior globally. + +Changes made to namelist defaults (e.g., changed parameter values): +- Use init_interp for all out-of-the-box finidat files + +Changes to the datasets (e.g., parameter, surface or initial files): +- Remove initial conditions for Fates for 1x1 Brazil + +Substantial timing or memory changes: +- Substantial decreases in memory use and improvements in timing: see + notes above. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed aux_clm Fates tests to use cold start +- Changed the allActive test to be a transient case so that we allocate and run all PFTs + +Code reviewed by: +- Quick review by Erik Kluzek +- Urban change reviewed by Keith Oleson + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + Tests pass, namelists differ as expected + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means: tests pass, some baseline failures as expected: + - DIMSIZEDIFF for vector output + - ERI_D_Ld9.f09_g16.I1850Clm50Sp.cheyenne_gnu.clm-default differs + due to fix of #320 + - ERP_D_Ld9.f09_g16.I1850Clm50SpCru.cheyenne_gnu.clm-default differs + because this uses init_interp whereas on master we did not use + init_interp, and this changes answers for this ERP test due to + #330 + - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 + differs due to fix of #317 + + Note: For changed tests (allActive and Fates tests), I ran the new + versions of the tests from clm5.0.dev005 and confirmed that dev006 + is bit-for-bit with dev005 for these changed tests. + +CLM tag used for the baseline comparisons: clm5.0.dev005 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but only in limited situations + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: see below + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + Changes answers in the following situations: + - Vector output is not directly comparable, because dimension sizes + differ + - I1850Clm50Sp cases change substantially due to fix of #320 + - Cases with carbon isotope bombspike change due to fix of #317 + - In some situations, cases that use init_interp now but did not + before can change answers by roundoff due to #330 + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #311: Avoid allocating memory for zero-weight natveg patches and urban + +=============================================================== +=============================================================== +Tag name: clm5.0.dev005 Originator(s): sacks (Bill Sacks) -Date: Fri Jun 22 07:31:43 MDT 2018 -One-line Summary: Begin separating SoilHydrology flux calculations +Date: Tue Apr 10 14:15:52 MDT 2018 +One-line Summary: Two fixes for init_interp + +Purpose of changes +------------------ + +Two fixes for init_interp: + +(1) Copy as many snow layers as possible in init_interp + + In most cases, we only need data from the existing snow layers. But in a + few cases - in particular, the flx_abs* variables - we need data even + from non-existing snow layers in order for interpolation to be + bit-for-bit. The change here reworks snow interpolation so that, in + addition to copying the existing snow layers, we also copy as many + non-existing snow layers as will fit in the destination layer structure. + + Fixes #326 + +(2) For glcmec, match col/patch types in some cases + + If glcmec used the same elevation class definitions in input and output, + then match classes as we do for most landunit types, rather than just + using topographic heights. (An exception is output cells with the + single_at_atm_topo behavior, because their types could change once we + enter the run loop.) + + Fixes #325 + +The new behavior is covered by unit tests. This tag also expands some +unit testing infrastructure to facilitate the addition of some of these +unit tests. + +I have confirmed that this test passes: +LII_D_Ld9.f09_g16.I1850Clm50SpCru.hobart_intel.clm-default, when I point +to an initial conditions file that I generated from the dev 002 tag +(because I wasn't sure if the current default initial conditions file +was exactly compatible with the latest master). Before the changes in +this tag, that test was failing. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- #326: init_interp can change answers for absorbed radiation in + non-existent snow layers +- #325: init_interp can change answers over the CISM domain + +Known bugs introduced in this tag (include github issue ID): +- #339: cheyenne_gnu restart test fails exact restart comparison sporadically + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, baselines fail as expected (baseline failures + just for tests that use init_interp) + +CLM tag used for the baseline comparisons: clm5.0.dev004 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: all configurations with use_init_interp = .true. + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but expected to be larger than roundoff / same climate + + Differences arise due to both fixes listed above. + + (1) Copy as many snow layers as possible in init_interp: It + appears that this only changes answers for some radiation + terms in the first time step after initialization when a snow + layer had just melted before the restart file was written. In + this case, the flx_abs* variables are set differently for this + just-disappeared layer. This can affect a lot of grid cells, + but I expect differences from this change to be very small and + not scientifically important. + + (2) For glcmec, match col/patch types in some cases: This seems to + only affect a small number of grid cells in Greenland. So I do + not expect the overall effect on a simulation to be significant. -Note the new tag naming: Starting with this tag, we are naming tags -"ctsm..." rather than "clm...". We are starting with ctsm version 1, -which for now is nearly the same as clm version 5. We are moving to this -new tag naming now because: + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ -(1) The changes in this tag represent the first step towards - implementing the CTSM vision (separating the biogeophysics flux - calculations from state updates, making it easier to plug in - alternative parameterizations, etc.). +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #328: fixes for init_interp -(2) This tag changes answers relative to the CLM5 release. (We expect - the climate to be the same, but we haven't tested this carefully - yet.) +=============================================================== +=============================================================== +Tag name: clm5.0.dev004 +Originator(s): erik (Erik Kluzek) +Date: Mon Apr 9 00:20:03 MDT 2018 +One-line Summary: List of important bug fixes Purpose of changes ------------------ -First steps toward separating various flux calculations in the soil -hydrology code. The focus here is on saturated surface runoff and -infiltration excess runoff. The changes here separate flux calculations -from state updates and extract various calculations into their own -subroutines to facilitate swapping in alternative parameterizations. +A list of important bug and usability fixes. One of those changes makes it easier for the user to end up with +initial condition files that don't match the start date of their simulation. This is problematic because of the +saved counters for prognostic crop. For sure a mismatched date will end up with bad results for the first season, +but this will also affect subsequent years running averages. So we don't recommend that you do that. + +Jim Edwards also brought in some changes for PIO for 64bit_data, and to fix fill values for integer data. And we updated +manage_externals to the newest version. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] +#213 -- usability issue for CPLHIST that Keith found. +#210 -- Recent request to increase number of tapes to 10. +#169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. +#68 --- workaround for gnu compiler bug +#46 --- needed for multi-instance +#66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work +#65 --– need to change a check from "> 0" to "> [small val]" +#240 -- from Jim +#255 -- get PTCLM working +#253 -- bad clm40 IC file + +Known bugs introduced in this tag (include github issue ID): + #329 -- init_interp doesn't work if finidat points to finidat_interp_dest from a different case + #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers + #325 -- init_interp can change answers over the CISM domain + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + You can bypass the ignore_ic_date error when crop is being used + Matching for initial conditions for crop simulations are allowed to ignore the month/day + When crop is on and the start date doesn't match the date for the initial conditions file, + the counters for the crop model will be incorrect -- and hence the first season will be screwed + up, and the screwed up results will affect the running averages for the future. This was a condition + that we didn't allow you to easily do -- we've made it easier for this to happen now. + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): + Allow ten streams of history tapes rather than just six. + Correct the I1850Clm50BgcSpinup compset + You can bypass the ignore_ic_date error when crop is being used (may affect results) + Matching for initial conditions for crop simulations are allowed to ignore the month/day + The precision control settings for Nitrogen and Carbon are now making it to the namelist + +Changes made to namelist defaults (e.g., changed parameter values): ncrit=1.d-8 (10X looser) + +Changes to the datasets (e.g., parameter, surface or initial files): Correct to a few finidat files (clm4_0_CRUv7) + +Substantial timing or memory changes: Maybe 3% to memory + + There is a 3% increase to memory, but memory high water mark seems to double + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + Added aux_cime_baseline tests + add cplhist test + Add edison to fates testlist + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes -Most of the changes here are refactorings that are either bit-for-bit or -just introduce roundoff-level differences. However, there are also a few -larger answer changes, as described below. +CLM testing: regular + + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] -These are the greater-than-roundoff-level answer changes: + build-namelist tests: + + cheyenne - PASS -(A1) Use full qflx_surf in BGC code. Previously, the subroutines ch4 and - SoilBiogeochemNLeaching had been using a flux that excluded surface - water runoff (qflx_h2osfc_surf). That was deemed to be incorrect - (by Dave Lawrence and others), so these BGC subroutines have been - changed to use the full surface runoff (saturated excess runoff + - infiltration excess runoff + h2osfc runoff). + unit-tests (components/clm/src): - Configurations affected: BGC compsets + cheyenne - PASS - Magnitude of change: Larger than roundoff; expected to be same - climate, but not investigated carefully + PTCLM testing (components/clm/tools/shared/PTCLM/test): -(A2) VIC: Don't ever use the TOPModel formulation for SurfaceRunoff + cheyenne - PASS - The code was using the TOPModel-based formulation for SurfaceRunoff - if frost_table > zwt_perched. Sean Swenson felt this shouldn't be - done, and refactoring will be easier if VIC always uses the - vic-looking formulation, so I'm stopping applying this formulation - when using VIC. + regular tests (aux_clm): - Configurations affected: VIC compsets + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK - Magnitude of change: Larger than roundoff; not investigated carefully +CLM tag used for the baseline comparisons: clm5.0.dev003 -(A3) VIC: Remove infiltration excess runoff - Martyn Clark reviewed the VIC implementation, and felt that the - current implementation of infiltration excess runoff is - inconsistent with the standard VIC implementation. It appears that - what was being called VIC's infiltration excess runoff was actually - just an attempt to give a better numerical approximation to the - solution for saturated surface excess runoff. So deleting this - leaves only a first-order approximation to VIC's saturated surface - excess runoff. +Answer changes +-------------- - Eventually we may want to put in place a more accurate solution for - VIC's saturated surface excess runoff. But Martyn's feeling is that - this can come in with other changes we want to make regarding - numerical solutions in CTSM. +Changes answers relative to baseline: no but, there are some specific potential or small apparant change to answers + in terms of the test suite + 3 fields have a different missing value pattern: landmask, pftmask, nbedrock + roundoff difference in F_N2O_DENIT due to #65 + LVG_Ld5_D.f10_f10.I1850Clm50Bgc.cheyenne_intel.clm-no_vector_output + landmask was different for two cases: + ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - Configurations affected: VIC compsets +Detailed list of changes +------------------------ - Magnitude of change: Larger than roundoff; expected to be same - climate, but not investigated carefully +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): manic + manage_externals to manicv1.0.2 -(A4) Change in QOVER diagnostic field: now includes QH2OSFC. +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) -These are the major refactorings (either bit-for-bit or just -roundoff-level differences): + #337 Update manage_externals to manicv1.0.2 + #333 Important fixes + #241 Add support for 64bit_data, fix fillvalues -(R1) Extract surface runoff to its own module, and other modularization - related to what used to be subroutine SurfaceRunoff: extract a - subroutine for each fsat method, move urban surface runoff code - into different routines. +=============================================================== +=============================================================== +Tag name: clm5.0.dev003 +Originator(s): erik (Erik Kluzek) +Date: Fri Mar 9 00:34:04 MST 2018 +One-line Summary: Bug fixes for energy imbalance associated with surface water and lakes -(R2) Extract infiltration excess runoff to its own module, and other - modularization related to what used to be subroutine Infiltration. +Purpose of changes +------------------ -NOTE: For a detailed breakdown of changes, including documentation of -which changed changed answers, see the file ChangeLog_branch which was -deleted from this branch shortly before it was merged to master. +These are bug fixes for the land energy imbalance over land as determined by coupler diagnostics. +They include bug fixes for surface water phase change and lake/snow interactions developed by +Sean Swenson and Keith Oleson. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): -- Fixes #424 (decStart testmod is missing an `--append` in an xmlchange command) +Issues fixed (include CTSM Issue #): #304 + #304 -- Energy imbalance over land per coupler diagnostics + +Known bugs introduced in this tag (include github issue ID): [If none, remove this line] + #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior + #313 -- Problems with CLM5 initial conditions files + #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): +Caveats for users (e.g., need to interpolate initial conditions): None -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None -Changes made to namelist defaults (e.g., changed parameter values): +Changes made to namelist defaults (e.g., changed parameter values): None -Changes to the datasets (e.g., parameter, surface or initial files): +Changes to the datasets (e.g., parameter, surface or initial files): None -Substantial timing or memory changes: +Substantial timing or memory changes: None Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide Caveats for developers (e.g., code that is duplicated that requires double maintenance): + There is some dupliciation in calculations by level that could be consolidated + For example, the calculation of c1. + There is a check for ffrac_sno(c) > 0, that probably should be greater than a small value -Changes to tests or testing: -- Shortened a 25-month f19 test to 13-months - (SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput): - This test took a long time to run, and we already have long tests of - this configuration at coarse-resolution. I suggested removing this - test entirely, but Erik Kluzek wanted to maintain a shortened version - of it. Erik's comments were: - - How about either flip it to f45 (because Rosie is using that - resolution for science) -- or leave it at f19 and have it run for 9 - months? The 25 months was to take it just past the 2-year spinup - time. From spunup initial conditions 9-months pretty much does a - full harvest cycle. f19 and f09 are the main configurations for - science and it would be good to have something longer than just - really short tests. - - I decided on Lm13, because this still completes in significantly less - than 2-hours, and if we're running for 9 months anyway, it seems - valuable to finish out the year and run a bit into the next year, - since some crop stuff triggers at the end of the year. - -Code reviewed by: Various code reviews done last Fall, when these -changes were first implemented. +Changes to tests or testing: none + +Code reviewed by: self, sacks, swensosc + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev002 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: clm4_5 and clm5_0 + - what platforms/compilers: all + - nature of change: climate similar + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461 + - username: oleson + - machine: cheyenne + + URL for LMWG diagnostics output used to validate new climate: + +http://webext.cgd.ucar.edu/I1850/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850/lnd/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461-clm50_r272_1deg_GSWP3V1_iso_1850.1443_1461/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #307 -- Bug fixes for energy imbalance associated with surface water and lakes + +=============================================================== +=============================================================== +Tag name: clm5.0.dev002 +Originator(s): sacks (Bill Sacks) +Date: Sun Feb 25 06:53:36 MST 2018 +One-line Summary: Add some land ice diagnostic vars needed for CMIP6 + +Purpose of changes +------------------ + +Add some diagnostic variables needed for analyzing land ice that have +been requested by some of the MIPs in CMIP6 (especially ISMIP). + +Also, fixes c2l_scale_type to fix urban scaling for SNOWICE, SNOWLIQ + +Some changes from Leo van Kampenhout. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- https://github.com/ESCOMP/ctsm/issues/271 Add some land ice fields for cmip6 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self, Erik Kluzek + +Did you follow the steps in .CLMTrunkChecklist: yes CLM testing: @@ -503,7 +1896,7 @@ CLM testing: unit-tests (components/clm/src): - cheyenne - PASS + cheyenne - pass tools-tests (components/clm/test/tools): @@ -515,39 +1908,47 @@ CLM testing: regular tests (aux_clm): - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok - OK means tests pass, answers change as expected. + ok means tests pass, answer changes as expected, as noted below -CLM tag used for the baseline comparisons: clm5.0.dev013 +CLM tag used for the baseline comparisons: clm5.0.dev001 Answer changes -------------- -Changes answers relative to baseline: YES +Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ If a tag changes answers relative to baseline comparison the following should be filled in (otherwise remove this section): Summarize any changes to answers, i.e., - - what code configurations: Essentially all (except CLM4) + - what code configurations: All - what platforms/compilers: All - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Roundoff-level changes for nearly all configurations (except CLM4). - - Greater-than-roundoff-level changes for the following - configurations: - - BGC: see (A1) note above (expected to be same climate, but not - investigated carefully) - - VIC: see (A2) and (A3) notes above (magnitude of change not - investigated carefully) - - QOVER diagnostic field: see (A4) note above + - just changes the diagnostic fields SNOWICE, SNOWLIQ, due to + fixed c2l_scale_type for these fields + + + The test + ERP_P72x2_Ly3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-irrig_o3_reduceOutput + also showed small answer changes just in the cpl field + l2x_Sl_tsrf00, for a single grid cell in Antarctica + (221.485144932008 vs. 221.485144910486). However, I reran it 10 + times, and it was bit-for-bit (other than SNOWICE and SNOWLIQ) in + all 10 of those re-runs. So I'm chalking this up to a machine + fluke. (The restart file from the problematic run showed diffs in + a bunch of fields; from spot-checking one - SNOW_DEPTH - diffs + were just in one point. But since this is a reduceOutput run, + diffs didn't show up in CLM history files. I confirmed that there + were no diffs in finidat_interp_dest or in namelists.) I + regenerated baselines for this test using one of the cases without + this machine fluke. If bitwise differences were observed, how did you show they were no worse than roundoff? N/A @@ -557,7 +1958,7 @@ Changes answers relative to baseline: YES - casename: N/A URL for LMWG diagnostics output used to validate new climate: N/A - + Detailed list of changes ------------------------ @@ -565,9 +1966,125 @@ Detailed list of changes List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/244 -- https://github.com/ESCOMP/ctsm/pull/190 -- Other PRs that existed on the old NCAR/clm-ctsm repository (which has - been deleted), which were not migrated to the new repository +(https://github.com/ESCOMP/ctsm/pull) + +#303 - Snow integrated temperature +#306 - Add some land ice diagnostic variables needed for cmip6 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev001 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Feb 14 14:14:34 MST 2018 +One-line Summary: Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM + +Purpose of changes +------------------ + +Fix problem with default LND_TUNING_MODE for cases coupled to CAM. Update some of the README +files. And also bring in a PTCLM version that will work in the new CTSM git checkout directory +structure. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +#255 PTCLMmkdata doesn't work in the CLM git checkout + +Known bugs found in this tag (include github issue ID): + +#262 hirespft option for mksurfdata.pl doesn't work + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: doc + +PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - PASS + + Extra Tests: + +ERS_Ld5.f19_g17.E1850L45TEST.cheyenne_intel.cice-default +SMS_Ld1.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist1d +SMS_Ld7.f09_g17.B1850.cheyenne_intel.allactive-defaultio + +CLM tag used for the baseline comparisons: clm5.0.dev000 + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): PTCLM + PTCLM to PTCLM2_180214 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +#297 -- README files +#296 -- Make LND_TUNING_MODE correct and consistent when coupled with CAM +#295 -- Bring in a working PTCLMmkdata version +#261 -- Reorder links + +=============================================================== +=============================================================== +Tag name: clm5.0.dev000 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Feb 05 2018 +One-line Summary: Initial version of CLM5.0 + +This is the initial science version of CLM5.0. + +Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly +notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop +modeling. +The updates to CLM science are documented here: + +https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 + +This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary +versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, +and future scenarios. + +Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution +(fv 0.9x1.25 with g1xv6 ocean mask). =============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index f28571cd93..e338e3c354 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -3,7 +3,6 @@ Tag Who Date Summary ctsm1.0.dev004 erik 07/18/2018 Add some new diagnostic fields, fix a few issues, update cmip6 output ctsm1.0.dev003 erik 07/15/2018 Update cime/cism to work on upgraded hobart and with glade changes on cheyenne ctsm1.0.dev002 erik 07/06/2018 Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases - ctsm1.0.dev001 sacks 06/22/2018 Begin separating SoilHydrology flux calculations clm5.0.dev013 erik 06/12/2018 cleanup and update cime and cism clm5.0.dev012 sacks 05/17/2018 Fixes for variable_year orbital mode clm5.0.dev011 erik 05/16/2018 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing diff --git a/doc/UpdateChangelog.pl b/doc/UpdateChangelog.pl index 88f8331d03..58e0165bcf 100755 --- a/doc/UpdateChangelog.pl +++ b/doc/UpdateChangelog.pl @@ -41,7 +41,7 @@ sub usage { To document a new tag - $ProgName ctsm1.0.dev012 "Description of this tag" + $ProgName clm4_5_2_r097 "Description of this tag" EOF } @@ -67,7 +67,7 @@ sub usage { $tag = $ARGV[0]; $sum = $ARGV[1]; - if ( $tag !~ /ctsm[0-9]\.[0-9]\.(dev[0-9][0-9][0-9]|[0-9][0-9])/ ) { + if ( $tag !~ /clm[0-9]\.[0-9]\.(dev[0-9][0-9][0-9]|[0-9][0-9])/ ) { print "ERROR: bad tagname: $tag\n"; usage(); } @@ -137,7 +137,7 @@ sub usage { my $oldTag = ""; while( $_ = ) { # If adding a new tag check that new tag name does NOT match any old tag - if ( $_ =~ /Tag name:[ ]*(ctsm.+)/ ) { + if ( $_ =~ /Tag name:[ ]*(clm.+)/ ) { $oldTag = $1; if ( (! $opts{'update'}) && ($tag eq $oldTag) ) { close( CL ); diff --git a/doc/clm5_0_ChangeLog b/doc/clm5_0_ChangeLog deleted file mode 100644 index 368d1742a0..0000000000 --- a/doc/clm5_0_ChangeLog +++ /dev/null @@ -1,1742 +0,0 @@ -=============================================================== -Tag name: clm5.0.dev013 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Jun 12 13:46:31 MDT 2018 -One-line Summary: cleanup and update cime and cism - -Purpose of changes ------------------- - -Update cime and cism to newer versions used in release. These bring in some answer -changes. The cime version updates the orbit for 2000 compsets. The cism version -changes answers for two fields with NO_EVOLVE and more fields for EVOLVE. - -Fixes an important bug needed for use with Data Assimulation. Several changes -to testing. Adding wallclock as needed, changing a few compsets so science -supported compsets are used, added tput_tolerance to some tests known to be -variable. - -Many changes to the clm tools for creating input files. Added the version by -querying "git describe" and adding it as an attribute to NetCDF files. Changes -to get tools working, and tested. Also changed so that tools can be run in either -a CTSM checkout or a CESM checkout. - -Updated README files so they are accurate. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] - #188 -- Global PTCLM tools test fails - #187 -- PTCLM tools tests fail baseline comparisons due to a seg fault - #259 -- Most README files in ctsm are incorrect - #386 -- Shorten some currently very long debug tests - #387 -- Lots of testmods still set orb_iyear and orb_iyear_align - #388 -- Add "git describe" to input files that are created - #389 -- Post data-assimilation processing broken with multi-driver - #393 -- Increase wallclock - #399 -- minor format update needed in namelist_definition_clm4_5.xml - #402 -- Some smaller tests can be slow.. - #411 -- Refactor tools aren't useful anymore - #414 -- PTCLM tests aren't working - #415 -- mkprocdata_map tests aren't working because of bad return statement in script type: bug - other - #418 -- Path needs to be updated for getco2 script type: bug - other - -Known bugs found since the previous tag (include github issue ID): #404, #413, #414 - #404 -- Carbon balance error in decStart test just after new year - #413 -- Currently can't use DAV cluster to make mapping files - #414 -- With change in repo for fates, had to enter username/password four times - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Yes - Lengthen some of the wallclock times. Remove the 1850 test-mods that just change the orbit. - Change some of the compsets tested to cover the science supported compsets. - Allow decStart test modes to ignore errors, so Crop tests can run. Remove a very long debug test. - Add a setting for tput_tolerance for some tests that are shown to have a large variability. - Add a test mod for data assimulation. Remove some of the settings from the pauseResume test - as already done, or tested seperately in the DA test. - -Code reviewed by: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - hobart --- PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - hobart --- PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - hobart --- PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - hobart --- OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev012 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! Because of changes in cism and cime - - Summarize any changes to answers: - - what code configurations: All 2000 compsets and some cases with cism - - what platforms/compilers: All - - nature of change: similar climate - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, rtm, mosart, PTCLM - - cime to cime_cesm2_0_rel_03 (changes answers for 2000 cases because of change to orbit - cism to release-v2.1.01 (changes answers for two fields for NOEVOLVE and more fields for EVOLVE) - PTCLM to PTCLM2_180611 - - rtm and mosart changed to point to cesm2_0 release versions (identical to previous version) - -Pull Requests that document the changes (include PR ids): #398, #400, #407, #408, #417, #394 -(https://github.com/ESCOMP/ctsm/pull) - - #394 -- some final cleanup - #417 -- Make PR template questions less prominent - #408 -- Documentation updates - #407 -- Initial version of templates for contributing, PR's and issues - #400 -- Update CanopyStateType.F90 priority: high type: code cleanup/docs - #398 -- Allow first history tape to have other than one time point per file priority: high type: enhance - science - -=============================================================== -=============================================================== -Tag name: clm5.0.dev012 -Originator(s): sacks (Bill Sacks) -Date: Thu May 17 14:13:34 MDT 2018 -One-line Summary: Fixes for variable_year orbital mode - -Purpose of changes ------------------- - -Fixes for correctness and exact restartability with variable_year -orbital mode: - -(1) Update max day length (max_dayl) each time step, rather than just - updating it once in initialization - -(2) Update to a cime version that has a fix for datm, which updates the - orbital parameters (used for solar zenith angle-based interpolation) - each time step, rather than just once in initialization - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #379 (Problems with Hist decStart restart tests due to variable - orbital year) -- Fixes #260 (max daylength doesn't change over time for varying orbital - parameters) - -CIME Issues fixed (include issue #): -- ESMCI/cime#2598 (datm doesn't restart properly with variable year orbit) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Gave extra time to some tests so they would pass - -Code reviewed by: Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, some baselines fail as expected - - Also verified that this test (reported in #379) now passes: - ERS_D_P36x1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart - - Also verified that the ctsm code changes alone (without the cime - update) have the expected behavior in terms of baseline - passes/fails: - - FAIL SMS_D_Ld10.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE - Enters the second year - PASS SMS_D_Ld1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE - Stays in first year - PASS SMS_Lm1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-ciso_bombspike1963 BASELINE - Stays in first year - -CLM tag used for the baseline comparisons: clm5.0.dev011 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: multi-year runs with HIST compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff/same climate - - Bit-for-bit for runs with fixed orbital parameters (non-HIST - compsets) and for HIST runs that do not span multiple years. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: adds one commit that fixes ESMCI/cime#2598 - -Pull Requests that document the changes (include PR ids): -- #385 (Update max day length (max_dayl) each time step) - -=============================================================== -=============================================================== -Tag name: clm5.0.dev011 -Originator(s): erik (Erik Kluzek) -Date: Wed May 16 20:27:39 MDT 2018 -One-line Summary: 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing - -Purpose of changes ------------------- - -Update ndep file used for fully coupled 1850 cases to one being used in fully coupled -simulations. Update cism to latest release branch: release-v2.1.00. -Update PE layouts for f45, f09, f19. Turn BFBFLAG=TRUE for most CTSM testing. -Fix some issues with tools for batch submission. Remove a write statement for VIC -that was written a ridiculous amount of times. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #) #363 #374 #380 #382 #383: - #363 -- PE Layout - $374 -- Turn BFBFLAG on for testing (so PE layout changes won't appear to change answers) - #382 -- Write statement for VIC - $383 -- mkmapdata intel version - -Known bugs introduced in this tag (include github issue ID): #384 - #384 -- f09 resolution VIC test - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): PE layouts - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): ndep for clm50_cam6 forcing - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Added back tests - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev010 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes for some - - Summarize any changes to answers, i.e., - - what code configurations: all with cism, tests as BFBFLAG on - - what platforms/compilers: all - - nature of change: similar - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism - - cism to release-v2.1.00 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #381 -- 1850 fully coupled ndep update, update cism, update PE layouts, turn BFBFLAG on for testing - -=============================================================== -=============================================================== -Tag name: clm5.0.dev010 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue May 15 03:00:38 MDT 2018 -One-line Summary: Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit - -Purpose of changes ------------------- - -Update externals to version in cesm2.0.beta10. Add in f05 crop datasets. Add pauseResume for DART and a -test for it. Fix several issues required for CESM2.0. Add model_doi_url to history files. - -update cism to very latest -Add model_doi_url to history files -Update rtm, mosart -Changes answers because of change in orbit (for testing orbit was already updated for 1850 so will appear to not change answers) -Using cime5.6.6 - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #68 --- gnu compiler workaround - #364 -- crop f05 datasets - #362 -- svn checkout - #318 -- quadratic bug - #249 -- bypass balance checks for DART - #341 -- add model_doi_url - -CIME Issues fixed (include issue #): - -Known bugs introduced in this tag (include github issue ID): - #379 -- transient end-of-year exact restart issue - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - cime updates: - - manage_testlist was removed. - - Changes to matching behavior in env_mach_specific. - - New option to wait_for_tests. - - case.st_archive now has a --test option. - - New FORCE_BUILD_THREADED. - - New custom script option. - - env_archive.xml - - .case.run.sh file generated for E3SM. - - New selectors allowed for batch directives. - - Source code files beginning in test_ will be ignored in build. - - New prefix attribute available for batch directives. - - xmlquery will now accept derived attributes. - - Users may run on lawrencium lr3/lr2. - - In env_archive.xml. - - (cesm only) create_test and query_testlist now have --supported-only flag - - New allow_error attribute for module systems. - - check_input_data replace --svn-loc with --server and --protocal - - Some Tools with "acme" in the name now say "e3sm". - - env_archive.xml - - .case.run.sh file generated for E3SM. - - New selectors allowed for batch directives. - - Source code files beginning in test_ will be ignored in build. - - New prefix attribute available for batch directives. - - xmlquery will now accept derived attributes. - - Users may run on lawrencium lr3/lr2. - - In env_archive.xml. - - (cesm only) create_test and query_testlist now have --supported-only flag - - New allow_error attribute for module systems. - - check_input_data replace --svn-loc with --server and --protocal - - Some Tools with "acme" in the name now say "e3sm". - - cime_bisect changes. - - New XML variables, PAUSE_ACTIVE_XXX. - - module_lmod no longer a support module type. - - simple-py-prof sets PYTHONPATH for you, list_acme_tests assumes you want - to list tests - - jobid now added to CaseStatus case_submit entry. - -Splits GLC2OCN_RMAPNAME xml variable into - GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for - GLC2OCN_RMAPTYPE - - Better defaults for bless_test_results and compare_test_results. - - New bless_log file in baseline dirs. - - Allow multiple -m args to case.submit. Allows user to put email settings in .cime/config. - - New --retry option to create_test. - - Add --clean-depends to case.build, this argument can take a component list and will - clean all components if one is not provided. - - Some additional output from nl comp code in some cases - - --driver added to create_newcase, new _V$driver testopt. - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): - Crop f05 surface datasets - -Substantial timing or memory changes: Seems to be slower and require more memory - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - pause/resume is still under development. This works for DART DA as needed for CESm2.0 - -Changes to tests or testing: - Added new pauseResume test on cheyenne_intel - Remove some of the higher PE count tests on cheyenne_gnu and replace with cheyenne_intel - Lengthen wallclock for a few of the tests on cheyenne - Change I1850Clm50BgcSpinup test to f09 resolution so it will run - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev009 - - -Answer changes --------------- - -Changes answers relative to baseline: 1850 compsets change because orbit has been changed - - Summarize any changes to answers, i.e., - - what code configurations: 1850 compsets - - what platforms/compilers: all - - nature of change: 1850 orbit rather than 1990 - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, rtm, mosart, cism - - cime to cime5.6.6 - rtm to rtm1_0_66 - mosart to mosart1_0_31 - cism to cism2_1_54 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #377 -- update cime - #376 -- changes needed for DART - #372 -- Update manage_externals - -=============================================================== -=============================================================== -Tag name: clm5.0.dev009 -Originator(s): sacks (Bill Sacks) -Date: Thu May 10 13:48:32 MDT 2018 -One-line Summary: New init_interp method - -Purpose of changes ------------------- - -The main change in this tag is to introduce a new method for -init_interp. This is needed in order for subgrid areas to be the same in -initialization in runs with and without init_interp. - -The choice of init_interp method is controlled by a new namelist -variable, init_interp_method, whose documentation appears below: - - Method to use for init_interp. Only applies when use_init_interp = .true. - - 'general': The general-purpose method that can be used when changing - grids, configurations, etc. This starts off with subgrid areas taken - from the surface dataset. - - 'use_finidat_areas': This starts off with subgrid areas taken from the - input finidat file. This is needed to achieve bit-for-bit results in a - coupled case (where areas in initialization impact initial fields sent - to the atmosphere) (but using the 'general' method will typically have - only a very minor impact on results in this case). For this method to - work, the input finidat file needs to be at the same resolution as the - current configuration. So this is a less general form of - init_interp. However, it can be used when transitioning from a spinup - run to a transient run, or in other cases where the only difference is - in internal memory allocation. In order to catch possible problems, this - uses a different algorithm for finding the input point for each output - point, which ensures that each active output point is associated with - exactly one input point with the same latitude, longitude and type. This - method requires (a) the same grid for input and output, within roundoff; - (b) any non-zero-weight point in the input must have memory allocated - for it in this grid cell in the output (this will be satisfied if the - point is non-zero-weight on the surface dataset or if it's a point for - which we allocate memory even for zero-weight points); (c) any active - point in the output (based on the surface dataset and rules for - determining active points) must have a matching point in this grid cell - in the input. - -This tag also has some other changes: - -- Fixes #347 - endrun message behavior: needed for some of the new unit - tests - -- Fixes #345 - Add a cmip6_evolving_icesheet usermods directory: - unrelated, but folded in here for convenience of testing) - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #346: New mode of operation for init_interp: Copy subgrid areas, too -- #347: endrun message behavior -- #345: Add a cmip6_evolving_icesheet usermods directory - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable - init_interp_method - documented above. Default - behavior is the same as before ('general') - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Added a new test type, similar to LII, that covers the new init_interp behavior -- Removed some no-longer-needed tests with 'interp' testmods - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - tests pass, namelists differ as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - Unexpected baseline failures for these two tests that are in the - expected fail list for other reasons: - FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest - FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest - - Differences are just in some cism fields that I’m not concerned - about: roundoff-level differences in internal_time; big differences - in tempstag, uvel and vvel, but those fields don’t really make sense - in this configuration (and I have removed them in the latest CISM - tag). (Note that I did two runs of each of these tests from my - branch, and for both tests, the two runs had identical cism hist - files, so I don’t think this is a reproducibility problem.) - - -CLM tag used for the baseline comparisons: clm5.0.dev008 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #352 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev008 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Apr 27 13:28:41 MDT 2018 -One-line Summary: With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 - -Purpose of changes ------------------- - -Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #351 -- FATES external to https - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - -Code reviewed by: wweider, rfischer - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev007 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 BGC with FUN on - - what platforms/compilers: All - - nature of change: climate very nearly the same - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - rfisher case -- clm5_nbug_test_case ----- short f45 resolution - oleson case --- clm5_nbug_test_case ----- AD spinup f45 resolution - oleson case --- clm5_nbug_test_casepAD -- Post AD spinup f45 resolution - - URL for LMWG diagnostics output used to validate new climate: - http://webext.cgd.ucar.edu/I1850/clm5_nbug_test_casepAD/lnd/clm5_nbug_test_casepAD.281_300-clm5_nbug_control_casepAD.281_300/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates changed to https form rather than ssh - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #344 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev007 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Apr 24 14:50:19 MDT 2018 -One-line Summary: Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit - -Purpose of changes ------------------- - -Important updates in land-ice model (CISM) version used that changes answers. Fix some initial condition problems -with CLM5.0 cases. Update the FATES version to a new updated science version that hence changes answers. -Change the default orbit for testing of 1850 cases to use 1850 orbit rather than 1990. -Make sure to use f45_f45_g37 and not f45_f45 in test lists. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #313 -- Issues with initial condition files - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New IC file for clm5_0_CRUv7 - CLM5.0 finidat files choosen will be different for both GSWP3.1 and CRUNCEPv7 forcing - -Substantial timing or memory changes: No - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - When the cime version is updated the changes that make the 1850 orbit explicit in testing can be removed - -Changes to tests or testing: 1850 tests explicitly set a 1850 orbit, f45_f45 tests changed to include mask (f45_f45_mg37) - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev006 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes - - Summarize any changes to answers: - - what code configurations: All 1850 tests, all FATES, all with CISM, CLM50 initial conditions - - what platforms/compilers: All - - nature of change: Significant - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, cism - FATES to SCI_1.8.1_API_3.0.0 - cism to cism2_1_49 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #349 -- Update manage externals to manic_v1.1.3 - #348 -- Update FATES science version to 1.8.1, and bring in some answer changes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev006 -Originator(s): sacks (Bill Sacks) -Date: Thu Apr 12 06:16:16 MDT 2018 -One-line Summary: Don't allocate memory for zero-weight natveg patches and urban - -Purpose of changes ------------------- - -We have previously been allocating memory for all urban columns and all -natural veg PFTs, everywhere. In some cases this may still be desired, -but in some cases - and particularly non-transient cases - this is a -waste of memory and performance without any benefit. - -In timing runs of a CONUS test case set up by Mike Barlage, where there -were 2 PFTs per gridcell (bare plus grass), only allocating memory for -the non-zero-weight points (i.e., 2 natural pfts per gridcell and -nothing else) reduced land run time from 56.4 sec to 21.6 sec. - -This tag puts in place a more general solution, avoiding allocating -memory for zero-weight natural PFTs in non-transient runs, and avoiding -allocating memory for zero-weight urban points unless requested with a -namelist flag. - -For non-transient runs, this change improves performance and decreases -memory and restart file size substantially: For short timing runs on -cheyenne_intel at f09_g16 (I haven't looked closely at memory use, but -it probably is about the same reduction as the restart file size): -- I1850Clm50Sp - - 91% of the runtime (i.e., 9.0% reduction in runtime) - - Restart file size is 32% of original (68% reduction) -- I1850Clm50Bgc - - 77% of the runtime (i.e., 23% reduction in runtime) - - Restart file size is 33% of original (67% reduction) -- I1850Clm50BgcCrop - - 80% of the runtime (i.e., 20% reduction in runtime) - - Restart file size is 37% of original (63% reduction) - -(Non-transient cases should also be improved due to the urban change, -but I haven't investigated the improvement there.) - -This tag also fixes some other bugs, as noted below. - -NOTE: This change requires running init_interp on any existing initial -conditions files! In addition, moving forward, init_interp will always -be needed when going from a non-transient to a transient run (this has -already been the case when running with crop; now it will also be the -case when running without crop, too). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #298: Don't allocate memory for zero-weight PFTs and urban - columns -- Fixes #317: c14 bombspike and c13 timeseries code can use the wrong - year, with irreproducible behavior -- Fixes #320: I1850Clm50Sp compset mistakenly uses SGLC - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- You will need to run init_interp on any existing initial conditions - files -- Moving forward, init_interp will always be needed when going from a - non-transient to a transient run (this has already been the case when - running with crop; now it will also be the case when running without - crop, too) - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable: run_zero_weight_urban: If TRUE, run all urban - landunits everywhere where we have valid urban data. This has two - effects: (1) goes back to the previous behavior of allocating memory - for urban nearly everywhere; (2) makes all urban columns active, even - if they have zero weight. This can be used to evaluate potential urban - behavior globally. - -Changes made to namelist defaults (e.g., changed parameter values): -- Use init_interp for all out-of-the-box finidat files - -Changes to the datasets (e.g., parameter, surface or initial files): -- Remove initial conditions for Fates for 1x1 Brazil - -Substantial timing or memory changes: -- Substantial decreases in memory use and improvements in timing: see - notes above. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changed aux_clm Fates tests to use cold start -- Changed the allActive test to be a transient case so that we allocate and run all PFTs - -Code reviewed by: -- Quick review by Erik Kluzek -- Urban change reviewed by Keith Oleson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - Tests pass, namelists differ as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means: tests pass, some baseline failures as expected: - - DIMSIZEDIFF for vector output - - ERI_D_Ld9.f09_g16.I1850Clm50Sp.cheyenne_gnu.clm-default differs - due to fix of #320 - - ERP_D_Ld9.f09_g16.I1850Clm50SpCru.cheyenne_gnu.clm-default differs - because this uses init_interp whereas on master we did not use - init_interp, and this changes answers for this ERP test due to - #330 - - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 - differs due to fix of #317 - - Note: For changed tests (allActive and Fates tests), I ran the new - versions of the tests from clm5.0.dev005 and confirmed that dev006 - is bit-for-bit with dev005 for these changed tests. - -CLM tag used for the baseline comparisons: clm5.0.dev005 - - -Answer changes --------------- - -Changes answers relative to baseline: YES, but only in limited situations - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: see below - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Changes answers in the following situations: - - Vector output is not directly comparable, because dimension sizes - differ - - I1850Clm50Sp cases change substantially due to fix of #320 - - Cases with carbon isotope bombspike change due to fix of #317 - - In some situations, cases that use init_interp now but did not - before can change answers by roundoff due to #330 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #311: Avoid allocating memory for zero-weight natveg patches and urban - -=============================================================== -=============================================================== -Tag name: clm5.0.dev005 -Originator(s): sacks (Bill Sacks) -Date: Tue Apr 10 14:15:52 MDT 2018 -One-line Summary: Two fixes for init_interp - -Purpose of changes ------------------- - -Two fixes for init_interp: - -(1) Copy as many snow layers as possible in init_interp - - In most cases, we only need data from the existing snow layers. But in a - few cases - in particular, the flx_abs* variables - we need data even - from non-existing snow layers in order for interpolation to be - bit-for-bit. The change here reworks snow interpolation so that, in - addition to copying the existing snow layers, we also copy as many - non-existing snow layers as will fit in the destination layer structure. - - Fixes #326 - -(2) For glcmec, match col/patch types in some cases - - If glcmec used the same elevation class definitions in input and output, - then match classes as we do for most landunit types, rather than just - using topographic heights. (An exception is output cells with the - single_at_atm_topo behavior, because their types could change once we - enter the run loop.) - - Fixes #325 - -The new behavior is covered by unit tests. This tag also expands some -unit testing infrastructure to facilitate the addition of some of these -unit tests. - -I have confirmed that this test passes: -LII_D_Ld9.f09_g16.I1850Clm50SpCru.hobart_intel.clm-default, when I point -to an initial conditions file that I generated from the dev 002 tag -(because I wasn't sure if the current default initial conditions file -was exactly compatible with the latest master). Before the changes in -this tag, that test was failing. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #326: init_interp can change answers for absorbed radiation in - non-existent snow layers -- #325: init_interp can change answers over the CISM domain - -Known bugs introduced in this tag (include github issue ID): -- #339: cheyenne_gnu restart test fails exact restart comparison sporadically - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, baselines fail as expected (baseline failures - just for tests that use init_interp) - -CLM tag used for the baseline comparisons: clm5.0.dev004 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all configurations with use_init_interp = .true. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff / same climate - - Differences arise due to both fixes listed above. - - (1) Copy as many snow layers as possible in init_interp: It - appears that this only changes answers for some radiation - terms in the first time step after initialization when a snow - layer had just melted before the restart file was written. In - this case, the flx_abs* variables are set differently for this - just-disappeared layer. This can affect a lot of grid cells, - but I expect differences from this change to be very small and - not scientifically important. - - (2) For glcmec, match col/patch types in some cases: This seems to - only affect a small number of grid cells in Greenland. So I do - not expect the overall effect on a simulation to be significant. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #328: fixes for init_interp - -=============================================================== -=============================================================== -Tag name: clm5.0.dev004 -Originator(s): erik (Erik Kluzek) -Date: Mon Apr 9 00:20:03 MDT 2018 -One-line Summary: List of important bug fixes - -Purpose of changes ------------------- - -A list of important bug and usability fixes. One of those changes makes it easier for the user to end up with -initial condition files that don't match the start date of their simulation. This is problematic because of the -saved counters for prognostic crop. For sure a mismatched date will end up with bad results for the first season, -but this will also affect subsequent years running averages. So we don't recommend that you do that. - -Jim Edwards also brought in some changes for PIO for 64bit_data, and to fix fill values for integer data. And we updated -manage_externals to the newest version. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -#213 -- usability issue for CPLHIST that Keith found. -#210 -- Recent request to increase number of tapes to 10. -#169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. -#68 --- workaround for gnu compiler bug -#46 --- needed for multi-instance -#66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work -#65 --– need to change a check from "> 0" to "> [small val]" -#240 -- from Jim -#255 -- get PTCLM working -#253 -- bad clm40 IC file - -Known bugs introduced in this tag (include github issue ID): - #329 -- init_interp doesn't work if finidat points to finidat_interp_dest from a different case - #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers - #325 -- init_interp can change answers over the CISM domain - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - You can bypass the ignore_ic_date error when crop is being used - Matching for initial conditions for crop simulations are allowed to ignore the month/day - When crop is on and the start date doesn't match the date for the initial conditions file, - the counters for the crop model will be incorrect -- and hence the first season will be screwed - up, and the screwed up results will affect the running averages for the future. This was a condition - that we didn't allow you to easily do -- we've made it easier for this to happen now. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - Allow ten streams of history tapes rather than just six. - Correct the I1850Clm50BgcSpinup compset - You can bypass the ignore_ic_date error when crop is being used (may affect results) - Matching for initial conditions for crop simulations are allowed to ignore the month/day - The precision control settings for Nitrogen and Carbon are now making it to the namelist - -Changes made to namelist defaults (e.g., changed parameter values): ncrit=1.d-8 (10X looser) - -Changes to the datasets (e.g., parameter, surface or initial files): Correct to a few finidat files (clm4_0_CRUv7) - -Substantial timing or memory changes: Maybe 3% to memory - - There is a 3% increase to memory, but memory high water mark seems to double - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - Added aux_cime_baseline tests - add cplhist test - Add edison to fates testlist - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev003 - - -Answer changes --------------- - -Changes answers relative to baseline: no but, there are some specific potential or small apparant change to answers - in terms of the test suite - 3 fields have a different missing value pattern: landmask, pftmask, nbedrock - roundoff difference in F_N2O_DENIT due to #65 - LVG_Ld5_D.f10_f10.I1850Clm50Bgc.cheyenne_intel.clm-no_vector_output - landmask was different for two cases: - ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): manic - manage_externals to manicv1.0.2 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #337 Update manage_externals to manicv1.0.2 - #333 Important fixes - #241 Add support for 64bit_data, fix fillvalues - -=============================================================== -=============================================================== -Tag name: clm5.0.dev003 -Originator(s): erik (Erik Kluzek) -Date: Fri Mar 9 00:34:04 MST 2018 -One-line Summary: Bug fixes for energy imbalance associated with surface water and lakes - -Purpose of changes ------------------- - -These are bug fixes for the land energy imbalance over land as determined by coupler diagnostics. -They include bug fixes for surface water phase change and lake/snow interactions developed by -Sean Swenson and Keith Oleson. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #304 - #304 -- Energy imbalance over land per coupler diagnostics - -Known bugs introduced in this tag (include github issue ID): [If none, remove this line] - #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior - #313 -- Problems with CLM5 initial conditions files - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - There is some dupliciation in calculations by level that could be consolidated - For example, the calculation of c1. - There is a check for ffrac_sno(c) > 0, that probably should be greater than a small value - -Changes to tests or testing: none - -Code reviewed by: self, sacks, swensosc - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev002 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 and clm5_0 - - what platforms/compilers: all - - nature of change: climate similar - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461 - - username: oleson - - machine: cheyenne - - URL for LMWG diagnostics output used to validate new climate: - -http://webext.cgd.ucar.edu/I1850/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850/lnd/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461-clm50_r272_1deg_GSWP3V1_iso_1850.1443_1461/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #307 -- Bug fixes for energy imbalance associated with surface water and lakes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev002 -Originator(s): sacks (Bill Sacks) -Date: Sun Feb 25 06:53:36 MST 2018 -One-line Summary: Add some land ice diagnostic vars needed for CMIP6 - -Purpose of changes ------------------- - -Add some diagnostic variables needed for analyzing land ice that have -been requested by some of the MIPs in CMIP6 (especially ISMIP). - -Also, fixes c2l_scale_type to fix urban scaling for SNOWICE, SNOWLIQ - -Some changes from Leo van Kampenhout. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- https://github.com/ESCOMP/ctsm/issues/271 Add some land ice fields for cmip6 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self, Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, answer changes as expected, as noted below - -CLM tag used for the baseline comparisons: clm5.0.dev001 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - just changes the diagnostic fields SNOWICE, SNOWLIQ, due to - fixed c2l_scale_type for these fields - - - The test - ERP_P72x2_Ly3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-irrig_o3_reduceOutput - also showed small answer changes just in the cpl field - l2x_Sl_tsrf00, for a single grid cell in Antarctica - (221.485144932008 vs. 221.485144910486). However, I reran it 10 - times, and it was bit-for-bit (other than SNOWICE and SNOWLIQ) in - all 10 of those re-runs. So I'm chalking this up to a machine - fluke. (The restart file from the problematic run showed diffs in - a bunch of fields; from spot-checking one - SNOW_DEPTH - diffs - were just in one point. But since this is a reduceOutput run, - diffs didn't show up in CLM history files. I confirmed that there - were no diffs in finidat_interp_dest or in namelists.) I - regenerated baselines for this test using one of the cases without - this machine fluke. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#303 - Snow integrated temperature -#306 - Add some land ice diagnostic variables needed for cmip6 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev001 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Feb 14 14:14:34 MST 2018 -One-line Summary: Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM - -Purpose of changes ------------------- - -Fix problem with default LND_TUNING_MODE for cases coupled to CAM. Update some of the README -files. And also bring in a PTCLM version that will work in the new CTSM git checkout directory -structure. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -#255 PTCLMmkdata doesn't work in the CLM git checkout - -Known bugs found in this tag (include github issue ID): - -#262 hirespft option for mksurfdata.pl doesn't work - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: doc - -PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - PASS - - Extra Tests: - -ERS_Ld5.f19_g17.E1850L45TEST.cheyenne_intel.cice-default -SMS_Ld1.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist1d -SMS_Ld7.f09_g17.B1850.cheyenne_intel.allactive-defaultio - -CLM tag used for the baseline comparisons: clm5.0.dev000 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): PTCLM - PTCLM to PTCLM2_180214 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#297 -- README files -#296 -- Make LND_TUNING_MODE correct and consistent when coupled with CAM -#295 -- Bring in a working PTCLMmkdata version -#261 -- Reorder links - -=============================================================== -=============================================================== -Tag name: clm5.0.dev000 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Feb 05 2018 -One-line Summary: Initial version of CLM5.0 - -This is the initial science version of CLM5.0. - -Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly -notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop -modeling. -The updates to CLM science are documented here: - -https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 - -This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary -versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, -and future scenarios. - -Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution -(fv 0.9x1.25 with g1xv6 ocean mask). - -=============================================================== diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index 83a58f2c42..a8ed44cd97 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -36,7 +36,7 @@ module CNDriverMod use PhotosynthesisMod , only : photosyns_type use ch4Mod , only : ch4_type use EnergyFluxType , only : energyflux_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type ! ! !PUBLIC TYPES: implicit none @@ -91,7 +91,7 @@ subroutine CNDriverNoLeaching(bounds, soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - dgvs_inst, photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & + dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & nutrient_competition_method, cnfire_method) ! ! !DESCRIPTION: @@ -175,7 +175,7 @@ subroutine CNDriverNoLeaching(bounds, type(ch4_type) , intent(in) :: ch4_inst type(dgvs_type) , intent(inout) :: dgvs_inst type(photosyns_type) , intent(in) :: photosyns_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method class(cnfire_method_type) , intent(inout) :: cnfire_method @@ -744,7 +744,7 @@ subroutine CNDriverNoLeaching(bounds, call t_startf('CNFire') call cnfire_method%CNFireArea(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, & totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 20658dbe84..04c3e232ed 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -35,7 +35,7 @@ module CNFireBaseMod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -263,7 +263,7 @@ end subroutine CNFireInterp !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -280,7 +280,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index ec90ee438d..3e023a68a8 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -34,7 +34,7 @@ module CNFireLi2014Mod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -83,7 +83,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -106,7 +106,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst @@ -164,7 +164,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fd_pft => pftcon%fd_pft , & ! Input: btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf => waterstate_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index dd2c6c393f..e108462244 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -34,7 +34,7 @@ module CNFireLi2016Mod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type use WaterstateType , only : waterstate_type use GridcellType , only : grc use ColumnType , only : col @@ -84,7 +84,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -108,7 +108,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst @@ -171,7 +171,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fd_pft => pftcon%fd_pft , & ! Input: btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool diff --git a/src/biogeochem/CNFireMethodMod.F90 b/src/biogeochem/CNFireMethodMod.F90 index e98114ba76..d3c9afe1f8 100644 --- a/src/biogeochem/CNFireMethodMod.F90 +++ b/src/biogeochem/CNFireMethodMod.F90 @@ -96,7 +96,7 @@ end subroutine CNFireInterp_interface !----------------------------------------------------------------------- subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -107,7 +107,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil use decompMod , only : bounds_type use atm2lndType , only : atm2lnd_type use EnergyFluxType , only : energyflux_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type use WaterstateType , only : waterstate_type use CNVegStateType , only : cnveg_state_type use CNVegCarbonStateType , only : cnveg_carbonstate_type @@ -122,7 +122,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNFireNoFireMod.F90 b/src/biogeochem/CNFireNoFireMod.F90 index 9f779be9cd..e752bc9a2f 100644 --- a/src/biogeochem/CNFireNoFireMod.F90 +++ b/src/biogeochem/CNFireNoFireMod.F90 @@ -16,7 +16,7 @@ module CNFireNoFireMod use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use EnergyFluxType , only : energyflux_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type use WaterstateType , only : waterstate_type use CNFireMethodMod , only : cnfire_method_type use CNFireBaseMod , only : cnfire_base_type @@ -58,7 +58,7 @@ end function constructor !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterstate_inst, & + atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -76,7 +76,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(waterstate_type) , intent(in) :: waterstate_inst type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 5894ce2a86..9f555f6b14 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -72,7 +72,7 @@ module CNVegetationFacade use CNDVType , only : dgvs_type use CNDVDriverMod , only : CNDVDriver, CNDVHIST use EnergyFluxType , only : energyflux_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type use FrictionVelocityMod , only : frictionvel_type use SoilBiogeochemStateType , only : soilBiogeochem_state_type use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type @@ -784,7 +784,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & + photosyns_inst, soilhydrology_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) ! ! !DESCRIPTION: @@ -823,7 +823,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & type(crop_type) , intent(inout) :: crop_inst type(ch4_type) , intent(in) :: ch4_inst type(photosyns_type) , intent(in) :: photosyns_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(soilhydrology_type) , intent(in) :: soilhydrology_inst type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method type(fireemis_type) , intent(inout) :: fireemis_inst @@ -853,7 +853,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - this%dgvs_inst, photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & + this%dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & nutrient_competition_method, this%cnfire_method) ! fire carbon emissions diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 index c207e0ea46..26dc791f72 100644 --- a/src/biogeochem/ch4Mod.F90 +++ b/src/biogeochem/ch4Mod.F90 @@ -1725,7 +1725,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) tws => waterstate_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] total surface runoff (mm H2O /s) + qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) zwt0 => ch4_inst%zwt0_col , & ! Input: [real(r8) (:) ] decay factor for finundated (m) diff --git a/src/biogeophys/BalanceCheckMod.F90 b/src/biogeophys/BalanceCheckMod.F90 index 34705322b2..91fdd30ad3 100644 --- a/src/biogeophys/BalanceCheckMod.F90 +++ b/src/biogeophys/BalanceCheckMod.F90 @@ -180,6 +180,7 @@ subroutine BalanceCheck( bounds, & qflx_h2osfc_to_ice => waterflux_inst%qflx_h2osfc_to_ice_col , & ! Input: [real(r8) (:) ] conversion of h2osfc to ice qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] total runoff due to flooding + qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Input: [real(r8) (:) ] surface water runoff (mm/s) qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Input: [real(r8) (:) ] drainage from snow pack qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Input: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes @@ -271,6 +272,7 @@ subroutine BalanceCheck( bounds, & + qflx_glcice_dyn_water_flux(c) & - qflx_evap_tot(c) & - qflx_surf(c) & + - qflx_h2osfc_surf(c) & - qflx_qrgwl(c) & - qflx_drain(c) & - qflx_drain_perched(c) & @@ -318,6 +320,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'qflx_evap_tot = ',qflx_evap_tot(indexc)*dtime write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc)*dtime write(iulog,*)'qflx_surf = ',qflx_surf(indexc)*dtime + write(iulog,*)'qflx_h2osfc_surf = ',qflx_h2osfc_surf(indexc)*dtime write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc)*dtime write(iulog,*)'qflx_drain = ',qflx_drain(indexc)*dtime write(iulog,*)'qflx_ice_runoff_snwcp = ',qflx_ice_runoff_snwcp(indexc)*dtime @@ -329,7 +332,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'deltawb = ',endwb(indexc)-begwb(indexc) write(iulog,*)'deltawb/dtime = ',(endwb(indexc)-begwb(indexc))/dtime write(iulog,*)'deltaflux = ',forc_rain_col(indexc)+forc_snow_col(indexc) - (qflx_evap_tot(indexc) + & - qflx_surf(indexc)+qflx_drain(indexc)) + qflx_surf(indexc)+qflx_h2osfc_surf(indexc)+qflx_drain(indexc)) write(iulog,*)'clm model is stopping' call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) @@ -348,6 +351,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'qflx_evap_tot = ',qflx_evap_tot(indexc)*dtime write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc)*dtime write(iulog,*)'qflx_surf = ',qflx_surf(indexc)*dtime + write(iulog,*)'qflx_h2osfc_surf = ',qflx_h2osfc_surf(indexc)*dtime write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc)*dtime write(iulog,*)'qflx_drain = ',qflx_drain(indexc)*dtime write(iulog,*)'qflx_drain_perched = ',qflx_drain_perched(indexc)*dtime diff --git a/src/biogeophys/HydrologyDrainageMod.F90 b/src/biogeophys/HydrologyDrainageMod.F90 index 80c1f73748..3dd434661b 100644 --- a/src/biogeophys/HydrologyDrainageMod.F90 +++ b/src/biogeophys/HydrologyDrainageMod.F90 @@ -101,6 +101,7 @@ subroutine HydrologyDrainage(bounds, & qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! excess liquid h2o due to snow capping, ! which we simply discard in order to reset ! the snow pack (mm H2O /s) [+] + qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! surface water runoff (mm/s) qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! sub-surface runoff from perched zwt (mm H2O /s) qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! soil saturation excess [mm h2o/s] qflx_drain => waterflux_inst%qflx_drain_col , & ! sub-surface runoff (mm H2O /s) @@ -174,6 +175,7 @@ subroutine HydrologyDrainage(bounds, & qflx_drain(c) = 0._r8 qflx_drain_perched(c) = 0._r8 + qflx_h2osfc_surf(c) = 0._r8 qflx_surf(c) = 0._r8 qflx_infl(c) = 0._r8 qflx_qrgwl(c) = forc_rain(c) + forc_snow(c) + qflx_floodg(g) - qflx_evap_tot(c) - qflx_snwcp_ice(c) - & @@ -183,8 +185,8 @@ subroutine HydrologyDrainage(bounds, & else if (lun%urbpoi(l) .and. ctype(c) /= icol_road_perv) then qflx_drain_perched(c) = 0._r8 + qflx_h2osfc_surf(c) = 0._r8 qflx_rsub_sat(c) = spval - qflx_infl(c) = 0._r8 end if @@ -203,7 +205,7 @@ subroutine HydrologyDrainage(bounds, & c = filter_nolakec(fc) l = col%landunit(c) - qflx_runoff(c) = qflx_drain(c) + qflx_surf(c) + qflx_qrgwl(c) + qflx_drain_perched(c) + qflx_runoff(c) = qflx_drain(c) + qflx_surf(c) + qflx_h2osfc_surf(c) + qflx_qrgwl(c) + qflx_drain_perched(c) if ((lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) .and. col%active(c)) then qflx_runoff(c) = qflx_runoff(c) - qflx_irrig(c) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 5e049166d5..05dcb8a145 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -14,10 +14,8 @@ Module HydrologyNoDrainageMod use AerosolMod , only : aerosol_type use EnergyFluxType , only : energyflux_type use TemperatureType , only : temperature_type - use SoilHydrologyType , only : soilhydrology_type + use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type - use SaturatedExcessRunoffMod, only : saturated_excess_runoff_type - use InfiltrationExcessRunoffMod, only : infiltration_excess_runoff_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type use CanopyStateType , only : canopystate_type @@ -45,12 +43,22 @@ subroutine HydrologyNoDrainage(bounds, & clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & waterflux_inst, waterstate_inst, & - soilhydrology_inst, saturated_excess_runoff_inst, infiltration_excess_runoff_inst, & - aerosol_inst, canopystate_inst, soil_water_retention_curve, topo_inst) + soilhydrology_inst, aerosol_inst, & + canopystate_inst, soil_water_retention_curve, topo_inst) ! ! !DESCRIPTION: ! This is the main subroutine to execute the calculation of soil/snow ! hydrology + ! Calling sequence is: + ! -> SnowWater: change of snow mass and snow water onto soil + ! -> SurfaceRunoff: surface runoff + ! -> Infiltration: infiltration into surface soil layer + ! -> SoilWater: soil water movement between layers + ! -> Tridiagonal tridiagonal matrix solution + ! -> Drainage: subsurface runoff + ! -> SnowCompaction: compaction of snow layers + ! -> CombineSnowLayers: combine snow layers that are thinner than minimum + ! -> DivideSnowLayers: subdivide snow layers that are thicker than maximum ! ! !USES: use clm_varcon , only : denh2o, denice, hfus, grav, tfrz @@ -62,11 +70,7 @@ subroutine HydrologyNoDrainage(bounds, & use clm_time_manager , only : get_step_size, get_nstep use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping use SnowHydrologyMod , only : SnowWater, BuildSnowFilter - use SoilHydrologyMod , only : CLMVICMap, SetSoilWaterFractions - use SoilHydrologyMod , only : SetQflxInputs, RouteInfiltrationExcess, UpdateH2osfc - use SoilHydrologyMod , only : Infiltration, TotalSurfaceRunoff - use SoilHydrologyMod , only : UpdateUrbanPonding - use SoilHydrologyMod , only : WaterTable, PerchedWaterTable + use SoilHydrologyMod , only : CLMVICMap, SurfaceRunoff, Infiltration, WaterTable, PerchedWaterTable use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation use SoilWaterMovementMod , only : SoilWater use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type @@ -95,8 +99,6 @@ subroutine HydrologyNoDrainage(bounds, & type(waterstate_type) , intent(inout) :: waterstate_inst type(aerosol_type) , intent(inout) :: aerosol_inst type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(saturated_excess_runoff_type), intent(inout) :: saturated_excess_runoff_inst - type(infiltration_excess_runoff_type), intent(inout) :: infiltration_excess_runoff_inst type(canopystate_type) , intent(inout) :: canopystate_inst class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve class(topo_type) , intent(in) :: topo_inst @@ -184,39 +186,13 @@ subroutine HydrologyNoDrainage(bounds, & soilhydrology_inst, waterstate_inst) end if - call SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, waterstate_inst) + call SurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & + soilhydrology_inst, soilstate_inst, waterflux_inst, waterstate_inst) - call saturated_excess_runoff_inst%SaturatedExcessRunoff(& - bounds, num_hydrologyc, filter_hydrologyc, col, & - soilhydrology_inst, soilstate_inst, waterflux_inst) - - call SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst, saturated_excess_runoff_inst, waterstate_inst) - - call infiltration_excess_runoff_inst%InfiltrationExcessRunoff( & - bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, saturated_excess_runoff_inst, waterflux_inst, & - waterstate_inst) - - call RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst, infiltration_excess_runoff_inst, soilhydrology_inst) - - call UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & - infiltration_excess_runoff_inst, & - energyflux_inst, soilhydrology_inst, & + call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& + energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & waterflux_inst, waterstate_inst) - call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst) - - call TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - waterflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, waterstate_inst) - - call UpdateUrbanPonding(bounds, num_urbanc, filter_urbanc, & - waterstate_inst, soilhydrology_inst, waterflux_inst) - call Compute_EffecRootFrac_And_VertTranSink(bounds, num_hydrologyc, & filter_hydrologyc, soilstate_inst, canopystate_inst, waterflux_inst, energyflux_inst) diff --git a/src/biogeophys/InfiltrationExcessRunoffMod.F90 b/src/biogeophys/InfiltrationExcessRunoffMod.F90 deleted file mode 100644 index 2f7563cec3..0000000000 --- a/src/biogeophys/InfiltrationExcessRunoffMod.F90 +++ /dev/null @@ -1,283 +0,0 @@ -module InfiltrationExcessRunoffMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Type and associated routines for computing infiltration excess runoff and related - ! variables - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, use_vichydro - use clm_varcon , only : spval, e_ice - use clm_time_manager , only : get_step_size - use SoilHydrologyType, only : soilhydrology_type - use SoilStateType , only : soilstate_type - use SaturatedExcessRunoffMod, only : saturated_excess_runoff_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - - implicit none - save - private - - ! !PUBLIC TYPES: - - type, public :: infiltration_excess_runoff_type - private - ! Public data members - ! Note: these should be treated as read-only by other modules - - ! These are valid within the hydrology filter. - ! - ! Both of these give averages over the entire column. However, qinmax is implicitly - ! 0 over the fraction of the column given by fsat, and qflx_infl_excess is - ! implicitly 0 over both fsat and frac_h2osfc. - real(r8), pointer, public :: qinmax_col(:) ! maximum infiltration rate (mm H2O /s) - real(r8), pointer, public :: qflx_infl_excess_col(:) ! infiltration excess runoff (mm H2O /s) - - ! Private data members - integer :: qinmax_method - contains - ! Public routines - procedure, public :: Init - - procedure, public :: InfiltrationExcessRunoff ! Calculate surface runoff due to infiltration excess - - ! Private routines - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - procedure, private, nopass :: ComputeQinmaxHksat - end type infiltration_excess_runoff_type - - ! !PRIVATE DATA MEMBERS: - - ! For methods that don't generate any infiltration excess runoff, we get this end result - ! by specifying a huge qinmax value - i.e., an effectively infinite max infiltration - ! rate. - ! - ! 1e200 mm H2O /s seems large enough to be effectively infinite, while not being so - ! large as to cause floating point overflows elsewhere. - real(r8), parameter :: qinmax_unlimited = 1.e200_r8 ! mm H2O /s - - ! The 'none' option avoids generating any infiltration excess runoff by setting qinmax - ! to a huge value - integer, parameter :: QINMAX_METHOD_NONE = 0 - integer, parameter :: QINMAX_METHOD_HKSAT = 1 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Infrastructure routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize this infiltration_excess_runoff_type object - ! - ! !ARGUMENTS: - class(infiltration_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Init' - !----------------------------------------------------------------------- - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate memory for this infiltration_excess_runoff_type object - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(infiltration_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - - character(len=*), parameter :: subname = 'InitAllocate' - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - allocate(this%qinmax_col (begc:endc)); this%qinmax_col (:) = nan - allocate(this%qflx_infl_excess_col(begc:endc)); this%qflx_infl_excess_col(:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize infiltration_excess_runoff_type history variables - ! - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(infiltration_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - ! Nothing to do for now - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !DESCRIPTION: - ! Perform cold-start initialization for infiltration_excess_runoff_type - ! - ! !ARGUMENTS: - class(infiltration_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - - ! TODO(wjs, 2017-08-14) We'll read qinmax_method from namelist. - if (use_vichydro) then - this%qinmax_method = QINMAX_METHOD_NONE - else - this%qinmax_method = QINMAX_METHOD_HKSAT - end if - - end subroutine InitCold - - ! ======================================================================== - ! Science routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine InfiltrationExcessRunoff(this, bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, saturated_excess_runoff_inst, waterflux_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Calculate surface runoff due to infiltration excess - ! - ! !ARGUMENTS: - class(infiltration_excess_runoff_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(waterstate_type) , intent(in) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: qinmax_on_unsaturated_area(bounds%begc:bounds%endc) ! maximum infiltration rate on the unsaturated fraction of the column (mm H2O /s) - - character(len=*), parameter :: subname = 'InfiltrationExcessRunoff' - !----------------------------------------------------------------------- - - associate( & - qinmax => this%qinmax_col , & ! Output: [real(r8) (:) ] maximum infiltration rate (mm H2O /s) - qflx_infl_excess => this%qflx_infl_excess_col , & ! Output: [real(r8) (:) ] infiltration excess runoff (mm H2O /s) - - fsat => saturated_excess_runoff_inst%fsat_col, & ! Input: [real(r8) (:) ] fractional area with water table at surface - - qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) - - frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - ) - - select case (this%qinmax_method) - case (QINMAX_METHOD_NONE) - ! NOTE(wjs, 2017-09-01) I'm putting this here for clarity, though it could be - ! moved to initialization for efficiency - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qinmax_on_unsaturated_area(c) = qinmax_unlimited - end do - case (QINMAX_METHOD_HKSAT) - call this%ComputeQinmaxHksat(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, & - qinmax_on_unsaturated_area = qinmax_on_unsaturated_area(bounds%begc:bounds%endc)) - case default - write(iulog,*) subname//' ERROR: Unrecognized qinmax_method: ', this%qinmax_method - call endrun(subname//' ERROR: Unrecognized qinmax_method') - end select - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qinmax(c) = (1._r8 - fsat(c)) * qinmax_on_unsaturated_area(c) - qflx_infl_excess(c) = max(0._r8, & - (qflx_in_soil(c) - (1.0_r8 - frac_h2osfc(c))*qinmax(c))) - end do - - end associate - - end subroutine InfiltrationExcessRunoff - - !----------------------------------------------------------------------- - subroutine ComputeQinmaxHksat(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, & - qinmax_on_unsaturated_area) - ! - ! !DESCRIPTION: - ! Compute qinmax using a parameterization based on hksat - ! - ! This is the CLM default parameterization - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(inout) :: qinmax_on_unsaturated_area( bounds%begc: ) ! maximum infiltration rate on the unsaturated fraction of the column (mm H2O /s) - ! - ! !LOCAL VARIABLES: - integer :: fc, c - - character(len=*), parameter :: subname = 'ComputeQinmaxHksat' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(qinmax_on_unsaturated_area) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - icefrac => soilhydrology_inst%icefrac_col , & ! Input: [real(r8) (:,:) ] fraction of ice - - hksat => soilstate_inst%hksat_col & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - ) - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qinmax_on_unsaturated_area(c) = minval(10._r8**(-e_ice*(icefrac(c,1:3)))*hksat(c,1:3)) - end do - - end associate - - end subroutine ComputeQinmaxHksat - -end module InfiltrationExcessRunoffMod diff --git a/src/biogeophys/LakeHydrologyMod.F90 b/src/biogeophys/LakeHydrologyMod.F90 index f88415636b..b7e91a4fc3 100644 --- a/src/biogeophys/LakeHydrologyMod.F90 +++ b/src/biogeophys/LakeHydrologyMod.F90 @@ -184,6 +184,7 @@ subroutine LakeHydrology(bounds, & qflx_snwcp_discarded_ice => waterflux_inst%qflx_snwcp_discarded_ice_col, & ! Input: [real(r8) (:) ] excess solid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! Input: [real(r8) (:) ] excess liquid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Output: [real(r8) (:) ] perched wt sub-surface runoff (mm H2O /s) !TODO - move this to somewhere else + qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Output: [real(r8) (:) ] drainage from snow pack qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! Output: [real(r8) (:) ] soil saturation excess [mm h2o/s] qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) @@ -192,7 +193,6 @@ subroutine LakeHydrology(bounds, & qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Output: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes qflx_runoff => waterflux_inst%qflx_runoff_col , & ! Output: [real(r8) (:) ] total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) qflx_ice_runoff_snwcp => waterflux_inst%qflx_ice_runoff_snwcp_col, & ! Output: [real(r8) (:)] solid runoff from snow capping (mm H2O /s) - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Output: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) eflx_snomelt => energyflux_inst%eflx_snomelt_col , & ! Output: [real(r8) (:) ] snow melt heat flux (W/m**2) @@ -639,6 +639,7 @@ subroutine LakeHydrology(bounds, & g = pgridcell(p) qflx_drain_perched(c) = 0._r8 + qflx_h2osfc_surf(c) = 0._r8 qflx_rsub_sat(c) = 0._r8 qflx_infl(c) = 0._r8 qflx_surf(c) = 0._r8 @@ -651,8 +652,7 @@ subroutine LakeHydrology(bounds, & (endwb(c)-begwb(c))/dtime + qflx_floodg(g) qflx_floodc(c) = qflx_floodg(g) qflx_runoff(c) = qflx_drain(c) + qflx_qrgwl(c) - qflx_rain_plus_snomelt(c) = qflx_prec_grnd_rain(p) + qflx_snow_drain(c) - qflx_top_soil(c) = qflx_rain_plus_snomelt(c) + qflx_top_soil(c) = qflx_prec_grnd_rain(p) + qflx_snow_drain(c) qflx_ice_runoff_snwcp(c) = qflx_snwcp_ice(c) enddo diff --git a/src/biogeophys/SaturatedExcessRunoffMod.F90 b/src/biogeophys/SaturatedExcessRunoffMod.F90 deleted file mode 100644 index 51f1c8369d..0000000000 --- a/src/biogeophys/SaturatedExcessRunoffMod.F90 +++ /dev/null @@ -1,375 +0,0 @@ -module SaturatedExcessRunoffMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Type and associated routines for calculating surface runoff due to saturated surface - ! - ! This also includes calculations of fsat (fraction of each column that is saturated) - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, use_vichydro - use clm_varcon , only : spval - use ColumnType , only : column_type - use SoilHydrologyType, only : soilhydrology_type - use SoilStateType, only : soilstate_type - use WaterfluxType, only : waterflux_type - - implicit none - save - private - - ! !PUBLIC TYPES: - - type, public :: saturated_excess_runoff_type - private - ! Public data members - ! Note: these should be treated as read-only by other modules - real(r8), pointer, public :: qflx_sat_excess_surf_col(:) ! surface runoff due to saturated surface (mm H2O /s) - real(r8), pointer, public :: fsat_col(:) ! fractional area with water table at surface - - ! Private data members - integer :: fsat_method - real(r8), pointer :: fcov_col(:) ! fractional impermeable area - contains - ! Public routines - procedure, public :: Init - - procedure, public :: SaturatedExcessRunoff ! Calculate surface runoff due to saturated surface - - ! Private routines - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - procedure, private, nopass :: ComputeFsatTopmodel - procedure, private, nopass :: ComputeFsatVic - end type saturated_excess_runoff_type - - ! !PRIVATE DATA MEMBERS: - - integer, parameter :: FSAT_METHOD_TOPMODEL = 1 - integer, parameter :: FSAT_METHOD_VIC = 2 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Infrastructure routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize this saturated_excess_runoff_type object - ! - ! !ARGUMENTS: - class(saturated_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Init' - !----------------------------------------------------------------------- - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate memory for this saturated_excess_runoff_type object - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(saturated_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - - character(len=*), parameter :: subname = 'InitAllocate' - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - - allocate(this%qflx_sat_excess_surf_col(begc:endc)) ; this%qflx_sat_excess_surf_col(:) = nan - allocate(this%fsat_col(begc:endc)) ; this%fsat_col(:) = nan - allocate(this%fcov_col(begc:endc)) ; this%fcov_col(:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize saturated_excess_runoff_type history variables - ! - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(saturated_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - - this%fcov_col(begc:endc) = spval - call hist_addfld1d (fname='FCOV', units='unitless', & - avgflag='A', long_name='fractional impermeable area', & - ptr_col=this%fcov_col, l2g_scale_type='veg') - - this%fsat_col(begc:endc) = spval - call hist_addfld1d (fname='FSAT', units='unitless', & - avgflag='A', long_name='fractional area with water table at surface', & - ptr_col=this%fsat_col, l2g_scale_type='veg') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !DESCRIPTION: - ! Perform cold-start initialization for saturated_excess_runoff_type - ! - ! !ARGUMENTS: - class(saturated_excess_runoff_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - - ! TODO(wjs, 2017-07-12) We'll read fsat_method from namelist. - if (use_vichydro) then - this%fsat_method = FSAT_METHOD_VIC - else - this%fsat_method = FSAT_METHOD_TOPMODEL - end if - - end subroutine InitCold - - ! ======================================================================== - ! Science routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine SaturatedExcessRunoff (this, bounds, num_hydrologyc, filter_hydrologyc, & - col, soilhydrology_inst, soilstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate surface runoff due to saturated surface - ! - ! !ARGUMENTS: - class(saturated_excess_runoff_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(column_type) , intent(in) :: col - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - - character(len=*), parameter :: subname = 'SaturatedExcessRunoff' - !----------------------------------------------------------------------- - - associate( & - fcov => this%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area - fsat => this%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface - qflx_sat_excess_surf => this%qflx_sat_excess_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) - - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) - - origflag => soilhydrology_inst%origflag , & ! Input: logical - fracice => soilhydrology_inst%fracice_col & ! Input: [real(r8) (:,:) ] fractional impermeability (-) - ) - - ! ------------------------------------------------------------------------ - ! Compute fsat - ! ------------------------------------------------------------------------ - - select case (this%fsat_method) - case (FSAT_METHOD_TOPMODEL) - call this%ComputeFsatTopmodel(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, & - fsat = fsat(bounds%begc:bounds%endc)) - case (FSAT_METHOD_VIC) - call this%ComputeFsatVic(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, & - fsat = fsat(bounds%begc:bounds%endc)) - case default - write(iulog,*) subname//' ERROR: Unrecognized fsat_method: ', this%fsat_method - call endrun(subname//' ERROR: Unrecognized fsat_method') - end select - - ! ------------------------------------------------------------------------ - ! Compute qflx_sat_excess_surf - ! - ! assume qinmax (maximum infiltration rate) is large relative to - ! qflx_rain_plus_snomelt in control - ! ------------------------------------------------------------------------ - - if (origflag == 1) then - if (this%fsat_method == FSAT_METHOD_VIC) then - ! NOTE(wjs, 2017-07-12) I'm not sure if it's the VIC fsat method per se that - ! is incompatible with origflag, or some other aspect of VIC: The original - ! check was for origflag == 1 and use_vichydro, which also appears in error - ! checks elsewhere. - call endrun(msg="VICHYDRO is not available for origflag=1"//errmsg(sourcefile, __LINE__)) - end if - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1) - qflx_sat_excess_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c) - end do - else - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! only send fast runoff directly to streams - qflx_sat_excess_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c) - - ! Set fcov just to have it on the history file - fcov(c) = fsat(c) - end do - end if - - ! ------------------------------------------------------------------------ - ! For urban columns, send flood water flux to runoff - ! ------------------------------------------------------------------------ - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (col%urbpoi(c)) then - ! send flood water flux to runoff for all urban columns - qflx_sat_excess_surf(c) = qflx_sat_excess_surf(c) + qflx_floodc(c) - end if - end do - - end associate - - end subroutine SaturatedExcessRunoff - - !----------------------------------------------------------------------- - subroutine ComputeFsatTopmodel(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, fsat) - ! - ! !DESCRIPTION: - ! Compute fsat using the TOPModel-based parameterization - ! - ! This is the CLM default parameterization - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(inout) :: fsat( bounds%begc: ) ! fractional area with water table at surface - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: fff ! decay factor (m-1) - - character(len=*), parameter :: subname = 'ComputeFsatTopmodel' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(fsat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - - wtfact => soilstate_inst%wtfact_col & ! Input: [real(r8) (:) ] maximum saturated fraction for a gridcell - ) - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - fff = 0.5_r8 - if (frost_table(c) > zwt_perched(c) .and. frost_table(c) <= zwt(c)) then - ! use perched water table to determine fsat (if present) - fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt_perched(c)) - else - fsat(c) = wtfact(c) * exp(-0.5_r8*fff*zwt(c)) - end if - end do - - end associate - - end subroutine ComputeFsatTopmodel - - !----------------------------------------------------------------------- - subroutine ComputeFsatVic(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, fsat) - ! - ! !DESCRIPTION: - ! Compute fsat using the VIC-based parameterization - ! - ! Citation: Wood et al. 1992, "A land-surface hydrology parameterization with subgrid - ! variability for general circulation models", JGR 97(D3), 2717-2728. - ! - ! This implementation gives a first-order approximation to saturated excess runoff. - ! For now we're not including the more exact analytical solution, or even a better - ! numerical approximation. - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer, intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - real(r8), intent(inout) :: fsat( bounds%begc: ) ! fractional area with water table at surface - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: ex(bounds%begc:bounds%endc) ! exponent - - character(len=*), parameter :: subname = 'ComputeFsatVic' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(fsat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter - top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Input: [real(r8) (:) ] maximum soil moisture in top VIC layers - top_moist_limited => soilhydrology_inst%top_moist_limited_col & ! Input: [real(r8) (:) ] soil moisture in top layers, limited to no greater than top_max_moist - ) - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ex(c) = b_infil(c) / (1._r8 + b_infil(c)) - ! fsat is equivalent to A in VIC papers - fsat(c) = 1._r8 - (1._r8 - top_moist_limited(c) / top_max_moist(c))**ex(c) - end do - - end associate - - end subroutine ComputeFsatVic - - -end module SaturatedExcessRunoffMod diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index ead283884d..15f3f57674 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -307,7 +307,7 @@ subroutine SnowWater(bounds, & qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Input: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] qflx_snow_drain => waterflux_inst%qflx_snow_drain_col,& ! Output: [real(r8) (:) ] net snow melt - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Output: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) + qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) mss_bcphi => aerosol_inst%mss_bcphi_col , & ! Output: [real(r8) (:,:) ] hydrophillic BC mass in snow (col,lyr) [kg] @@ -546,7 +546,7 @@ subroutine SnowWater(bounds, & ! Qout from snow bottom qflx_snow_drain(c) = qflx_snow_drain(c) + (qout(c) / dtime) - qflx_rain_plus_snomelt(c) = (qout(c) / dtime) & + qflx_top_soil(c) = (qout(c) / dtime) & + (1.0_r8 - frac_sno_eff(c)) * qflx_rain_grnd(c) int_snow(c) = int_snow(c) + frac_sno_eff(c) & * (qflx_dew_snow(c) + qflx_dew_grnd(c) + qflx_rain_grnd(c)) * dtime @@ -556,7 +556,7 @@ subroutine SnowWater(bounds, & c = filter_nosnowc(fc) qflx_snow_drain(c) = qflx_snomelt(c) - qflx_rain_plus_snomelt(c) = qflx_rain_grnd(c) + qflx_snomelt(c) + qflx_top_soil(c) = qflx_rain_grnd(c) + qflx_snomelt(c) ! reset accumulated snow when no snow present if (h2osno(c) <= 0._r8) then int_snow(c) = 0._r8 diff --git a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 index 75452af34e..101059da4e 100644 --- a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 +++ b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 @@ -170,6 +170,8 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) end do do c = bounds%begc, bounds%endc + soilhydrology_inst%max_infil_col(c) = spval + soilhydrology_inst%i_0_col(c) = spval do lev = 1, nlayer soilhydrology_inst%ice_col(c,lev) = spval soilhydrology_inst%moist_col(c,lev) = spval diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 4886d5e23e..7f9b4ed08a 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -4,25 +4,14 @@ module SoilHydrologyMod ! !DESCRIPTION: ! Calculate soil hydrology ! -#include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun use decompMod , only : bounds_type use clm_varctl , only : iulog, use_vichydro use clm_varcon , only : e_ice, denh2o, denice, rpi, aquifer_water_baseline - use clm_varcon , only : pondmx_urban - use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_imperv - use landunit_varcon , only : istsoil, istcrop - use clm_time_manager , only : get_step_size - use NumericsMod , only : truncate_small_values use EnergyFluxType , only : energyflux_type - use InfiltrationExcessRunoffMod, only : infiltration_excess_runoff_type use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type - use SaturatedExcessRunoffMod, only : saturated_excess_runoff_type use WaterfluxType , only : waterflux_type use WaterstateType , only : waterstate_type use TemperatureType , only : temperature_type @@ -36,12 +25,8 @@ module SoilHydrologyMod ! ! !PUBLIC MEMBER FUNCTIONS: public :: SoilHydReadNML ! Read in the Soil hydrology namelist - public :: SetSoilWaterFractions ! Set diagnostic variables related to the fraction of water and ice in each layer - public :: SetQflxInputs ! Set the flux of water into the soil from the top - public :: UpdateH2osfc ! Calculate fluxes out of h2osfc and update the h2osfc state - public :: Infiltration ! Calculate total infiltration - public :: TotalSurfaceRunoff ! Calculate total surface runoff - public :: UpdateUrbanPonding ! Update the state variable representing ponding on urban surfaces + public :: SurfaceRunoff ! Calculate surface runoff + public :: Infiltration ! Calculate infiltration into surface soil layer public :: WaterTable ! Calculate water table before imposing drainage public :: Drainage ! Calculate subsurface drainage public :: CLMVICMap @@ -51,10 +36,6 @@ module SoilHydrologyMod public :: LateralFlowPowerLaw ! Calculate lateral flow based on power law drainage function public :: RenewCondensation ! Misc. corrections - ! !PRIVATE MEMBER FUNCTIONS: - private :: QflxH2osfcSurf ! Compute qflx_h2osfc_surf - private :: QflxH2osfcDrain ! Compute qflx_h2osfc_drain - !----------------------------------------------------------------------- real(r8), private :: baseflow_scalar = 1.e-2_r8 @@ -76,6 +57,7 @@ subroutine soilHydReadNML( NLFilename ) use shr_mpi_mod , only : shr_mpi_bcast use clm_varctl , only : iulog use shr_log_mod , only : errMsg => shr_log_errMsg + use abortutils , only : endrun ! ! !ARGUMENTS: character(len=*), intent(in) :: NLFilename ! Namelist filename @@ -121,601 +103,468 @@ subroutine soilHydReadNML( NLFilename ) end subroutine soilhydReadNML !----------------------------------------------------------------------- - subroutine SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, soilstate_inst, waterstate_inst) + subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & + num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, waterflux_inst, & + waterstate_inst) ! ! !DESCRIPTION: - ! Set diagnostic variables related to the fraction of water and ice in each layer + ! Calculate surface runoff ! ! !USES: - use clm_varcon, only : denice + use clm_varcon , only : denice, denh2o, wimp, pondmx_urban + use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall + use column_varcon , only : icol_road_imperv, icol_road_perv + use clm_varpar , only : nlevsoi, maxpatch_pft + use clm_time_manager, only : get_step_size + use clm_varpar , only : nlayer, nlayert + use abortutils , only : endrun ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points + integer , intent(in) :: num_urbanc ! number of column urban points in column filter + integer , intent(in) :: filter_urbanc(:) ! column filter for urban points type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst + type(soilstate_type) , intent(in) :: soilstate_inst + type(waterflux_type) , intent(inout) :: waterflux_inst + type(waterstate_type) , intent(inout) :: waterstate_inst ! ! !LOCAL VARIABLES: - integer :: j, fc, c + integer :: c,j,fc,g,l,i !indices + real(r8) :: dtime !land model time step (sec) + real(r8) :: xs(bounds%begc:bounds%endc) !excess soil water above urban ponding limit real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) !partial volume of ice lens in layer - real(r8) :: icefrac_orig ! original formulation for icefrac - - character(len=*), parameter :: subname = 'SetSoilWaterFractions' + real(r8) :: fff(bounds%begc:bounds%endc) !decay factor (m-1) + real(r8) :: s1 !variable to calculate qinmax + real(r8) :: su !variable to calculate qinmax + real(r8) :: v !variable to calculate qinmax + real(r8) :: qinmax !maximum infiltration capacity (mm/s) + real(r8) :: A(bounds%begc:bounds%endc) !fraction of the saturated area + real(r8) :: ex(bounds%begc:bounds%endc) !temporary variable (exponent) + real(r8) :: top_moist(bounds%begc:bounds%endc) !temporary, soil moisture in top VIC layers + real(r8) :: top_max_moist(bounds%begc:bounds%endc) !temporary, maximum soil moisture in top VIC layers + real(r8) :: top_ice(bounds%begc:bounds%endc) !temporary, ice len in top VIC layers + character(len=32) :: subname = 'SurfaceRunoff' !subroutine name !----------------------------------------------------------------------- - associate( & + associate( & + snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Output: [real(r8) (:,:) ] effective porosity = porosity - vol_ice + sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + wtfact => soilstate_inst%wtfact_col , & ! Input: [real(r8) (:) ] maximum saturated fraction for a gridcell + hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) + bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - + h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) + + qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:) ] snow falling on surface water (mm/s) + qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM + qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] + qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) + qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) + + zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq, mm) + frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) + zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter + moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil moisture in each VIC layers (liq, mm) + hkdepth => soilhydrology_inst%hkdepth_col , & ! Input: [real(r8) (:) ] decay factor (m) origflag => soilhydrology_inst%origflag , & ! Input: logical + fcov => soilhydrology_inst%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area + fsat => soilhydrology_inst%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface + fracice => soilhydrology_inst%fracice_col , & ! Output: [real(r8) (:,:) ] fractional impermeability (-) icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ] - fracice => soilhydrology_inst%fracice_col & ! Output: [real(r8) (:,:) ] fractional impermeability (-) + ice => soilhydrology_inst%ice_col , & ! Output: [real(r8) (:,:) ] ice len in each VIC layers(ice, mm) + max_infil => soilhydrology_inst%max_infil_col , & ! Output: [real(r8) (:) ] maximum infiltration capacity in VIC (mm) + i_0 => soilhydrology_inst%i_0_col & ! Output: [real(r8) (:) ] column average soil moisture in top VIC layers (mm) ) - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer, - ! fractional impermeability - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity(c,j) = max(0.01_r8,watsat(c,j)-vol_ice(c,j)) - icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - - ! fracice is only used in code with origflag == 1. For this calculation, we use - ! the version of icefrac that was used in this original hydrology code. - if (h2osoi_ice(c,j) == 0._r8) then - ! Avoid possible divide by zero (in case h2osoi_liq(c,j) is also 0) - icefrac_orig = 0._r8 - else - icefrac_orig = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) - end if - fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac_orig))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) - end do - end do + ! Get time step + + dtime = get_step_size() + + do j = 1,nlevsoi + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + + ! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer, + ! fractional impermeability + + vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) + if (origflag == 1) then + icefrac(c,j) = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) + else + icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) + endif + + fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac(c,j)))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) + end do + end do + + ! Saturated fraction + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + fff(c) = 0.5_r8 + if (use_vichydro) then + top_moist(c) = 0._r8 + top_ice(c) = 0._r8 + top_max_moist(c) = 0._r8 + do j = 1, nlayer - 1 + top_ice(c) = top_ice(c) + ice(c,j) + top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) + top_max_moist(c) = top_max_moist(c) + max_moist(c,j) + end do + if(top_moist(c)> top_max_moist(c)) top_moist(c)= top_max_moist(c) + top_ice(c) = max(0._r8,top_ice(c)) + max_infil(c) = (1._r8+b_infil(c)) * top_max_moist(c) + ex(c) = b_infil(c) / (1._r8 + b_infil(c)) + A(c) = 1._r8 - (1._r8 - top_moist(c) / top_max_moist(c))**ex(c) + i_0(c) = max_infil(c) * (1._r8 - (1._r8 - A(c))**(1._r8/b_infil(c))) + fsat(c) = A(c) !for output + else + fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) + end if + + ! use perched water table to determine fsat (if present) + if ( frost_table(c) > zwt(c)) then + if (use_vichydro) then + fsat(c) = A(c) + else + fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) + end if + else + if ( frost_table(c) > zwt_perched(c)) then + fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt_perched(c))!*( frost_table(c) - zwt_perched(c))/4.0 + endif + endif + if (origflag == 1) then + if (use_vichydro) then + call endrun(msg="VICHYDRO is not available for origflag=1"//errmsg(sourcefile, __LINE__)) + else + fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1) + end if + else + fcov(c) = fsat(c) + endif + end do + + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + + ! assume qinmax large relative to qflx_top_soil in control + if (origflag == 1) then + qflx_surf(c) = fcov(c) * qflx_top_soil(c) + else + ! only send fast runoff directly to streams + qflx_surf(c) = fsat(c) * qflx_top_soil(c) + endif + end do + + ! Determine water in excess of ponding limit for urban roof and impervious road. + ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. + + do fc = 1, num_urbanc + c = filter_urbanc(fc) + if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then + + ! If there are snow layers then all qflx_top_soil goes to surface runoff + if (snl(c) < 0) then + qflx_surf(c) = max(0._r8,qflx_top_soil(c)) + else + xs(c) = max(0._r8, & + h2osoi_liq(c,1)/dtime + qflx_top_soil(c) - qflx_evap_grnd(c) - & + pondmx_urban/dtime) + if (xs(c) > 0.) then + h2osoi_liq(c,1) = pondmx_urban + else + h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & + (qflx_top_soil(c)-qflx_evap_grnd(c))*dtime) + end if + qflx_surf(c) = xs(c) + end if + else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then + qflx_surf(c) = 0._r8 + end if + ! send flood water flux to runoff for all urban columns + qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) + + end do + + ! remove stormflow and snow on h2osfc from qflx_top_soil + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + ! add flood water flux to qflx_top_soil + qflx_top_soil(c) = qflx_top_soil(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) + end do end associate - end subroutine SetSoilWaterFractions + end subroutine SurfaceRunoff !----------------------------------------------------------------------- - subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst, saturated_excess_runoff_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Set various input fluxes of water - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(waterflux_type) , intent(inout) :: waterflux_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst - type(waterstate_type) , intent(in) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: qflx_evap ! evaporation for this column - real(r8) :: fsno ! copy of frac_sno - - character(len=*), parameter :: subname = 'SetQflxInputs' - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:)] net water input into soil from top (mm/s) - qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Output: [real(r8) (:)] surface input to soil (mm/s) - qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col , & ! Output: [real(r8) (:)] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:)] rain plus snow melt falling on the soil (mm/s) - qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:)] snow falling on surface water (mm/s) - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:)] column flux of flood water from RTM - qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:)] evaporation flux from soil (W/m**2) [+ to atm] - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:)] ground surface evaporation rate (mm H2O/s) [+] - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:)] evaporation flux from h2osfc (W/m**2) [+ to atm] - - qflx_sat_excess_surf => saturated_excess_runoff_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) - - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - ) - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - qflx_top_soil(c) = qflx_rain_plus_snomelt(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) - - ! ------------------------------------------------------------------------ - ! Partition surface inputs between soil and h2osfc - ! ------------------------------------------------------------------------ - - if (snl(c) >= 0) then - fsno=0._r8 - ! if no snow layers, sublimation is removed from h2osoi_ice in drainage - qflx_evap=qflx_evap_grnd(c) - else - fsno=frac_sno(c) - qflx_evap=qflx_ev_soil(c) - endif - - qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) - qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_excess_surf(c)) - - ! remove evaporation (snow treated in SnowHydrology) - qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap - qflx_top_soil_to_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) - - end do - - end associate - - end subroutine SetQflxInputs - - !----------------------------------------------------------------------- - subroutine RouteInfiltrationExcess(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst, infiltration_excess_runoff_inst, soilhydrology_inst) - ! - ! !DESCRIPTION: - ! Route the infiltration excess runoff flux - ! - ! This adjusts infiltration, input to h2osfc, and the associated surface runoff flux. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(waterflux_type) , intent(inout) :: waterflux_inst - type(infiltration_excess_runoff_type), intent(in) :: infiltration_excess_runoff_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - - character(len=*), parameter :: subname = 'RouteInfiltrationExcess' - !----------------------------------------------------------------------- - - associate( & - qflx_in_soil_limited => waterflux_inst%qflx_in_soil_limited_col , & ! Output: [real(r8) (:) ] surface input to soil, limited by max infiltration rate (mm H2O /s) - qflx_in_h2osfc => waterflux_inst%qflx_in_h2osfc_col , & ! Output: [real(r8) (:) ] total surface input to h2osfc - qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) - qflx_in_soil => waterflux_inst%qflx_in_soil_col , & ! Input: [real(r8) (:) ] surface input to soil (mm/s) - qflx_top_soil_to_h2osfc => waterflux_inst%qflx_top_soil_to_h2osfc_col , & ! Input: [real(r8) (:) ] portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) - - qflx_infl_excess => infiltration_excess_runoff_inst%qflx_infl_excess_col , & ! Input: [real(r8) (:) ] infiltration excess runoff (mm H2O /s) - - h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: integer - ) - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then - qflx_in_soil_limited(c) = qflx_in_soil(c) - qflx_infl_excess(c) - if (h2osfcflag /= 0) then - qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) + qflx_infl_excess(c) - qflx_infl_excess_surf(c) = 0._r8 - else - ! No h2osfc pool, so qflx_infl_excess goes directly to surface runoff - qflx_in_h2osfc(c) = qflx_top_soil_to_h2osfc(c) - qflx_infl_excess_surf(c) = qflx_infl_excess(c) - end if - else - ! non-vegetated landunits (i.e. urban) use original CLM4 code - qflx_in_soil_limited(c) = qflx_in_soil(c) - qflx_in_h2osfc(c) = 0._r8 - qflx_infl_excess_surf(c) = 0._r8 - end if - end do - - end associate - - end subroutine RouteInfiltrationExcess - - !----------------------------------------------------------------------- - subroutine UpdateH2osfc(bounds, num_hydrologyc, filter_hydrologyc, & - infiltration_excess_runoff_inst, & - energyflux_inst, soilhydrology_inst, & + subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & + energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & waterflux_inst, waterstate_inst) ! ! !DESCRIPTION: - ! Calculate fluxes out of h2osfc and update the h2osfc state + ! Calculate infiltration into surface soil layer (minus the evaporation) ! ! !USES: use shr_const_mod , only : shr_const_pi - use clm_varcon , only : denh2o, denice, roverg, wimp, tfrz + use clm_varpar , only : nlayer, nlayert + use clm_varpar , only : nlevsoi + use clm_varcon , only : denh2o, denice, roverg, wimp, pc, mu, tfrz use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv + use landunit_varcon , only : istsoil, istcrop + use clm_time_manager , only : get_step_size ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(infiltration_excess_runoff_type), intent(in) :: infiltration_excess_runoff_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst + integer , intent(in) :: num_urbanc ! number of column urban points in column filter + integer , intent(in) :: filter_urbanc(:) ! column filter for urban points + type(energyflux_type) , intent(in) :: energyflux_inst + type(soilhydrology_type) , intent(inout) :: soilhydrology_inst + type(soilstate_type) , intent(inout) :: soilstate_inst + type(temperature_type) , intent(in) :: temperature_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst ! ! !LOCAL VARIABLES: - integer :: c,l,fc ! indices + integer :: c,j,l,fc ! indices real(r8) :: dtime ! land model time step (sec) - real(r8) :: h2osfc_partial(bounds%begc:bounds%endc) ! partially-updated h2osfc + real(r8) :: s1,su,v ! variable to calculate qinmax + real(r8) :: qinmax ! maximum infiltration capacity (mm/s) + real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) ! partial volume of ice lens in layer + real(r8) :: alpha_evap(bounds%begc:bounds%endc) ! fraction of total evap from h2osfc + real(r8) :: qflx_evap(bounds%begc:bounds%endc) ! local evaporation array + real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc + real(r8) :: qflx_in_h2osfc(bounds%begc:bounds%endc) ! surface input to h2osfc + real(r8) :: qflx_in_soil(bounds%begc:bounds%endc) ! surface input to soil + real(r8) :: qflx_infl_excess(bounds%begc:bounds%endc) ! infiltration excess runoff -> h2osfc + real(r8) :: frac_infclust ! fraction of submerged area that is connected + real(r8) :: fsno ! copy of frac_sno + real(r8) :: k_wet ! linear reservoir coefficient for h2osfc + real(r8) :: fac ! soil wetness of surface layer + real(r8) :: psit ! negative potential of soil + real(r8) :: hr ! relative humidity + real(r8) :: wx ! partial volume of ice and water of surface layer + real(r8) :: z_avg + real(r8) :: rho_avg + real(r8) :: fmelt + real(r8) :: f_sno + real(r8) :: imped + real(r8) :: d + real(r8) :: h2osoi_vol + real(r8) :: basis ! temporary, variable soil moisture holding capacity + ! in top VIC layers for runoff calculation + real(r8) :: rsurf_vic ! temp VIC surface runoff + real(r8) :: top_moist(bounds%begc:bounds%endc) ! temporary, soil moisture in top VIC layers + real(r8) :: top_max_moist(bounds%begc:bounds%endc) ! temporary, maximum soil moisture in top VIC layers + real(r8) :: top_ice(bounds%begc:bounds%endc) ! temporary, ice len in top VIC layers + real(r8) :: top_icefrac ! temporary, ice fraction in top VIC layers !----------------------------------------------------------------------- associate( & - qinmax => infiltration_excess_runoff_inst%qinmax_col , & ! Input: [real(r8) (:)] maximum infiltration rate (mm H2O /s) + snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) + + t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Input: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) + frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Output: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) + frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) + h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) - qflx_in_h2osfc => waterflux_inst%qflx_in_h2osfc_col , & ! Input: [real(r8) (:) ] total surface input to h2osfc - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) - qflx_h2osfc_drain => waterflux_inst%qflx_h2osfc_drain_col , & ! Output: [real(r8) (:) ] bottom drainage from h2osfc (mm H2O /s) + qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] + qflx_evap_soi => waterflux_inst%qflx_evap_soi_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] + qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] + qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Input: [real(r8) (:) ] net water input into soil from top (mm/s) + qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (mm H2O/s) [+ to atm] + qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) + qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm/s) + qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) + + smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) + sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" + hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) + eff_porosity => soilstate_inst%eff_porosity_col , & ! Output: [real(r8) (:,:) ] effective porosity = porosity - vol_ice h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" - h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: integer - ) - - dtime = get_step_size() - - call QflxH2osfcSurf(bounds, num_hydrologyc, filter_hydrologyc, & - h2osfcflag = h2osfcflag, & - h2osfc = h2osfc(bounds%begc:bounds%endc), & - h2osfc_thresh = h2osfc_thresh(bounds%begc:bounds%endc), & - frac_h2osfc_nosnow = frac_h2osfc_nosnow(bounds%begc:bounds%endc), & - topo_slope = col%topo_slope(bounds%begc:bounds%endc), & - qflx_h2osfc_surf = qflx_h2osfc_surf(bounds%begc:bounds%endc)) - - ! Update h2osfc prior to calculating bottom drainage from h2osfc. - ! - ! This could be removed if we wanted to do a straight forward Euler, and/or set - ! things up for a more sophisticated solution method. In the latter, rather than - ! having h2osfc_partial, we'd have some more sophisticated state estimate here - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - h2osfc_partial(c) = h2osfc(c) + (qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)) * dtime - end do - - call truncate_small_values(num_f = num_hydrologyc, filter_f = filter_hydrologyc, & - lb = bounds%begc, ub = bounds%endc, & - data_baseline = h2osfc(bounds%begc:bounds%endc), & - data = h2osfc_partial(bounds%begc:bounds%endc)) - - call QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & - h2osfcflag = h2osfcflag, & - h2osfc = h2osfc_partial(bounds%begc:bounds%endc), & - frac_h2osfc = frac_h2osfc(bounds%begc:bounds%endc), & - qinmax = qinmax(bounds%begc:bounds%endc), & - qflx_h2osfc_drain = qflx_h2osfc_drain(bounds%begc:bounds%endc)) - - ! Update h2osfc based on fluxes - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - h2osfc(c) = h2osfc_partial(c) - qflx_h2osfc_drain(c) * dtime - end do - - ! Due to rounding errors, fluxes that should have brought h2osfc to exactly 0 may - ! have instead left it slightly less than or slightly greater than 0. Correct for - ! that here. - call truncate_small_values(num_f = num_hydrologyc, filter_f = filter_hydrologyc, & - lb = bounds%begc, ub = bounds%endc, & - data_baseline = h2osfc_partial(bounds%begc:bounds%endc), & - data = h2osfc(bounds%begc:bounds%endc)) - - end associate - - end subroutine UpdateH2osfc - - !----------------------------------------------------------------------- - subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, & - waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate total infiltration - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - - character(len=*), parameter :: subname = 'Infiltration' - !----------------------------------------------------------------------- - - associate( & - qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) - qflx_in_soil_limited => waterflux_inst%qflx_in_soil_limited_col , & ! Input: [real(r8) (:) ] surface input to soil, limited by max infiltration rate (mm H2O /s) - qflx_h2osfc_drain => waterflux_inst%qflx_h2osfc_drain_col & ! Input: [real(r8) (:) ] bottom drainage from h2osfc (mm H2O /s) + zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + fcov => soilhydrology_inst%fcov_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter + frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) + fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil moisture in each VIC layers (liq, mm) + max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq, mm) + max_infil => soilhydrology_inst%max_infil_col , & ! Input: [real(r8) (:) ] maximum infiltration capacity in VIC (mm) + ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] ice len in each VIC layers(ice, mm) + i_0 => soilhydrology_inst%i_0_col , & ! Input: [real(r8) (:) ] column average soil moisture in top VIC layers (mm) + h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical + icefrac => soilhydrology_inst%icefrac_col & ! Output: [real(r8) (:,:) ] fraction of ice ) - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qflx_infl(c) = qflx_in_soil_limited(c) + qflx_h2osfc_drain(c) - end do - - end associate - - end subroutine Infiltration - - !----------------------------------------------------------------------- - subroutine QflxH2osfcSurf(bounds, num_hydrologyc, filter_hydrologyc, & - h2osfcflag, h2osfc, h2osfc_thresh, frac_h2osfc_nosnow, topo_slope, & - qflx_h2osfc_surf) - ! - ! !DESCRIPTION: - ! Compute qflx_h2osfc_surf - ! - ! !USES: - use clm_varcon, only : pc, mu - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: h2osfcflag ! true => surface water is active - real(r8) , intent(in) :: h2osfc( bounds%begc: ) ! surface water (mm) - real(r8) , intent(in) :: h2osfc_thresh( bounds%begc: ) ! level at which h2osfc "percolates" - real(r8) , intent(in) :: frac_h2osfc_nosnow( bounds%begc: ) ! fractional area with surface water greater than zero (if no snow present) - real(r8) , intent(in) :: topo_slope( bounds%begc: ) ! topographic slope - real(r8) , intent(inout) :: qflx_h2osfc_surf( bounds%begc: ) ! surface water runoff (mm H2O /s) - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: dtime ! land model time step (sec) - real(r8) :: frac_infclust ! fraction of submerged area that is connected - real(r8) :: k_wet ! linear reservoir coefficient for h2osfc - - character(len=*), parameter :: subname = 'QflxH2osfcSurf' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osfc_thresh) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_h2osfc_nosnow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(topo_slope) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qflx_h2osfc_surf) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - dtime = get_step_size() - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - if (h2osfcflag==1) then - if (frac_h2osfc_nosnow(c) <= pc) then - frac_infclust=0.0_r8 - else - frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu - endif - endif - - ! limit runoff to value of storage above S(pc) - if(h2osfc(c) > h2osfc_thresh(c) .and. h2osfcflag/=0) then - ! spatially variable k_wet - k_wet=1.0e-4_r8 * sin((rpi/180.) * topo_slope(c)) - qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c)) - - qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime) - else - qflx_h2osfc_surf(c)= 0._r8 - endif - - ! cutoff lower limit - if ( qflx_h2osfc_surf(c) < 1.0e-8) then - qflx_h2osfc_surf(c) = 0._r8 - end if - - end do - - end subroutine QflxH2osfcSurf - - !----------------------------------------------------------------------- - subroutine QflxH2osfcDrain(bounds, num_hydrologyc, filter_hydrologyc, & - h2osfcflag, h2osfc, frac_h2osfc, qinmax, & - qflx_h2osfc_drain) - ! - ! !DESCRIPTION: - ! Compute qflx_h2osfc_drain - ! - ! Note that, if h2osfc is negative, then qflx_h2osfc_drain will be negative - acting - ! to exactly restore h2osfc to 0. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: h2osfcflag ! true => surface water is active - real(r8) , intent(in) :: h2osfc( bounds%begc: ) ! surface water (mm) - real(r8) , intent(in) :: frac_h2osfc( bounds%begc: ) ! fraction of ground covered by surface water (0 to 1) - real(r8) , intent(in) :: qinmax( bounds%begc: ) ! maximum infiltration rate (mm H2O /s) - real(r8) , intent(inout) :: qflx_h2osfc_drain( bounds%begc: ) ! bottom drainage from h2osfc (mm H2O /s) - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: dtime ! land model time step (sec) - - character(len=*), parameter :: subname = 'QflxH2osfcDrain' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qinmax) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qflx_h2osfc_drain) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - dtime = get_step_size() - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - if (h2osfc(c) < 0.0) then - qflx_h2osfc_drain(c) = h2osfc(c)/dtime - else - qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax(c),h2osfc(c)/dtime) - if(h2osfcflag==0) then - ! ensure no h2osfc - qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) - end if - end if - end do - - end subroutine QflxH2osfcDrain - - - !----------------------------------------------------------------------- - subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - waterflux_inst, soilhydrology_inst, saturated_excess_runoff_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Calculate total surface runoff - ! - ! For hydrologically-active columns, this is the sum of some already-computed terms - ! - ! In addition, computes total surface runoff for non-hydrologically-active urban - ! columns - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(saturated_excess_runoff_type), intent(in) :: saturated_excess_runoff_inst - type(waterstate_type), intent(in) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: dtime ! land model time step (sec) - - character(len=*), parameter :: subname = 'TotalSurfaceRunoff' - !----------------------------------------------------------------------- + dtime = get_step_size() - associate( & - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + ! Infiltration into surface soil layer (minus the evaporation) + do j = 1,nlevsoi + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + ! Porosity of soil, partial volume of ice and liquid + vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) + eff_porosity(c,j) = max(0.01_r8,watsat(c,j)-vol_ice(c,j)) + icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) + end do + end do - qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] total surface runoff (mm H2O /s) - qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s) - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col, & ! Input: [real(r8) (:) ] surface water runoff (mm H2O /s) - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + ! partition moisture fluxes between soil and h2osfc + if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then + + ! explicitly use frac_sno=0 if snl=0 + if (snl(c) >= 0) then + fsno=0._r8 + ! if no snow layers, sublimation is removed from h2osoi_ice in drainage + qflx_evap(c)=qflx_evap_grnd(c) + else + fsno=frac_sno(c) + qflx_evap(c)=qflx_ev_soil(c) + endif - xs_urban => soilhydrology_inst%xs_urban_col , & ! Output: [real(r8) (:) ] excess soil water above urban ponding limit + !1. partition surface inputs between soil and h2osfc + qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_surf(c)) + qflx_in_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_surf(c)) - qflx_sat_excess_surf => saturated_excess_runoff_inst%qflx_sat_excess_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s) + !2. remove evaporation (snow treated in SnowHydrology) + qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) + qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) - h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - ) + !3. determine maximum infiltration rate + if (use_vichydro) then + top_moist(c)= 0._r8 + top_ice(c)=0._r8 + top_max_moist(c)= 0._r8 + do j = 1, nlayer - 1 + top_ice(c) = top_ice(c) + ice(c,j) + top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) + top_max_moist(c) = top_max_moist(c) + max_moist(c,j) + end do + top_icefrac = min(1._r8,top_ice(c)/top_max_moist(c)) + if(qflx_in_soil(c) <= 0._r8) then + rsurf_vic = 0._r8 + else if(max_infil(c) <= 0._r8) then + rsurf_vic = qflx_in_soil(c) + else if((i_0(c) + qflx_in_soil(c)*dtime) > max_infil(c)) then !(Eq.(3a) Wood et al. 1992) + rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c))/dtime + else !(Eq.(3b) Wood et al. 1992) + basis = 1._r8 - (i_0(c) + qflx_in_soil(c)*dtime)/max_infil(c) + rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c) & + + top_max_moist(c) * basis**(1._r8 + b_infil(c)))/dtime + end if + rsurf_vic = min(qflx_in_soil(c), rsurf_vic) + qinmax = (1._r8 - fsat(c)) * 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) + else + qinmax=(1._r8 - fsat(c)) * minval(10._r8**(-e_ice*(icefrac(c,1:3)))*hksat(c,1:3)) + end if + qflx_infl_excess(c) = max(0._r8,qflx_in_soil(c) - (1.0_r8 - frac_h2osfc(c))*qinmax) - dtime = get_step_size() + !4. soil infiltration and h2osfc "run-on" + qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) + qflx_in_h2osfc(c) = qflx_in_h2osfc(c) + qflx_infl_excess(c) - ! ------------------------------------------------------------------------ - ! Set qflx_surf for hydrologically-active columns - ! ------------------------------------------------------------------------ + !5. surface runoff from h2osfc + if (h2osfcflag==1) then + ! calculate runoff from h2osfc ------------------------------------- + if (frac_h2osfc_nosnow(c) <= pc) then + frac_infclust=0.0_r8 + else + frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu + endif + endif - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! Depending on whether h2osfcflag is 0 or 1, one of qflx_infl_excess or - ! qflx_h2osfc_surf will always be 0. But it's safe to just add them both. - qflx_surf(c) = qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c) - end do + ! limit runoff to value of storage above S(pc) + if(h2osfc(c) >= h2osfc_thresh(c) .and. h2osfcflag/=0) then + ! spatially variable k_wet + k_wet=1.0e-4_r8 * sin((rpi/180.) * col%topo_slope(c)) + qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c)) - ! ------------------------------------------------------------------------ - ! Set qflx_surf for non-hydrologically-active urban columns - ! - ! Determine water in excess of ponding limit for urban roof and impervious road. - ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. - ! ------------------------------------------------------------------------ - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - ! If there are snow layers then all qflx_rain_plus_snomelt goes to surface runoff - if (snl(c) < 0) then - qflx_surf(c) = max(0._r8,qflx_rain_plus_snomelt(c)) - else - ! NOTE(wjs, 2017-07-11) It looks to me like this use of xs_urban and - ! h2osoi_liq(c,1) are roughly analogous to h2osfc in hydrologically-active - ! columns. Why not use h2osfc for urban columns, too? - xs_urban(c) = max(0._r8, & - h2osoi_liq(c,1)/dtime + qflx_rain_plus_snomelt(c) - qflx_evap_grnd(c) - & - pondmx_urban/dtime) - qflx_surf(c) = xs_urban(c) - end if - ! send flood water flux to runoff for all urban columns - qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - qflx_surf(c) = 0._r8 - end if - end do + qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime) + else + qflx_h2osfc_surf(c)= 0._r8 + endif - end associate + ! cutoff lower limit + if ( qflx_h2osfc_surf(c) < 1.0e-8) qflx_h2osfc_surf(c) = 0._r8 - end subroutine TotalSurfaceRunoff + ! use this for non-h2osfc code + if(h2osfcflag==0) then + qflx_h2osfc_surf(c)= 0._r8 + ! shift infiltration excess from h2osfc input to surface runoff + qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_infl_excess(c) + qflx_surf(c)= qflx_surf(c) + qflx_infl_excess(c) + qflx_infl_excess(c) = 0._r8 + endif - !----------------------------------------------------------------------- - subroutine UpdateUrbanPonding(bounds, num_urbanc, filter_urbanc, & - waterstate_inst, soilhydrology_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Update the state variable representing ponding on urban surfaces - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(waterstate_type) , intent(inout) :: waterstate_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterflux_type) , intent(in) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - real(r8) :: dtime ! land model time step (sec) + qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_h2osfc_surf(c) - character(len=*), parameter :: subname = 'UpdateUrbanPonding' - !----------------------------------------------------------------------- + !6. update h2osfc prior to calculating bottom drainage from h2osfc + h2osfc(c) = h2osfc(c) + qflx_in_h2osfc(c) * dtime - associate( & - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers + !-- if all water evaporates, there will be no bottom drainage + if (h2osfc(c) < 0.0) then + qflx_infl(c) = qflx_infl(c) + h2osfc(c)/dtime + h2osfc(c) = 0.0 + qflx_h2osfc_drain(c)= 0._r8 + else + qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax,h2osfc(c)/dtime) + endif - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) + if(h2osfcflag==0) then + qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) !ensure no h2osfc + endif - xs_urban => soilhydrology_inst%xs_urban_col , & ! Input: [real(r8) (:) ] excess soil water above urban ponding limit + !7. remove drainage from h2osfc and add to qflx_infl + h2osfc(c) = h2osfc(c) - qflx_h2osfc_drain(c) * dtime + qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) + else + ! non-vegetated landunits (i.e. urban) use original CLM4 code + if (snl(c) >= 0) then + ! when no snow present, sublimation is removed in Drainage + qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) - qflx_evap_grnd(c) + else + qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) & + - (1.0_r8 - frac_sno(c)) * qflx_ev_soil(c) + end if + qflx_h2osfc_surf(c) = 0._r8 + endif - qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s) - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - ) + enddo - dtime = get_step_size() - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - if (snl(c) >= 0) then - if (xs_urban(c) > 0.) then - h2osoi_liq(c,1) = pondmx_urban - else - h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & - (qflx_rain_plus_snomelt(c)-qflx_evap_grnd(c))*dtime) - end if - end if - end if - end do + ! No infiltration for impervious urban surfaces - end associate + do fc = 1, num_urbanc + c = filter_urbanc(fc) + if (col%itype(c) /= icol_road_perv) then + qflx_infl(c) = 0._r8 + end if + end do + + end associate - end subroutine UpdateUrbanPonding + end subroutine Infiltration !----------------------------------------------------------------------- subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & @@ -725,7 +574,9 @@ subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, fil ! Calculate watertable, considering aquifer recharge but no drainage. ! ! !USES: + use clm_time_manager , only : get_step_size use clm_varcon , only : pondmx, tfrz, watmin,denice,denh2o + use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: @@ -748,6 +599,7 @@ subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, fil integer :: jwt(bounds%begc:bounds%endc) ! index of the soil layer right above the water table (-) real(r8) :: rsub_bot(bounds%begc:bounds%endc) ! subsurface runoff - bottom drainage (mm/s) real(r8) :: rsub_top(bounds%begc:bounds%endc) ! subsurface runoff - topographic control (mm/s) + real(r8) :: fff(bounds%begc:bounds%endc) ! decay factor (m-1) real(r8) :: xsi(bounds%begc:bounds%endc) ! excess soil water above saturation at layer i (mm) real(r8) :: rous ! aquifer yield (-) real(r8) :: wh ! smpfz(jwt)-z(jwt) (mm) @@ -757,6 +609,7 @@ subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, fil real(r8) :: icefracsum ! summation of icefrac*dzmm of layers below water table (-) real(r8) :: fracice_rsub(bounds%begc:bounds%endc) ! fractional impermeability of soil layers (-) real(r8) :: ka ! hydraulic conductivity of the aquifer (mm/s) + real(r8) :: dza ! fff*(zwt-z(jwt)) (-) real(r8) :: available_h2osoi_liq ! available soil liquid water in a layer real(r8) :: imped real(r8) :: rsub_top_tot @@ -1031,8 +884,11 @@ subroutine Drainage(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filte ! Calculate subsurface drainage ! ! !USES: + use clm_time_manager , only : get_step_size + use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv + use abortutils , only : endrun ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -1131,7 +987,7 @@ subroutine Drainage(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filte ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) origflag => soilhydrology_inst%origflag , & ! Input: logical - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: integer + h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Output: [real(r8) (:) ] excess liquid h2o due to snow capping (outgoing) (mm H2O /s) [+] qflx_ice_runoff_xs => waterflux_inst%qflx_ice_runoff_xs_col , & ! Output: [real(r8) (:) ] solid runoff from excess ice in soil (mm H2O /s) [+] @@ -1604,6 +1460,7 @@ subroutine CLMVICMap(bounds, numf, filter, & ! ! !USES: use clm_varcon , only : denh2o, denice, watmin + use clm_varpar , only : nlevsoi, nlayer, nlayert, nlevgrnd use decompMod , only : bounds_type ! ! !REVISION HISTORY: @@ -1640,11 +1497,7 @@ subroutine CLMVICMap(bounds, numf, filter, & vic_clm_fract => soilhydrology_inst%vic_clm_fract_col , & ! Input: [real(r8) (:,:,:) ] fraction of VIC layers in each CLM layer moist => soilhydrology_inst%moist_col , & ! Output: [real(r8) (:,:) ] liquid water (mm) ice => soilhydrology_inst%ice_col , & ! Output: [real(r8) (:,:) ] ice lens (mm) - moist_vol => soilhydrology_inst%moist_vol_col , & ! Output: [real(r8) (:,:) ] volumetric soil moisture for VIC soil layers - top_moist => soilhydrology_inst%top_moist_col , & ! Output: [real(r8) (:) ] soil moisture in top VIC layers - top_max_moist => soilhydrology_inst%top_max_moist_col, & ! Output: [real(r8) (:) ] maximum soil moisture in top VIC layers - top_ice => soilhydrology_inst%top_ice_col , & ! Output: [real(r8) (:) ] ice len in top VIC layers - top_moist_limited => soilhydrology_inst%top_moist_limited_col & ! Output: [real(r8) (:) ] soil moisture in top layers, limited to no greater than top_max_moist + moist_vol => soilhydrology_inst%moist_vol_col & ! Output: [real(r8) (:,:) ] volumetric soil moisture for VIC soil layers ) ! map CLM to VIC @@ -1674,29 +1527,6 @@ subroutine CLMVICMap(bounds, numf, filter, & moist_vol(c, nlayer+1:nlayert) = h2osoi_vol(c, nlevsoi+1:nlevgrnd) end do - ! Set values related to top VIC layers - - do fc = 1, numf - c = filter(fc) - top_moist(c) = 0._r8 - top_ice(c) = 0._r8 - top_max_moist(c) = 0._r8 - end do - - do j = 1, nlayer - 1 - do fc = 1, numf - c = filter(fc) - top_ice(c) = top_ice(c) + ice(c,j) - top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) - top_max_moist(c) = top_max_moist(c) + max_moist(c,j) - end do - end do - - do fc = 1, numf - c = filter(fc) - top_moist_limited(c) = min(top_moist(c), top_max_moist(c)) - end do - end associate end subroutine CLMVICMap @@ -1712,6 +1542,7 @@ subroutine PerchedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use clm_varcon , only : pondmx, tfrz, watmin,denice,denh2o + use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: @@ -1833,8 +1664,11 @@ subroutine PerchedLateralFlow(bounds, num_hydrologyc, filter_hydrologyc, & ! Calculate subsurface drainage from perched saturated zone ! ! !USES: + use clm_time_manager , only : get_step_size + use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv + use abortutils , only : endrun ! ! !ARGUMENTS: @@ -1994,6 +1828,7 @@ subroutine ThetaBasedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & ! ! !USES: use clm_varcon , only : denice,denh2o + use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: @@ -2090,8 +1925,11 @@ subroutine LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & ! Calculate subsurface drainage ! ! !USES: + use clm_time_manager , only : get_step_size + use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert use clm_varcon , only : pondmx, watmin,rpi, secspday, nlvic use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv + use abortutils , only : endrun use GridcellType , only : grc ! @@ -2177,7 +2015,7 @@ subroutine LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) origflag => soilhydrology_inst%origflag , & ! Input: logical - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: integer + h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Output: [real(r8) (:) ] excess rainfall due to snow capping (mm H2O /s) [+] qflx_ice_runoff_xs => waterflux_inst%qflx_ice_runoff_xs_col , & ! Output: [real(r8) (:) ] solid runoff from excess ice in soil (mm H2O /s) [+] @@ -2417,6 +2255,8 @@ subroutine RenewCondensation(bounds, num_hydrologyc, filter_hydrologyc, & ! Calculate watertable, considering aquifer recharge but no drainage. ! ! !USES: + use clm_time_manager , only : get_step_size + use clm_varpar , only : nlevsoi use column_varcon , only : icol_roof, icol_road_imperv ! ! !ARGUMENTS: diff --git a/src/biogeophys/SoilHydrologyType.F90 b/src/biogeophys/SoilHydrologyType.F90 index 8c99e8d750..33aee7efda 100644 --- a/src/biogeophys/SoilHydrologyType.F90 +++ b/src/biogeophys/SoilHydrologyType.F90 @@ -29,8 +29,9 @@ Module SoilHydrologyType real(r8), pointer :: qcharge_col (:) ! col aquifer recharge rate (mm/s) real(r8), pointer :: fracice_col (:,:) ! col fractional impermeability (-) real(r8), pointer :: icefrac_col (:,:) ! col fraction of ice + real(r8), pointer :: fcov_col (:) ! col fractional impermeable area + real(r8), pointer :: fsat_col (:) ! col fractional area with water table at surface real(r8), pointer :: h2osfc_thresh_col (:) ! col level at which h2osfc "percolates" (time constant) - real(r8), pointer :: xs_urban_col (:) ! col excess soil water above urban ponding limit ! VIC real(r8), pointer :: hkdepth_col (:) ! col VIC decay factor (m) (time constant) @@ -48,10 +49,8 @@ Module SoilHydrologyType real(r8), pointer :: moist_col (:,:) ! col VIC soil moisture (kg/m2) for VIC soil layers real(r8), pointer :: moist_vol_col (:,:) ! col VIC volumetric soil moisture for VIC soil layers real(r8), pointer :: max_moist_col (:,:) ! col VIC max layer moist + ice (mm) - real(r8), pointer :: top_moist_col (:) ! col VIC soil moisture in top layers - real(r8), pointer :: top_max_moist_col (:) ! col VIC maximum soil moisture in top layers - real(r8), pointer :: top_ice_col (:) ! col VIC ice len in top layers - real(r8), pointer :: top_moist_limited_col(:) ! col VIC soil moisture in top layers, limited to no greater than top_max_moist_col + real(r8), pointer :: max_infil_col (:) ! col VIC maximum infiltration rate calculated in VIC + real(r8), pointer :: i_0_col (:) ! col VIC average saturation in top soil layers real(r8), pointer :: ice_col (:,:) ! col VIC soil ice (kg/m2) for VIC soil layers contains @@ -121,8 +120,9 @@ subroutine InitAllocate(this, bounds) allocate(this%qcharge_col (begc:endc)) ; this%qcharge_col (:) = nan allocate(this%fracice_col (begc:endc,nlevgrnd)) ; this%fracice_col (:,:) = nan allocate(this%icefrac_col (begc:endc,nlevgrnd)) ; this%icefrac_col (:,:) = nan + allocate(this%fcov_col (begc:endc)) ; this%fcov_col (:) = nan + allocate(this%fsat_col (begc:endc)) ; this%fsat_col (:) = nan allocate(this%h2osfc_thresh_col (begc:endc)) ; this%h2osfc_thresh_col (:) = nan - allocate(this%xs_urban_col (begc:endc)) ; this%xs_urban_col (:) = nan allocate(this%hkdepth_col (begc:endc)) ; this%hkdepth_col (:) = nan allocate(this%b_infil_col (begc:endc)) ; this%b_infil_col (:) = nan @@ -139,10 +139,8 @@ subroutine InitAllocate(this, bounds) allocate(this%moist_col (begc:endc,nlayert)) ; this%moist_col (:,:) = nan allocate(this%moist_vol_col (begc:endc,nlayert)) ; this%moist_vol_col (:,:) = nan allocate(this%max_moist_col (begc:endc,nlayer)) ; this%max_moist_col (:,:) = nan - allocate(this%top_moist_col (begc:endc)) ; this%top_moist_col (:) = nan - allocate(this%top_max_moist_col (begc:endc)) ; this%top_max_moist_col (:) = nan - allocate(this%top_ice_col (begc:endc)) ; this%top_ice_col (:) = nan - allocate(this%top_moist_limited_col(begc:endc)) ; this%top_moist_limited_col(:) = nan + allocate(this%max_infil_col (begc:endc)) ; this%max_infil_col (:) = nan + allocate(this%i_0_col (begc:endc)) ; this%i_0_col (:) = nan allocate(this%ice_col (begc:endc,nlayert)) ; this%ice_col (:,:) = nan end subroutine InitAllocate @@ -175,6 +173,16 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='aquifer recharge rate (vegetated landunits only)', & ptr_col=this%qcharge_col, l2g_scale_type='veg') + this%fcov_col(begc:endc) = spval + call hist_addfld1d (fname='FCOV', units='unitless', & + avgflag='A', long_name='fractional impermeable area', & + ptr_col=this%fcov_col, l2g_scale_type='veg') + + this%fsat_col(begc:endc) = spval + call hist_addfld1d (fname='FSAT', units='unitless', & + avgflag='A', long_name='fractional area with water table at surface', & + ptr_col=this%fsat_col, l2g_scale_type='veg') + this%num_substeps_col(begc:endc) = spval call hist_addfld1d (fname='NSUBSTEPS', units='unitless', & avgflag='A', long_name='number of adaptive timesteps in CLM timestep', & diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index f2217d36a3..96e8c92a09 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -73,18 +73,11 @@ module WaterfluxType real(r8), pointer :: qflx_adv_col (:,:) ! col advective flux across different soil layer interfaces [mm H2O/s] [+ downward] real(r8), pointer :: qflx_rootsoi_col (:,:) ! col root and soil water exchange [mm H2O/s] [+ into root] real(r8), pointer :: qflx_infl_col (:) ! col infiltration (mm H2O /s) - real(r8), pointer :: qflx_infl_excess_surf_col(:) ! col surface runoff due to infiltration excess (mm H2O /s) - real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff (mm H2O /s) - real(r8), pointer :: qflx_surf_col (:) ! col total surface runoff (mm H2O /s) + real(r8), pointer :: qflx_surf_col (:) ! col surface runoff (mm H2O /s) real(r8), pointer :: qflx_drain_col (:) ! col sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_rain_plus_snomelt_col(:) ! col rain plus snow melt falling on the soil (mm/s) real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) - real(r8), pointer :: qflx_in_soil_col (:) ! col surface input to soil (mm/s) - real(r8), pointer :: qflx_in_soil_limited_col (:) ! col surface input to soil, limited by max infiltration rate (mm/s) - real(r8), pointer :: qflx_h2osfc_drain_col (:) ! col bottom drainage from h2osfc (mm/s) - real(r8), pointer :: qflx_top_soil_to_h2osfc_col(:) ! col portion of qflx_top_soil going to h2osfc, minus evaporation (mm/s) - real(r8), pointer :: qflx_in_h2osfc_col(:) ! col total surface input to h2osfc real(r8), pointer :: qflx_h2osfc_to_ice_col (:) ! col conversion of h2osfc to ice + real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff real(r8), pointer :: qflx_snow_h2osfc_col (:) ! col snow falling on surface water real(r8), pointer :: qflx_drain_perched_col (:) ! col sub-surface runoff from perched wt (mm H2O /s) real(r8), pointer :: qflx_deficit_col (:) ! col water deficit to keep non-negative liquid water content (mm H2O) @@ -223,15 +216,8 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_infl_col (begc:endc)) ; this%qflx_infl_col (:) = nan allocate(this%qflx_surf_col (begc:endc)) ; this%qflx_surf_col (:) = nan allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan - allocate(this%qflx_rain_plus_snomelt_col(begc:endc)) ; this%qflx_rain_plus_snomelt_col(:) = nan allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan - allocate(this%qflx_in_soil_col (begc:endc)) ; this%qflx_in_soil_col (:) = nan - allocate(this%qflx_in_soil_limited_col (begc:endc)) ; this%qflx_in_soil_limited_col (:) = nan - allocate(this%qflx_h2osfc_drain_col (begc:endc)) ; this%qflx_h2osfc_drain_col (:) = nan - allocate(this%qflx_top_soil_to_h2osfc_col(begc:endc)) ; this%qflx_top_soil_to_h2osfc_col(:) = nan - allocate(this%qflx_in_h2osfc_col (begc:endc)) ; this%qflx_in_h2osfc_col(:) = nan allocate(this%qflx_h2osfc_to_ice_col (begc:endc)) ; this%qflx_h2osfc_to_ice_col (:) = nan - allocate(this%qflx_infl_excess_surf_col(begc:endc)) ; this%qflx_infl_excess_surf_col(:) = nan allocate(this%qflx_h2osfc_surf_col (begc:endc)) ; this%qflx_h2osfc_surf_col (:) = nan allocate(this%qflx_snow_h2osfc_col (begc:endc)) ; this%qflx_snow_h2osfc_col (:) = nan allocate(this%qflx_snomelt_col (begc:endc)) ; this%qflx_snomelt_col (:) = nan @@ -304,7 +290,7 @@ subroutine InitHistory(this, bounds) this%qflx_surf_col(begc:endc) = spval call hist_addfld1d (fname='QOVER', units='mm/s', & - avgflag='A', long_name='total surface runoff (includes QH2OSFC)', & + avgflag='A', long_name='surface runoff', & ptr_col=this%qflx_surf_col, c2l_scale_type='urbanf') this%qflx_qrgwl_col(begc:endc) = spval diff --git a/src/cpl/lnd_import_export.F90 b/src/cpl/lnd_import_export.F90 index c4e0dacb9f..4923b721af 100644 --- a/src/cpl/lnd_import_export.F90 +++ b/src/cpl/lnd_import_export.F90 @@ -381,7 +381,9 @@ subroutine lnd_export( bounds, lnd2atm_inst, lnd2glc_inst, l2x) ! hierarchy of atm/glc/lnd/rof/ice/ocn. ! I.e. water sent from land to rof is positive - l2x(index_l2x_Flrl_rofsur,i) = lnd2atm_inst%qflx_rofliq_qsur_grc(g) + ! surface runoff is the sum of qflx_over, qflx_h2osfc_surf + l2x(index_l2x_Flrl_rofsur,i) = lnd2atm_inst%qflx_rofliq_qsur_grc(g) & + + lnd2atm_inst%qflx_rofliq_h2osfc_grc(g) ! subsurface runoff is the sum of qflx_drain and qflx_perched_drain l2x(index_l2x_Flrl_rofsub,i) = lnd2atm_inst%qflx_rofliq_qsub_grc(g) & diff --git a/src/main/ColumnType.F90 b/src/main/ColumnType.F90 index 84dccdd96f..e7d355a59c 100644 --- a/src/main/ColumnType.F90 +++ b/src/main/ColumnType.F90 @@ -67,7 +67,6 @@ module ColumnType ! other column characteristics logical , pointer :: hydrologically_active(:) ! true if this column is a hydrologically active type - logical , pointer :: urbpoi (:) ! true=>urban point ! levgrnd_class gives the class in which each layer falls. This is relevant for ! columns where there are 2 or more fundamentally different layer types. For @@ -132,7 +131,6 @@ subroutine Init(this, begc, endc) allocate(this%topo_std (begc:endc)) ; this%topo_std (:) = nan allocate(this%hydrologically_active(begc:endc)) ; this%hydrologically_active(:) = .false. - allocate(this%urbpoi (begc:endc)) ; this%urbpoi (:) = .false. end subroutine Init @@ -168,7 +166,6 @@ subroutine Clean(this) deallocate(this%nbedrock ) deallocate(this%levgrnd_class) deallocate(this%hydrologically_active) - deallocate(this%urbpoi) end subroutine Clean @@ -197,8 +194,6 @@ subroutine update_itype(this, c, itype) col%hydrologically_active(c) = is_hydrologically_active( & col_itype = itype, & lun_itype = lun%itype(l)) - ! Properties that are tied to the landunit's properties (like urbpoi) are assumed - ! not to change here. else write(iulog,*) subname//' ERROR: attempt to update itype when type_is_dynamic is false' write(iulog,*) 'c, col%itype(c), itype = ', c, col%itype(c), itype diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index e5ae04b903..a50a57abe3 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -697,9 +697,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro filter(nc)%num_nosnowc, filter(nc)%nosnowc, & clm_fates, & atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & - waterflux_inst, waterstate_inst, soilhydrology_inst, saturated_excess_runoff_inst, & - infiltration_excess_runoff_inst, & - aerosol_inst, canopystate_inst, soil_water_retention_curve, topo_inst) + waterflux_inst, waterstate_inst, soilhydrology_inst, aerosol_inst, & + canopystate_inst, soil_water_retention_curve, topo_inst) ! The following needs to be done after HydrologyNoDrainage (because it needs ! waterflux_inst%qflx_snwcp_ice_col), but before HydrologyDrainage (because @@ -815,7 +814,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & + photosyns_inst, soilhydrology_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) call t_stopf('ecosysdyn') diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index e09a3cbe22..1b1b44adba 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -44,14 +44,12 @@ module clm_instMod use EnergyFluxType , only : energyflux_type use FrictionVelocityMod , only : frictionvel_type use GlacierSurfaceMassBalanceMod , only : glacier_smb_type - use InfiltrationExcessRunoffMod , only : infiltration_excess_runoff_type use IrrigationMod , only : irrigation_type use LakeStateType , only : lakestate_type use OzoneBaseMod , only : ozone_base_type use OzoneFactoryMod , only : create_and_init_ozone_type use PhotosynthesisMod , only : photosyns_type - use SoilHydrologyType , only : soilhydrology_type - use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type use SolarAbsorbedType , only : solarabs_type use SurfaceRadiationMod , only : surfrad_type @@ -97,14 +95,12 @@ module clm_instMod type(energyflux_type) :: energyflux_inst type(frictionvel_type) :: frictionvel_inst type(glacier_smb_type) :: glacier_smb_inst - type(infiltration_excess_runoff_type) :: infiltration_excess_runoff_inst type(irrigation_type) :: irrigation_inst type(lakestate_type) :: lakestate_inst class(ozone_base_type), allocatable :: ozone_inst type(photosyns_type) :: photosyns_inst type(soilstate_type) :: soilstate_inst type(soilhydrology_type) :: soilhydrology_inst - type(saturated_excess_runoff_type) :: saturated_excess_runoff_inst type(solarabs_type) :: solarabs_inst type(surfalb_type) :: surfalb_inst type(surfrad_type) :: surfrad_inst @@ -308,9 +304,6 @@ subroutine clm_instInit(bounds) call soilhydrology_inst%Init(bounds, nlfilename) call SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) ! sets time constant properties - call saturated_excess_runoff_inst%Init(bounds) - call infiltration_excess_runoff_inst%Init(bounds) - call solarabs_inst%Init(bounds) call surfalb_inst%Init(bounds) diff --git a/src/main/initSubgridMod.F90 b/src/main/initSubgridMod.F90 index 0d06208eb4..57384dc461 100644 --- a/src/main/initSubgridMod.F90 +++ b/src/main/initSubgridMod.F90 @@ -416,7 +416,6 @@ subroutine add_column(ci, li, ctype, wtlunit, type_is_dynamic) col%hydrologically_active(ci) = is_hydrologically_active( & col_itype = ctype, & lun_itype = lun%itype(li)) - col%urbpoi(ci) = lun%urbpoi(li) end subroutine add_column diff --git a/src/main/lnd2atmMod.F90 b/src/main/lnd2atmMod.F90 index 05a0e42a7b..2a4a00d5cd 100644 --- a/src/main/lnd2atmMod.F90 +++ b/src/main/lnd2atmMod.F90 @@ -360,6 +360,11 @@ subroutine lnd2atm(bounds, & lnd2atm_inst%qflx_rofliq_grc(g) = lnd2atm_inst%qflx_rofliq_grc(g) - waterflux_inst%qflx_liq_dynbal_grc(g) enddo + call c2g( bounds, & + waterflux_inst%qflx_h2osfc_surf_col (bounds%begc:bounds%endc), & + lnd2atm_inst%qflx_rofliq_h2osfc_grc(bounds%begg:bounds%endg), & + c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) + call c2g( bounds, & waterflux_inst%qflx_drain_perched_col (bounds%begc:bounds%endc), & lnd2atm_inst%qflx_rofliq_drain_perched_grc(bounds%begg:bounds%endg), & diff --git a/src/main/lnd2atmType.F90 b/src/main/lnd2atmType.F90 index e0c4263d01..023608a4a7 100644 --- a/src/main/lnd2atmType.F90 +++ b/src/main/lnd2atmType.F90 @@ -66,6 +66,7 @@ module lnd2atmType real(r8), pointer :: qflx_rofliq_qsur_grc (:) => null() ! rof liq -- surface runoff component real(r8), pointer :: qflx_rofliq_qsub_grc (:) => null() ! rof liq -- subsurface runoff component real(r8), pointer :: qflx_rofliq_qgwl_grc (:) => null() ! rof liq -- glacier, wetland and lakes water balance residual component + real(r8), pointer :: qflx_rofliq_h2osfc_grc (:) => null() ! rof liq -- surface water runoff component real(r8), pointer :: qflx_rofliq_drain_perched_grc (:) => null() ! rof liq -- perched water table runoff component real(r8), pointer :: qflx_rofice_grc (:) => null() ! rof ice forcing real(r8), pointer :: qflx_liq_from_ice_col(:) => null() ! liquid runoff from converted ice runoff @@ -171,6 +172,7 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_rofliq_qsur_grc (begg:endg)) ; this%qflx_rofliq_qsur_grc (:) =ival allocate(this%qflx_rofliq_qsub_grc (begg:endg)) ; this%qflx_rofliq_qsub_grc (:) =ival allocate(this%qflx_rofliq_qgwl_grc (begg:endg)) ; this%qflx_rofliq_qgwl_grc (:) =ival + allocate(this%qflx_rofliq_h2osfc_grc (begg:endg)) ; this%qflx_rofliq_h2osfc_grc (:) =ival allocate(this%qflx_rofliq_drain_perched_grc (begg:endg)) ; this%qflx_rofliq_drain_perched_grc (:) =ival allocate(this%qflx_rofice_grc (begg:endg)) ; this%qflx_rofice_grc (:) =ival allocate(this%qflx_liq_from_ice_col(begc:endc)) ; this%qflx_liq_from_ice_col(:) = ival diff --git a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 index 72db6363bb..3a0cb0c91b 100644 --- a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 @@ -109,7 +109,7 @@ subroutine SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, & h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) qflx_drain => waterflux_inst%qflx_drain_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] total surface runoff (mm H2O /s) + qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral N smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ] diff --git a/src/unit_test_shr/unittestFilterBuilderMod.F90 b/src/unit_test_shr/unittestFilterBuilderMod.F90 index 6999b63d72..3ed61eb9a2 100644 --- a/src/unit_test_shr/unittestFilterBuilderMod.F90 +++ b/src/unit_test_shr/unittestFilterBuilderMod.F90 @@ -55,7 +55,7 @@ subroutine filter_from_range(start, end, numf, filter) ! !LOCAL VARIABLES: integer :: i - character(len=*), parameter :: subname = 'filter_from_range' + character(len=*), parameter :: subname = 'filter_from_list' !----------------------------------------------------------------------- numf = end - start + 1 diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 26761b8b9d..a1b8b61d72 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -18,7 +18,6 @@ list(APPEND clm_sources clm_time_manager.F90 quadraticMod.F90 fileutils.F90 - NumericsMod.F90 ) sourcelist_to_parent(clm_sources) diff --git a/src/utils/NumericsMod.F90 b/src/utils/NumericsMod.F90 deleted file mode 100644 index 8d75753bb8..0000000000 --- a/src/utils/NumericsMod.F90 +++ /dev/null @@ -1,89 +0,0 @@ -module NumericsMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Utility routines for assisting with model numerics - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - - implicit none - save - private - - ! !PUBLIC MEMBER FUNCTIONS: - public :: truncate_small_values ! Truncate relatively small values to 0 - - ! !PUBLIC MEMBER DATA: - - ! Relative differences below rel_epsilon are considered to be zero. - ! - ! Note that double precision machine epsilon is approximately 1e-16, so this value of - ! 1e-13 allows for 3 orders of magnitude of "slop". - ! - ! Examples of how to use this: - ! - ! (1) Rather than checking - ! if (x == y) - ! instead check - ! if (abs(x - y) < rel_epsilon * x) - ! or - ! if (abs(x - y) < rel_epsilon * y) - ! - ! (2) After a state update, you can truncate the state to 0 based on this condition: - ! if (abs(some_state) < rel_epsilon * abs(some_state_orig)) then - ! some_state = 0._r8 - ! end if - ! where some_state_orig is the value of the state variable before the update - real(r8), public, parameter :: rel_epsilon = 1.e-13_r8 ! Relative differences below this are considered to be zero - - ! !PRIVATE MEMBER DATA: - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine truncate_small_values(num_f, filter_f, lb, ub, data_baseline, data) - ! - ! !DESCRIPTION: - ! Truncate relatively small values to 0, within the given filter. - ! - ! "Relatively small" is determined by comparison with some "baseline" version of the - ! data. - ! - ! For example, this can be used after doing a state update. In this case, - ! data_baseline should hold the values before the state update, and data should hold - ! the values after the state update. - ! - ! !ARGUMENTS: - integer , intent(in) :: num_f ! number of points in filter_f - integer , intent(in) :: filter_f(:) ! filter of points in data - integer , intent(in) :: lb ! lower bound of data - integer , intent(in) :: ub ! upper bound of data - real(r8) , intent(in) :: data_baseline(lb:) ! baseline version of data, used to define "relatively close to 0" - real(r8) , intent(inout) :: data(lb:) ! data to operate on - ! - ! !LOCAL VARIABLES: - integer :: fn ! index into filter - integer :: n ! index into data - - character(len=*), parameter :: subname = 'truncate_small_values' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(data_baseline) == (/ub/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(data) == (/ub/)), errMsg(sourcefile, __LINE__)) - - do fn = 1, num_f - n = filter_f(fn) - if (abs(data(n)) < rel_epsilon * abs(data_baseline(n))) then - data(n) = 0._r8 - end if - end do - - end subroutine truncate_small_values - -end module NumericsMod diff --git a/src/utils/test/CMakeLists.txt b/src/utils/test/CMakeLists.txt index ff74e6508a..53a211e89c 100644 --- a/src/utils/test/CMakeLists.txt +++ b/src/utils/test/CMakeLists.txt @@ -1,4 +1,3 @@ add_subdirectory(clm_time_manager_test) add_subdirectory(annual_flux_dribbler_test) -add_subdirectory(numerics_test) add_subdirectory(quadratic_test) diff --git a/src/utils/test/numerics_test/CMakeLists.txt b/src/utils/test/numerics_test/CMakeLists.txt deleted file mode 100644 index 83bf0cc1d0..0000000000 --- a/src/utils/test/numerics_test/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set (pfunit_sources - test_truncate_small_values.pf) - -set (extra_sources - ) - -create_pFUnit_test(numerics test_numerics_exe - "${pfunit_sources}" "${extra_sources}") - -target_link_libraries(test_numerics_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/utils/test/numerics_test/test_truncate_small_values.pf b/src/utils/test/numerics_test/test_truncate_small_values.pf deleted file mode 100644 index a989f21c3d..0000000000 --- a/src/utils/test/numerics_test/test_truncate_small_values.pf +++ /dev/null @@ -1,120 +0,0 @@ -module test_truncate_small_values - - ! Tests of NumericsMod: truncate_small_values - - use pfunit_mod - use NumericsMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSimpleSubgridSetupsMod - use unittestSubgridMod - use unittestFilterBuilderMod, only : filter_from_range - - implicit none - - @TestCase - type, extends(TestCase) :: TestTSV - contains - procedure :: setUp - procedure :: tearDown - end type TestTSV - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - subroutine setUp(this) - class(TestTSV), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestTSV), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - @Test - subroutine truncates_correct_points(this) - class(TestTSV), intent(inout) :: this - real(r8) :: data_baseline(3) - real(r8) :: data(3) - real(r8) :: data_saved(3) - integer :: num_f - integer, allocatable :: filter_f(:) - - call setup_n_veg_patches(pwtcol = [0.1_r8, 0.8_r8, 0.1_r8], pft_types = [1, 2, 3]) - call filter_from_range(bounds%begp, bounds%endp, num_f, filter_f) - - ! point 2 should be truncated, others should not be truncated - data_baseline = [1._r8, 1._r8, 1._r8] - data = [0.5_r8, 1.e-16_r8, -1._r8] - data_saved = data - - call truncate_small_values( & - num_f = num_f, & - filter_f = filter_f, & - lb = bounds%begp, & - ub = bounds%endp, & - data_baseline = data_baseline, & - data = data) - - @assertEqual(data_saved(1), data(1)) - @assertEqual(data_saved(3), data(3)) - @assertEqual(0._r8, data(2)) - - end subroutine truncates_correct_points - - @Test - subroutine truncates_large_magnitude(this) - ! Make sure we're just relying on relative rather than absolute magnitudes by - ! confirming that it can truncate a value with large magnitude. - class(TestTSV), intent(inout) :: this - real(r8) :: data_baseline(1) - real(r8) :: data(1) - integer :: num_f - integer, allocatable :: filter_f(:) - - call setup_single_veg_patch(pft_type = 1) - call filter_from_range(bounds%begp, bounds%endp, num_f, filter_f) - - data_baseline = [1.e30_r8] - data = [1.e10_r8] - - call truncate_small_values( & - num_f = num_f, & - filter_f = filter_f, & - lb = bounds%begp, & - ub = bounds%endp, & - data_baseline = data_baseline, & - data = data) - - @assertEqual(0._r8, data(1)) - end subroutine truncates_large_magnitude - - @Test - subroutine does_not_truncate_small_magnitude(this) - ! Make sure we're just relying on relative rather than absolute magnitudes by - ! confirming that it does not truncate a value with small magnitude. - class(TestTSV), intent(inout) :: this - real(r8) :: data_baseline(1) - real(r8) :: data(1) - integer :: num_f - integer, allocatable :: filter_f(:) - - call setup_single_veg_patch(pft_type = 1) - call filter_from_range(bounds%begp, bounds%endp, num_f, filter_f) - - data_baseline = [1.e-30_r8] - data = [1.e-31_r8] - - call truncate_small_values( & - num_f = num_f, & - filter_f = filter_f, & - lb = bounds%begp, & - ub = bounds%endp, & - data_baseline = data_baseline, & - data = data) - - @assertEqual(1.e-31_r8, data(1)) - end subroutine does_not_truncate_small_magnitude - -end module test_truncate_small_values From 79707b380f4e2746465fc5174819c05c21c67b3f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 03:02:01 -0600 Subject: [PATCH 121/144] Change test to same as in ctsm1.0.dev004 --- cime_config/testdefs/testlist_clm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index a38d7e36f7..5adc7d615d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1541,12 +1541,13 @@ - + + From 4a26ed4499eb00b3a3967b7769bc53f218d74d36 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 03:40:26 -0600 Subject: [PATCH 122/144] Fix name of release branch tag --- doc/release-clm5.0.ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 5ee9d6256c..7327e6845d 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,5 +1,5 @@ =============================================================== -Tag name: release-clm5.0.03 +Tag name: release-clm5.0.02 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Tue Jun 12 15:32:53 MDT 2018 One-line Summary: Second release branch tag for CESM2.0 release, fixing DA and tools and README files, identical to clm5.0.dev013 From bc7bfb805a3232bc52b0ab05d479f440c2e06254 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Jul 2018 04:05:19 -0600 Subject: [PATCH 123/144] Update change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 104 ++++++++++++++++++++++++++++++++++- 2 files changed, 104 insertions(+), 1 deletion(-) diff --git a/doc/ChangeSum b/doc/ChangeSum index af08951dad..3fbeec19fb 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.04 erik 07/18/2018 Fix some NFIX variables, update cime/cism for upgraded hobart new glade, new diagnostic fields, update cmip6 output ctsm1.0.dev004 erik 07/18/2018 Add some new diagnostic fields, fix a few issues, update cmip6 output ctsm1.0.dev003 erik 07/15/2018 Update cime/cism to work on upgraded hobart and with glade changes on cheyenne ctsm1.0.dev002 erik 07/06/2018 Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 7327e6845d..fdeadb141a 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,5 +1,107 @@ =============================================================== -Tag name: release-clm5.0.02 +Tag name: release-clm5.0.04 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Jul 18 04:04:57 MDT 2018 +One-line Summary: Fix some NFIX variables, update cime/cism for upgraded hobart new glade, new diagnostic fields, update cmip6 output + +Purpose of this version: +------------------------ + +Add some new diagnostic fields. Some needed for CMIP6. Update the CMIP6 user-mods output. +Fix a couple issues. Get full list of history tapes working correctly. Check for valid range +of CO2. New IC file interpolated from the previous one for f19_g17_gl4 for 2000 Clm50BgcCrop + +Update cime and cism so can work on upgraded hobart. Also fix an issue that the Nag6.2 compiler found +in CTSM. Also get working with glade changes that happened on cheyenne, DIN_LOC_ROOT_CLMFORC was +changed to a new directory. + +Nitrogen Fixation flux arrays were being set to missing value over non-vegetated landunits. This sets them to zero everywhere +and averages in the zero's at the gridcell level for history output. It also reads in restarts with missing values and converts +them to zero's. + +There are also some tools updates, getting the tools working on the new upgraded hobart.cgd.ucar.edu. + +And mksurfdata_map is updated to add some *_MAX files on the landuse.timeseries files that will allow us to conserve memory +for transient cases. + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev004 (minus ctsm1.0.dev001) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): + + #210 -- increase number of history tapes + $427 -- Check for zero CO2 + #429 -- New IC for present day + #441 -- Changes in glade invalidate previous softlinks and data locations + #438 -- Illegal argument aliasing caught by nag6.2 + #433 -- with hobart upgrade CTSM not working + #435 -- intel build for tools + #426 -- Nitrogen Fixation flux variables + #433 -- hobart broken, got it working for tools + +Science changes since: release-clm5.0.03 + + Changes to Nitrogen fixation flux arrays so that they are zero everywhere and the zeros are averaged in for history output. + Answers change because of interpolated initial conditions for 2000 simulation year at f19_g17_gl4 + +Software changes since: release-clm5.0.03 + + Get working on updated hobart. Add some new fields to mksurfdata_map tool. + +Changes to User Interface since: release-clm5.0.03 + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (clm_short): + + cheyenne_intel ---- PASS + cheyenne_gnu ------ PASS + hobart_nag -------- PASS + hobart_intel ------ PASS + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: clm5.0.dev013 + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: Clm50 2000 and NFIX history variables + - what platforms/compilers: All + - nature of change: similar climate + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.00 + mosart: release-cesm2.0.00 + cime: cime5.6.10 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: ctsm1.0.dev002, ctsm1.0dev003, ctsm1.0dev004 + +=============================================================== +=============================================================== +Tag name: release-clm5.0.03 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Tue Jun 12 15:32:53 MDT 2018 One-line Summary: Second release branch tag for CESM2.0 release, fixing DA and tools and README files, identical to clm5.0.dev013 From bcc28004d60f5481f29a2801903881b4f9837235 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 23 Jul 2018 15:48:18 -0600 Subject: [PATCH 124/144] Add a section in the bug report for a brief summary The main motivation is: If we change the title of a bug, then some context can be lost for the original bug report. It could help if the summary - something like the title - were repeated in the initial bug report, so that the summary would remain intact even if the title is changed. --- .github/ISSUE_TEMPLATE/01_bug_report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md index b03c77171d..f1f97feeac 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.md +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -4,6 +4,8 @@ about: Report a problem with the code --- +### Brief summary of bug + ### General bug information **CTSM version you are using:** [output of `git describe`] From 8b435be375386bd553bbdcb91d5fbebaf1507543 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 23 Jul 2018 15:55:54 -0600 Subject: [PATCH 125/144] Add a note about what's expected for the bug summary --- .github/ISSUE_TEMPLATE/01_bug_report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md index f1f97feeac..427217bdfb 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.md +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -6,6 +6,8 @@ about: Report a problem with the code ### Brief summary of bug +[Give a one or two sentence summary. This could be the same as the issue title if you feel that is a sufficient summary.] + ### General bug information **CTSM version you are using:** [output of `git describe`] From 697a62bab60ce45b8afae20b5fadd77a4743d464 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 Aug 2018 15:47:06 -0600 Subject: [PATCH 126/144] Update ndep file with Mike Mills latest, and update year_last for some of the streams for historical --- bld/namelist_files/namelist_defaults_clm4_5.xml | 14 +++++++------- bld/namelist_files/use_cases/1850_control.xml | 2 +- bld/namelist_files/use_cases/20thC_transient.xml | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index e4fe10aca1..b0865bf267 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -971,7 +971,7 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc2000 1850 -2000 +2015 1850 2100 @@ -1064,13 +1064,13 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc2000 1850 -2010 +2016 1850 -2010 +2016 1850 -2010 +2016 lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc @@ -1104,13 +1104,13 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc2000 1850 -2010 +2106 1850 -2010 +2106 1850 -2010 +2106 lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 0091aaa81e..c5d9da8b05 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -33,7 +33,7 @@ 1850 lnd/clm2/ndepdata/fndep_clm_hist_simyr1850_0.9x1.25_CMIP6alpha02_c180426.nc +>lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc cycle diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index 3ee0134b9b..b0ee3f3576 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -2,10 +2,10 @@ -Simulate transient land-use, and aerosol deposition changes from 1850 to 2005 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2005 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2005 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2005 +Simulate transient land-use, and aerosol deposition changes from 1850 to 2015 +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 1850 @@ -36,15 +36,15 @@ 1850 1850 -2010 +2016 1850 1850 -2010 +2016 1850 1850 -2005 +2106 1850 From 0df1704e7171abdf33ebf87381772c96cd3998cf Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 12:05:05 -0600 Subject: [PATCH 127/144] Do not allow SOYFIXN diagnostic field with FUN With FUN on, SOYFIXN is not calculated so reporting it as zeros is misleading to users. Fixes #419 --- src/biogeochem/CNVegNitrogenFluxType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index 6836fd74a1..47b620bf91 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -950,7 +950,7 @@ subroutine InitHistory(this, bounds) ptr_patch=this%fert_patch) end if - if (use_crop) then + if (use_crop .and. .not. use_fun) then this%soyfixn_patch(begp:endp) = spval call hist_addfld1d (fname='SOYFIXN', units='gN/m^2/s', & avgflag='A', long_name='soybean fixation', & From 0a36ae0d8058c887f40c358a70bcb26d66db4515 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 12:28:11 -0600 Subject: [PATCH 128/144] Remove broken ncd_io_1d_log_glob For now I'm just removing the ability to try to call this with a 1-d logical, rather than trying to fix the code. Fixes #24 --- src/main/ncdio_pio.F90.in | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index 58f26636bf..6de8acb363 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -104,7 +104,7 @@ module ncdio_pio interface ncd_io module procedure ncd_io_char_var0_start_glob - !DIMS 0,1 + !DIMS 0 module procedure ncd_io_{DIMS}d_log_glob !DIMS 0,1,2,3 @@ -1192,11 +1192,11 @@ contains end subroutine ncd_io_char_var0_start_glob !------------------------------------------------------------------------ - !DIMS 0,1 + !DIMS 0 subroutine ncd_io_{DIMS}d_log_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) ! ! !DESCRIPTION: - ! netcdf I/O of global integer variable + ! netcdf I/O of global logical variable ! ! !ARGUMENTS: class(file_desc_t) , intent(inout) :: ncid ! netcdf file id @@ -1242,12 +1242,7 @@ contains call shr_sys_abort(' ERROR: bad integer value for logical data'//errMsg(sourcefile, __LINE__)) end if #else - allocate(idata1d(size(data))) - data = (idata1d == 1) - if ( any(idata1d /= 0 .and. idata1d /= 1) )then - call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(sourcefile, __LINE__)) - end if - deallocate(idata1d) + call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0') #endif endif if (present(readvar)) readvar = varpresent @@ -1267,18 +1262,7 @@ contains status = pio_put_var(ncid, varid, start, count, idata1d) deallocate(idata1d) #else - start(1) = 1 ; count(1) = size(data) - start(2) = 1 ; count(2) = 1 - if (present(nt)) start(2) = nt - allocate(idata1d(size(data))) - where( data ) - idata1d = 1 - elsewhere - idata1d = 0 - end where - call ncd_inqvid (ncid, varname, varid, vardesc) - status = pio_put_var(ncid, varid, start, count, idata1d) - deallocate( idata1d ) + call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0') #endif endif ! flag From 372fa8e8cf77b7c438657d10fd6c1165661b4ef1 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 12:39:34 -0600 Subject: [PATCH 129/144] Replace a prebeta test with a similar test in the aux_clm test suite Fixes #467 --- cime_config/testdefs/testlist_clm.xml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 5adc7d615d..fbfa8eed3c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -657,14 +657,6 @@ - - - - - - - - @@ -753,6 +745,7 @@ + From 714e0c69a520a97c8aa35e491dd330c490d5d7a9 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 12:47:55 -0600 Subject: [PATCH 130/144] Fix documentation of hr and hr_road_perv Fixes #120 --- src/biogeophys/CanopyTemperatureMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/CanopyTemperatureMod.F90 b/src/biogeophys/CanopyTemperatureMod.F90 index 97fc45884f..de9c977f93 100644 --- a/src/biogeophys/CanopyTemperatureMod.F90 +++ b/src/biogeophys/CanopyTemperatureMod.F90 @@ -110,8 +110,8 @@ subroutine CanopyTemperature(bounds, & real(r8) :: qsatgdT ! d(qsatg)/dT real(r8) :: fac ! soil wetness of surface layer real(r8) :: psit ! negative potential of soil - real(r8) :: hr ! relative humidity - real(r8) :: hr_road_perv ! relative humidity for urban pervious road + real(r8) :: hr ! alpha soil + real(r8) :: hr_road_perv ! alpha soil for urban pervious road real(r8) :: wx ! partial volume of ice and water of surface layer real(r8) :: fac_fc ! soil wetness of surface layer relative to field capacity real(r8) :: eff_porosity ! effective porosity in layer From 3426fb65f71f2ddc3d1805752fd78e90c3d5f852 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 13:11:54 -0600 Subject: [PATCH 131/144] Change a gnu debug test to intel gnu can't catch all of the issues that intel, pgi or nag can in debug mode: see ESMCI/cime#1974 . Therefore, it would be best if we avoided having our only debug tests of certain options be with gnu. Fixes #217 --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index fbfa8eed3c..a94ff67dee 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1343,10 +1343,10 @@ - + - + From 216d58964f388229d9eac8e5aac130d863a4efbe Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 13:37:08 -0600 Subject: [PATCH 132/144] Move all .gitignore entries to top-level .gitignore From some googling, it seems this is the most common convention. Also, use a leading slash for files in specific places (/foo/bar.x says: ignore the exact file /PATH/TO/REPO/ROOT/foo/bar.x; foo/bar.x says: ignore any file with path foo/bar.x, including, for example, /PATH/TO/REPO/ROOT/some/intermediate/path/foo/bar.x) Fixes #245 --- .gitignore | 61 ++++++++++++++++------------ src/dyn_subgrid/.gitignore | 4 -- src/unit_test_shr/.gitignore | 2 - src/unit_test_stubs/main/.gitignore | 3 -- src/unit_test_stubs/utils/.gitignore | 2 - src/utils/.gitignore | 2 - 6 files changed, 34 insertions(+), 40 deletions(-) delete mode 100644 src/dyn_subgrid/.gitignore delete mode 100644 src/unit_test_shr/.gitignore delete mode 100644 src/unit_test_stubs/main/.gitignore delete mode 100644 src/unit_test_stubs/utils/.gitignore delete mode 100644 src/utils/.gitignore diff --git a/.gitignore b/.gitignore index abebdd6657..d8000a5537 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ # directories checked out by manage_externals, and other files created # by manage_externals manage_externals.log -src/fates/ -tools/PTCLM/ -cime/ -components/ +/src/fates/ +/tools/PTCLM/ +/cime/ +/components/ # ignore svn directories **/.svn/** @@ -26,28 +26,35 @@ CMakeFiles/ # unit testing directories -src/unit_tests.* +/src/unit_tests.* + +# files generated by the unit test build +/src/dyn_subgrid/dynVarMod.F90 +/src/dyn_subgrid/dynVarTimeInterpMod.F90 +/src/dyn_subgrid/dynVarTimeUninterpMod.F90 +/src/utils/array_utils.F90 +/src/unit_test_stubs/utils/restUtilMod_stub.F90 +/src/unit_test_stubs/main/ncdio_pio_fake.F90 +/src/unit_test_stubs/main/ncdio_var.F90 +/src/unit_test_shr/unittestArrayMod.F90 # cime_config buildnmlc buildcppc -# don't ignore cism build utilities directory -!components/cism/**/build - # configure / build files -bld/**/CESM_cppdefs -bld/**/Filepath -bld/**/config_cache.xml -bld/**/lnd_in -bld/**/drv_flds_in +/bld/**/CESM_cppdefs +/bld/**/Filepath +/bld/**/config_cache.xml +/bld/**/lnd_in +/bld/**/drv_flds_in # build-naemlist testing -bld/unit_testers/lnd_in* -bld/unit_testers/drv_flds_in* -bld/unit_testers/temp_file.txt* -bld/unit_testers/user_nl_clm_real_parameters* -bld/unit_testers/env_run.xml +/bld/unit_testers/lnd_in* +/bld/unit_testers/drv_flds_in* +/bld/unit_testers/temp_file.txt* +/bld/unit_testers/user_nl_clm_real_parameters* +/bld/unit_testers/env_run.xml # tools testing output td.*.status @@ -66,19 +73,19 @@ clm.input_data_list.previous *.stdout.txt.o* # Tools executables -tools/mksurfdata_map/mksurfdata_map -tools/mkprocdata_map/mkprocdata_map +/tools/mksurfdata_map/mksurfdata_map +/tools/mkprocdata_map/mkprocdata_map # mksurfdata output files -tools/mksurfdata_map/surfdata_*.nc -tools/mksurfdata_map/landuse.timeseries_*.nc +/tools/mksurfdata_map/surfdata_*.nc +/tools/mksurfdata_map/landuse.timeseries_*.nc # mkmapdata output files -tools/mkmapdata/PET*.RegridWeightGen.Log -tools/mkmapdata/regrid.*.out -tools/mkmapdata/regrid.*.err -tools/mkmapdata/regrid.o* -tools/mkmapdata/map*.nc +/tools/mkmapdata/PET*.RegridWeightGen.Log +/tools/mkmapdata/regrid.*.out +/tools/mkmapdata/regrid.*.err +/tools/mkmapdata/regrid.o* +/tools/mkmapdata/map*.nc # build output *.o diff --git a/src/dyn_subgrid/.gitignore b/src/dyn_subgrid/.gitignore deleted file mode 100644 index 52f24730b5..0000000000 --- a/src/dyn_subgrid/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# files generated by genf90 in the unit test build -dynVarMod.F90 -dynVarTimeInterpMod.F90 -dynVarTimeUninterpMod.F90 diff --git a/src/unit_test_shr/.gitignore b/src/unit_test_shr/.gitignore deleted file mode 100644 index 70bacd9621..0000000000 --- a/src/unit_test_shr/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# files generated by genf90 in the unit test build -unittestArrayMod.F90 diff --git a/src/unit_test_stubs/main/.gitignore b/src/unit_test_stubs/main/.gitignore deleted file mode 100644 index a457979e10..0000000000 --- a/src/unit_test_stubs/main/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# files generated by genf90 in the unit test build -ncdio_pio_fake.F90 -ncdio_var.F90 diff --git a/src/unit_test_stubs/utils/.gitignore b/src/unit_test_stubs/utils/.gitignore deleted file mode 100644 index 9e11aa7f64..0000000000 --- a/src/unit_test_stubs/utils/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# files generated by genf90 in the unit test build -restUtilMod_stub.F90 diff --git a/src/utils/.gitignore b/src/utils/.gitignore deleted file mode 100644 index 79fcba6e26..0000000000 --- a/src/utils/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# files generated by genf90 in the unit test build -array_utils.F90 From 576702dad668fd5a76793496a3c73f77d22270a0 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 14:07:54 -0600 Subject: [PATCH 133/144] Abort if mxsoil_color is not on surface dataset Aborting is safer than assuming 8 classes, and avoids possibly cryptic errors Fixes #272 --- src/biogeophys/SurfaceAlbedoMod.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/SurfaceAlbedoMod.F90 b/src/biogeophys/SurfaceAlbedoMod.F90 index 324d37207c..9ad3229543 100644 --- a/src/biogeophys/SurfaceAlbedoMod.F90 +++ b/src/biogeophys/SurfaceAlbedoMod.F90 @@ -112,13 +112,14 @@ subroutine SurfaceAlbedoInitTimeConst(bounds) allocate(isoicol(bounds%begc:bounds%endc)) ! Determine soil color and number of soil color classes - ! if number of soil color classes is not on input dataset set it to 8 call getfil (fsurdat, locfn, 0) call ncd_pio_openfile (ncid, locfn, 0) call ncd_io(ncid=ncid, varname='mxsoil_color', flag='read', data=mxsoil_color, readvar=readvar) - if ( .not. readvar ) mxsoil_color = 8 + if ( .not. readvar ) then + call endrun(msg=' ERROR: mxsoil_color NOT on surfdata file '//errMsg(sourcefile, __LINE__)) + end if allocate(soic2d(bounds%begg:bounds%endg)) call ncd_io(ncid=ncid, varname='SOIL_COLOR', flag='read', data=soic2d, dim1name=grlnd, readvar=readvar) From efdf0e78bf2ae12a870aacb83fd98e74a570c843 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 14:17:27 -0600 Subject: [PATCH 134/144] Add helpful message if levgrnd differs on restart file Suggest using init_interp, as is suggested if levsno differs Fixes #283 --- src/main/restFileMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/restFileMod.F90 b/src/main/restFileMod.F90 index 9beeec1b92..c352572d02 100644 --- a/src/main/restFileMod.F90 +++ b/src/main/restFileMod.F90 @@ -714,10 +714,10 @@ subroutine restFile_dimcheck( ncid ) call check_dim(ncid, namep, nump, msg=msg) if ( use_fates ) call check_dim(ncid, nameCohort , numCohort, msg=msg) end if - call check_dim(ncid, 'levsno' , nlevsno, & - msg = 'You can deal with this mismatch by rerunning with ' // & - 'use_init_interp = .true. in user_nl_clm') - call check_dim(ncid, 'levgrnd' , nlevgrnd) + msg = 'You can deal with this mismatch by rerunning with ' // & + 'use_init_interp = .true. in user_nl_clm' + call check_dim(ncid, 'levsno' , nlevsno, msg=msg) + call check_dim(ncid, 'levgrnd' , nlevgrnd, msg=msg) call check_dim(ncid, 'levurb' , nlevurb) call check_dim(ncid, 'levlak' , nlevlak) From d5d2107ea67a20f44a5f6542d3142b41151dbd2a Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 14:28:10 -0600 Subject: [PATCH 135/144] For cmip6 runs, turn on histaux_l2x1yrg Land Ice Working Group members request that, for cmip6 runs, we output the coupler history fields needed to drive a later TG compset (CISM-only forced by dlnd). Fixes #367 --- cime_config/usermods_dirs/cmip6_output/user_nl_cpl | 1 + 1 file changed, 1 insertion(+) create mode 100644 cime_config/usermods_dirs/cmip6_output/user_nl_cpl diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_cpl b/cime_config/usermods_dirs/cmip6_output/user_nl_cpl new file mode 100644 index 0000000000..ba776735ff --- /dev/null +++ b/cime_config/usermods_dirs/cmip6_output/user_nl_cpl @@ -0,0 +1 @@ +histaux_l2x1yrg = .true. From d116afe59f7f5eabbc686b7f815aa2cb9a3ea6a0 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 15:36:41 -0600 Subject: [PATCH 136/144] Fix documentation of init_interp_method The documentation for init_interp_method said that the method use_finidat_areas can be used when transitioning from a spinup to a transient run. But I realized that this isn't true in general, because spinup runs typically have irrigation off and transient runs have irrigation on. Fixes #412 --- .../namelist_definition_clm4_5.xml | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index afb8c97818..0a4bbd9a28 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -2432,20 +2432,24 @@ to the atmosphere) (but using the 'general' method will typically have only a very minor impact on results in this case). For this method to work, the input finidat file needs to be at the same resolution as the current configuration. So this is a less general form of -init_interp. However, it can be used when transitioning from a spinup -run to a transient run, or in other cases where the only difference is -in internal memory allocation. In order to catch possible problems, this -uses a different algorithm for finding the input point for each output -point, which ensures that each active output point is associated with -exactly one input point with the same latitude, longitude and type. This -method requires (a) the same grid for input and output, within roundoff; -(b) any non-zero-weight point in the input must have memory allocated -for it in this grid cell in the output (this will be satisfied if the -point is non-zero-weight on the surface dataset or if it's a point for -which we allocate memory even for zero-weight points); (c) any active -point in the output (based on the surface dataset and rules for -determining active points) must have a matching point in this grid cell -in the input. +init_interp. However, it can be used in cases where the only difference +is in internal memory allocation. In order to catch possible problems, +this uses a different algorithm for finding the input point for each +output point, which ensures that each active output point is associated +with exactly one input point with the same latitude, longitude and +type. This method requires (a) the same grid for input and output, +within roundoff; (b) any non-zero-weight point in the input must have +memory allocated for it in this grid cell in the output (this will be +satisfied if the point is non-zero-weight on the surface dataset or if +it's a point for which we allocate memory even for zero-weight points); +(c) any active point in the output (based on the surface dataset and +rules for determining active points) must have a matching point in this +grid cell in the input. (Note that this generally can NOT be used when +transitioning from a spinup run to a transient run, because spinup runs +typically have irrigation off and transient runs have irrigation on, and +the presence/absence of irrigation affects the subgrid structure; if it +weren't for that difference, then this option would be useful for this +use case.) From 21330dc04cec220881db6d666f2de032faac7829 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 3 Aug 2018 15:49:41 -0600 Subject: [PATCH 137/144] Remove trailing whitespace on lines longer than 132 characters The only problem was trailing whitespace, but it was causing failures in https://github.com/NCAR/code-format-checker (run with code-format-checker/CodeFormatChecker.py -t rc -l 133) that I wanted to clean up. --- src/biogeochem/CNDriverMod.F90 | 2 +- src/biogeochem/CNFUNMod.F90 | 2 +- src/biogeochem/CNGapMortalityMod.F90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index 83a58f2c42..edce6c7095 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -754,7 +754,7 @@ subroutine CNDriverNoLeaching(bounds, dgvs_inst, cnveg_state_inst, & cnveg_carbonstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp, 1:nlevdecomp_full), & - froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp, 1:nlevdecomp_full), & + froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp, 1:nlevdecomp_full), & croot_prof_patch=soilbiogeochem_state_inst%croot_prof_patch(begp:endp, 1:nlevdecomp_full), & stem_prof_patch=soilbiogeochem_state_inst%stem_prof_patch(begp:endp, 1:nlevdecomp_full), & totsomc_col=soilbiogeochem_carbonstate_inst%totsomc_col(begc:endc), & diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90 index 98adfc36e2..f1adee8f6b 100644 --- a/src/biogeochem/CNFUNMod.F90 +++ b/src/biogeochem/CNFUNMod.F90 @@ -1236,7 +1236,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& frac_ideal_C_use = max(0.0_r8,1.0_r8 - (total_N_resistance-fun_cn_flex_a(ivt(p)))/fun_cn_flex_b(ivt(p)) ) ! then, if the plant is very much in need of N, the C used for uptake is increased accordingly. if(delta_CN .gt.0.and. frac_ideal_C_use.lt.1.0)then - frac_ideal_C_use = frac_ideal_C_use + (1.0_r8-frac_ideal_C_use)*min(1.0_r8, delta_CN/fun_cn_flex_c(ivt(p))); + frac_ideal_C_use = frac_ideal_C_use + (1.0_r8-frac_ideal_C_use)*min(1.0_r8, delta_CN/fun_cn_flex_c(ivt(p))) end if ! If we have too much N (e.g. from free N retranslocation) then make frac_ideal_c_use even lower. ! For a CN delta of fun_cn_flex_c, then we reduce C expendiure to the minimum of 0.5. diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90 index a2f8c4fd89..939d4b52eb 100644 --- a/src/biogeochem/CNGapMortalityMod.F90 +++ b/src/biogeochem/CNGapMortalityMod.F90 @@ -193,7 +193,7 @@ subroutine CNGapMortality (bounds, num_soilc, filter_soilc, num_soilp, filter_so cnveg_carbonflux_inst%m_livecrootc_to_litter_patch(p) = cnveg_carbonstate_inst%livecrootc_patch(p) * m if (spinup_state == 2 .and. .not. use_cndv) then !accelerate mortality of dead woody pools cnveg_carbonflux_inst%m_deadstemc_to_litter_patch(p) = cnveg_carbonstate_inst%deadstemc_patch(p) * m * 10._r8 - cnveg_carbonflux_inst%m_deadcrootc_to_litter_patch(p) = cnveg_carbonstate_inst%deadcrootc_patch(p) * m * 10._r8 + cnveg_carbonflux_inst%m_deadcrootc_to_litter_patch(p) = cnveg_carbonstate_inst%deadcrootc_patch(p) * m * 10._r8 else cnveg_carbonflux_inst%m_deadstemc_to_litter_patch(p) = cnveg_carbonstate_inst%deadstemc_patch(p) * m cnveg_carbonflux_inst%m_deadcrootc_to_litter_patch(p) = cnveg_carbonstate_inst%deadcrootc_patch(p) * m From 60ed67e191cba53a284d026a881bc701c5f1cf96 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 5 Aug 2018 14:25:22 -0600 Subject: [PATCH 138/144] Add another fates exact restart test to the expected fail list --- cime_config/testdefs/ExpectedTestFails.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index ae07999599..da8d8e1080 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -11,6 +11,7 @@ FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN + FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-Fates COMPARE_base_rest FAIL ERP_Ld9.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-FatesAllVars COMPARE_base_rest FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesLogging COMPARE_base_rest FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-Fates COMPARE_base_rest From 0bc4c8b4e996d52eaeb22fbf29d168ef6fca9c19 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 5 Aug 2018 23:46:09 -0600 Subject: [PATCH 139/144] Update ChangeLog --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 104 +++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 3fbeec19fb..79e7b0b4fd 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.05 erik 08/05/2018 Update 1850 ndep file, and last year for transient streams release-clm5.0.04 erik 07/18/2018 Fix some NFIX variables, update cime/cism for upgraded hobart new glade, new diagnostic fields, update cmip6 output ctsm1.0.dev004 erik 07/18/2018 Add some new diagnostic fields, fix a few issues, update cmip6 output ctsm1.0.dev003 erik 07/15/2018 Update cime/cism to work on upgraded hobart and with glade changes on cheyenne diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index fdeadb141a..60a395e4cb 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,108 @@ =============================================================== +Tag name: release-clm5.0.05 +Originator(s): erik (Erik Kluzek) +Date: Sun Aug 5 23:31:45 MDT 2018 +One-line Summary: Update 1850 ndep file, and last year for transient streams + +Purpose of this version: +------------------------ + +Update to latest Nitrogen Deposition file from simulations with WACCM for 1850. +Also fix an issue with the last year for historical transient cases. + + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): $461 + #461 -- increase year last for streams + +Science changes since: release-clm5.0.04 + New ndep file, and updated last year for transient streams + +Software changes since: None + +Changes to User Interface since: None + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + hobart --- OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + + regular tests (fates): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + + regular tests (clm_short): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.04 + +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: for 1850 Bgc cases and after 2005 for transient cases + - what platforms/compilers: All + - nature of change: similar climate + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.00 + mosart: release-cesm2.0.00 + cime: cime5.6.10 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #471 -- update ndep and last year of streams + +=============================================================== +=============================================================== Tag name: release-clm5.0.04 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Wed Jul 18 04:04:57 MDT 2018 From 29250689c4efadcd56f363ea10a6636ee1c65c1e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 6 Aug 2018 00:10:43 -0600 Subject: [PATCH 140/144] Always avoid generating dynamic landunit adjustments for glacier area changes in the first timestep of a startup or hybrid run - not just for cold start or interpolated start. This is the change in ctsm1.0.dev007. i --- src/main/clm_driver.F90 | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index a50a57abe3..b1a4a9beb8 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -12,7 +12,6 @@ module clm_driver use clm_varctl , only : wrtdia, iulog, use_fates use clm_varctl , only : use_cn, use_lch4, use_noio, use_c13, use_c14 use clm_varctl , only : use_crop, ndep_from_cpl - use clm_varctl , only : is_cold_start, is_interpolated_start use clm_time_manager , only : get_nstep, is_beg_curr_day use clm_time_manager , only : get_prev_date, is_first_step use clm_varpar , only : nlevsno, nlevgrnd @@ -166,14 +165,19 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro nclumps = get_proc_clumps() ! ======================================================================== - ! In the first time step of a run that used cold start or init_interp, glacier areas - ! will start at whatever is specified on the surface dataset, because coupling fields - ! from GLC aren't received until the run loop. Thus, CLM will see a potentially large, - ! fictitious glacier area change in the first time step after cold start or - ! init_interp. We don't want this fictitious area change to result in any state or - ! flux adjustments. Thus, we apply this area change here, at the start of the driver - ! loop, so that in dynSubgrid_driver, it will look like there is no glacier area - ! change in the first time step. + ! In the first time step of a startup or hybrid run, we want to update CLM's glacier + ! areas to match those given by GLC. This is because, in initialization, we do not yet + ! know GLC's glacier areas, so CLM's glacier areas are based on the surface dataset + ! (for a cold start or init_interp run) or the initial conditions file (in a + ! non-init_interp, non-cold start run) - which may not match GLC's glacier areas for + ! this configuration. (Coupling fields from GLC aren't received until the run loop.) + ! Thus, CLM will see a potentially large, fictitious glacier area change in the first + ! time step. We don't want this fictitious area change to result in any state or flux + ! adjustments. Thus, we apply this area change here, at the start of the driver loop, + ! so that in dynSubgrid_driver, it will look like there is no glacier area change in + ! the first time step. (See + ! https://github.com/ESCOMP/ctsm/issues/340#issuecomment-410483131 for more + ! discussion on this.) ! ! This needs to happen very early in the run loop, before any balance checks are ! initialized, because - by design - this doesn't conserve mass at the grid cell @@ -197,8 +201,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! are passed to CLM in initialization, then this code block can be removed. ! ======================================================================== - need_glacier_initialization = (is_first_step() .and. & - (is_cold_start .or. is_interpolated_start)) + need_glacier_initialization = is_first_step() if (need_glacier_initialization) then !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) From 4477d993dd42ade21719aa1b1fc36aa600e18882 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 6 Aug 2018 19:53:54 -0600 Subject: [PATCH 141/144] Lengthen one of the tests --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index a94ff67dee..e98b0b8753 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -962,7 +962,7 @@ - + From 2addc197e267d3485abe46949bb38a32fbc3de48 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 Aug 2018 13:18:57 -0600 Subject: [PATCH 142/144] Reconcile change files with ctsm1.0.dev007 --- doc/ChangeLog | 2025 +++++++------------------------------------------ doc/ChangeSum | 517 +------------ 2 files changed, 286 insertions(+), 2256 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 4a76ea33f0..9dac3ba0df 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,288 @@ =============================================================== +Tag name: ctsm1.0.dev007 +Originator(s): sacks (Bill Sacks) +Date: Sun Aug 5 21:03:28 MDT 2018 +One-line Summary: Avoid glacier dynamic landunit adjustments in first time step + +Purpose of changes +------------------ + +Always avoid generating dynamic landunit adjustments for glacier area +changes in the first timestep of a startup or hybrid run - not just for +cold start or interpolated start. See the detailed discussion in +https://github.com/ESCOMP/ctsm/issues/340 for rationale. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #340 (Avoid generating dynamic landunit adjustment fluxes for + glacier changes in the first timestep) + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - not run + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + ok means tests pass; baseline failures as expected in these two + tests that do not use init_interp: + + FAIL ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default BASELINE ctsm1.0.dev006 + FAIL SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput BASELINE ctsm1.0.dev006 + + (The glacier area on the finidat file used in these tests - + clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc + - seems to have come from an finidat_interp_dest file, and thus does + not match the glacier area from CISM.) + +CTSM tag used for the baseline comparisons: ctsm1.0.dev006 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: Startup / Hybrid runs that include CISM + (even NOEVOLVE) and do not use init_interp, due to: + - different PE layout in new case vs. the one that generated the + finidat (roundoff-level diffs) + - different glacier area on finidat file vs. what's in CISM + (greater than roundoff-level diffs) + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Roundoff-level for different PE layout, larger than roundoff but + should be same climate when there is different glacier area on the + finidat file vs. what's in CISM + + The differences arise from dynamic landunit adjustments of the + below-ground C and N states in the old code, as CTSM adjusts its + areas to match CISM's. In the new code, there are no C and N + adjustments in the first time step from this adjustment. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- #470 (Avoid glacier dynamic landunit adjustments in first time step) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev006 +Originator(s): sacks (Bill Sacks) +Date: Sat Aug 4 07:48:09 MDT 2018 +One-line Summary: Minor bug fixes, cleanup, documentation and enhancements + +Purpose of changes +------------------ + +A collection of minor bug fixes, code cleanup, documentation and +enhancements, all bit-for-bit. See list of issues fixed below for +details. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #24 (ncd_io_1d_log_glob is broken) +- Fixes #120 (Incorrect comments in Biogeophysics1Mod.F90 +- Fixes #217 (Change some cheyenne_gnu tests to cheyenne_intel) +- Fixes #245 (Put all .gitignore entries in top-level file) +- Fixes #272 (Code should error on missing mxsoil_color when SOIL_COLOR + is used) +- Fixes #283 (Add more helpful message about need to do init_interp with + wrong number of vertical layers) +- Fixes #367 (For cmip6 runs: Turn on cpl hist output needed to drive a + TG compset) +- Fixes #412 (Fix documentation of init_interp_method) +- Fixes #419 (Do not allow SOYFIXN diagnostic field with FUN) +- Fixes #464 (Some lines longer than 132 characters) +- Fixes #465 (Remove backwards compatibility check for snw_rds) +- Fixes #467 (Increase wallclock limit for test) + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed a single-point test from gnu to intel to get better debugging + information + (SMS_D_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm45BgcCropQianGs.cheyenne_intel.clm-cropMonthOutput) +- For some single-point tests on both gnu and intel: removed one + compiler, keeping the tests on just one + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + NLCOMP failures as expected for tests with the cmip6 test mod + + Some long single-point gnu tests failed due to running out of + wallclock time; I have removed these, just keeping them on intel + (along with removing a few other tests after I ran the testing - see + commit 5c226bdf): + + FAIL ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=4803 + FAIL ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=6024 + + +CTSM tag used for the baseline comparisons: ctsm1.0.dev005 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO - bit-for-bit + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- #392 (Remove old code for snw_rds restart that looks no longer needed) +- (Other changes not documented in PRs) + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev004 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Wed Jul 18 02:10:23 MDT 2018 @@ -347,1744 +631,3 @@ Pull Requests that document the changes (include PR ids): =============================================================== =============================================================== -Tag name: clm5.0.dev013 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Jun 12 13:46:31 MDT 2018 -One-line Summary: cleanup and update cime and cism - -Purpose of changes ------------------- - -Update cime and cism to newer versions used in release. These bring in some answer -changes. The cime version updates the orbit for 2000 compsets. The cism version -changes answers for two fields with NO_EVOLVE and more fields for EVOLVE. - -Fixes an important bug needed for use with Data Assimulation. Several changes -to testing. Adding wallclock as needed, changing a few compsets so science -supported compsets are used, added tput_tolerance to some tests known to be -variable. - -Many changes to the clm tools for creating input files. Added the version by -querying "git describe" and adding it as an attribute to NetCDF files. Changes -to get tools working, and tested. Also changed so that tools can be run in either -a CTSM checkout or a CESM checkout. - -Updated README files so they are accurate. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] - #188 -- Global PTCLM tools test fails - #187 -- PTCLM tools tests fail baseline comparisons due to a seg fault - #259 -- Most README files in ctsm are incorrect - #386 -- Shorten some currently very long debug tests - #387 -- Lots of testmods still set orb_iyear and orb_iyear_align - #388 -- Add "git describe" to input files that are created - #389 -- Post data-assimilation processing broken with multi-driver - #393 -- Increase wallclock - #399 -- minor format update needed in namelist_definition_clm4_5.xml - #402 -- Some smaller tests can be slow.. - #411 -- Refactor tools aren't useful anymore - #414 -- PTCLM tests aren't working - #415 -- mkprocdata_map tests aren't working because of bad return statement in script type: bug - other - #418 -- Path needs to be updated for getco2 script type: bug - other - -Known bugs found since the previous tag (include github issue ID): #404, #413, #414 - #404 -- Carbon balance error in decStart test just after new year - #413 -- Currently can't use DAV cluster to make mapping files - #414 -- With change in repo for fates, had to enter username/password four times - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Yes - Lengthen some of the wallclock times. Remove the 1850 test-mods that just change the orbit. - Change some of the compsets tested to cover the science supported compsets. - Allow decStart test modes to ignore errors, so Crop tests can run. Remove a very long debug test. - Add a setting for tput_tolerance for some tests that are shown to have a large variability. - Add a test mod for data assimulation. Remove some of the settings from the pauseResume test - as already done, or tested seperately in the DA test. - -Code reviewed by: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - hobart --- PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - hobart --- PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - hobart --- PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - hobart --- OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev012 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! Because of changes in cism and cime - - Summarize any changes to answers: - - what code configurations: All 2000 compsets and some cases with cism - - what platforms/compilers: All - - nature of change: similar climate - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, rtm, mosart, PTCLM - - cime to cime_cesm2_0_rel_03 (changes answers for 2000 cases because of change to orbit - cism to release-v2.1.01 (changes answers for two fields for NOEVOLVE and more fields for EVOLVE) - PTCLM to PTCLM2_180611 - - rtm and mosart changed to point to cesm2_0 release versions (identical to previous version) - -Pull Requests that document the changes (include PR ids): #398, #400, #407, #408, #417, #394 -(https://github.com/ESCOMP/ctsm/pull) - - #394 -- some final cleanup - #417 -- Make PR template questions less prominent - #408 -- Documentation updates - #407 -- Initial version of templates for contributing, PR's and issues - #400 -- Update CanopyStateType.F90 priority: high type: code cleanup/docs - #398 -- Allow first history tape to have other than one time point per file priority: high type: enhance - science - -=============================================================== -=============================================================== -Tag name: clm5.0.dev012 -Originator(s): sacks (Bill Sacks) -Date: Thu May 17 14:13:34 MDT 2018 -One-line Summary: Fixes for variable_year orbital mode - -Purpose of changes ------------------- - -Fixes for correctness and exact restartability with variable_year -orbital mode: - -(1) Update max day length (max_dayl) each time step, rather than just - updating it once in initialization - -(2) Update to a cime version that has a fix for datm, which updates the - orbital parameters (used for solar zenith angle-based interpolation) - each time step, rather than just once in initialization - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #379 (Problems with Hist decStart restart tests due to variable - orbital year) -- Fixes #260 (max daylength doesn't change over time for varying orbital - parameters) - -CIME Issues fixed (include issue #): -- ESMCI/cime#2598 (datm doesn't restart properly with variable year orbit) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Gave extra time to some tests so they would pass - -Code reviewed by: Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, some baselines fail as expected - - Also verified that this test (reported in #379) now passes: - ERS_D_P36x1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart - - Also verified that the ctsm code changes alone (without the cime - update) have the expected behavior in terms of baseline - passes/fails: - - FAIL SMS_D_Ld10.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE - Enters the second year - PASS SMS_D_Ld1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE - Stays in first year - PASS SMS_Lm1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-ciso_bombspike1963 BASELINE - Stays in first year - -CLM tag used for the baseline comparisons: clm5.0.dev011 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: multi-year runs with HIST compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff/same climate - - Bit-for-bit for runs with fixed orbital parameters (non-HIST - compsets) and for HIST runs that do not span multiple years. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: adds one commit that fixes ESMCI/cime#2598 - -Pull Requests that document the changes (include PR ids): -- #385 (Update max day length (max_dayl) each time step) - -=============================================================== -=============================================================== -Tag name: clm5.0.dev011 -Originator(s): erik (Erik Kluzek) -Date: Wed May 16 20:27:39 MDT 2018 -One-line Summary: 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing - -Purpose of changes ------------------- - -Update ndep file used for fully coupled 1850 cases to one being used in fully coupled -simulations. Update cism to latest release branch: release-v2.1.00. -Update PE layouts for f45, f09, f19. Turn BFBFLAG=TRUE for most CTSM testing. -Fix some issues with tools for batch submission. Remove a write statement for VIC -that was written a ridiculous amount of times. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #) #363 #374 #380 #382 #383: - #363 -- PE Layout - $374 -- Turn BFBFLAG on for testing (so PE layout changes won't appear to change answers) - #382 -- Write statement for VIC - $383 -- mkmapdata intel version - -Known bugs introduced in this tag (include github issue ID): #384 - #384 -- f09 resolution VIC test - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): PE layouts - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): ndep for clm50_cam6 forcing - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Added back tests - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev010 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes for some - - Summarize any changes to answers, i.e., - - what code configurations: all with cism, tests as BFBFLAG on - - what platforms/compilers: all - - nature of change: similar - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism - - cism to release-v2.1.00 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #381 -- 1850 fully coupled ndep update, update cism, update PE layouts, turn BFBFLAG on for testing - -=============================================================== -=============================================================== -Tag name: clm5.0.dev010 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue May 15 03:00:38 MDT 2018 -One-line Summary: Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit - -Purpose of changes ------------------- - -Update externals to version in cesm2.0.beta10. Add in f05 crop datasets. Add pauseResume for DART and a -test for it. Fix several issues required for CESM2.0. Add model_doi_url to history files. - -update cism to very latest -Add model_doi_url to history files -Update rtm, mosart -Changes answers because of change in orbit (for testing orbit was already updated for 1850 so will appear to not change answers) -Using cime5.6.6 - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #68 --- gnu compiler workaround - #364 -- crop f05 datasets - #362 -- svn checkout - #318 -- quadratic bug - #249 -- bypass balance checks for DART - #341 -- add model_doi_url - -CIME Issues fixed (include issue #): - -Known bugs introduced in this tag (include github issue ID): - #379 -- transient end-of-year exact restart issue - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - cime updates: - - manage_testlist was removed. - - Changes to matching behavior in env_mach_specific. - - New option to wait_for_tests. - - case.st_archive now has a --test option. - - New FORCE_BUILD_THREADED. - - New custom script option. - - env_archive.xml - - .case.run.sh file generated for E3SM. - - New selectors allowed for batch directives. - - Source code files beginning in test_ will be ignored in build. - - New prefix attribute available for batch directives. - - xmlquery will now accept derived attributes. - - Users may run on lawrencium lr3/lr2. - - In env_archive.xml. - - (cesm only) create_test and query_testlist now have --supported-only flag - - New allow_error attribute for module systems. - - check_input_data replace --svn-loc with --server and --protocal - - Some Tools with "acme" in the name now say "e3sm". - - env_archive.xml - - .case.run.sh file generated for E3SM. - - New selectors allowed for batch directives. - - Source code files beginning in test_ will be ignored in build. - - New prefix attribute available for batch directives. - - xmlquery will now accept derived attributes. - - Users may run on lawrencium lr3/lr2. - - In env_archive.xml. - - (cesm only) create_test and query_testlist now have --supported-only flag - - New allow_error attribute for module systems. - - check_input_data replace --svn-loc with --server and --protocal - - Some Tools with "acme" in the name now say "e3sm". - - cime_bisect changes. - - New XML variables, PAUSE_ACTIVE_XXX. - - module_lmod no longer a support module type. - - simple-py-prof sets PYTHONPATH for you, list_acme_tests assumes you want - to list tests - - jobid now added to CaseStatus case_submit entry. - -Splits GLC2OCN_RMAPNAME xml variable into - GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for - GLC2OCN_RMAPTYPE - - Better defaults for bless_test_results and compare_test_results. - - New bless_log file in baseline dirs. - - Allow multiple -m args to case.submit. Allows user to put email settings in .cime/config. - - New --retry option to create_test. - - Add --clean-depends to case.build, this argument can take a component list and will - clean all components if one is not provided. - - Some additional output from nl comp code in some cases - - --driver added to create_newcase, new _V$driver testopt. - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): - Crop f05 surface datasets - -Substantial timing or memory changes: Seems to be slower and require more memory - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - pause/resume is still under development. This works for DART DA as needed for CESm2.0 - -Changes to tests or testing: - Added new pauseResume test on cheyenne_intel - Remove some of the higher PE count tests on cheyenne_gnu and replace with cheyenne_intel - Lengthen wallclock for a few of the tests on cheyenne - Change I1850Clm50BgcSpinup test to f09 resolution so it will run - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev009 - - -Answer changes --------------- - -Changes answers relative to baseline: 1850 compsets change because orbit has been changed - - Summarize any changes to answers, i.e., - - what code configurations: 1850 compsets - - what platforms/compilers: all - - nature of change: 1850 orbit rather than 1990 - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, rtm, mosart, cism - - cime to cime5.6.6 - rtm to rtm1_0_66 - mosart to mosart1_0_31 - cism to cism2_1_54 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #377 -- update cime - #376 -- changes needed for DART - #372 -- Update manage_externals - -=============================================================== -=============================================================== -Tag name: clm5.0.dev009 -Originator(s): sacks (Bill Sacks) -Date: Thu May 10 13:48:32 MDT 2018 -One-line Summary: New init_interp method - -Purpose of changes ------------------- - -The main change in this tag is to introduce a new method for -init_interp. This is needed in order for subgrid areas to be the same in -initialization in runs with and without init_interp. - -The choice of init_interp method is controlled by a new namelist -variable, init_interp_method, whose documentation appears below: - - Method to use for init_interp. Only applies when use_init_interp = .true. - - 'general': The general-purpose method that can be used when changing - grids, configurations, etc. This starts off with subgrid areas taken - from the surface dataset. - - 'use_finidat_areas': This starts off with subgrid areas taken from the - input finidat file. This is needed to achieve bit-for-bit results in a - coupled case (where areas in initialization impact initial fields sent - to the atmosphere) (but using the 'general' method will typically have - only a very minor impact on results in this case). For this method to - work, the input finidat file needs to be at the same resolution as the - current configuration. So this is a less general form of - init_interp. However, it can be used when transitioning from a spinup - run to a transient run, or in other cases where the only difference is - in internal memory allocation. In order to catch possible problems, this - uses a different algorithm for finding the input point for each output - point, which ensures that each active output point is associated with - exactly one input point with the same latitude, longitude and type. This - method requires (a) the same grid for input and output, within roundoff; - (b) any non-zero-weight point in the input must have memory allocated - for it in this grid cell in the output (this will be satisfied if the - point is non-zero-weight on the surface dataset or if it's a point for - which we allocate memory even for zero-weight points); (c) any active - point in the output (based on the surface dataset and rules for - determining active points) must have a matching point in this grid cell - in the input. - -This tag also has some other changes: - -- Fixes #347 - endrun message behavior: needed for some of the new unit - tests - -- Fixes #345 - Add a cmip6_evolving_icesheet usermods directory: - unrelated, but folded in here for convenience of testing) - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #346: New mode of operation for init_interp: Copy subgrid areas, too -- #347: endrun message behavior -- #345: Add a cmip6_evolving_icesheet usermods directory - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable - init_interp_method - documented above. Default - behavior is the same as before ('general') - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Added a new test type, similar to LII, that covers the new init_interp behavior -- Removed some no-longer-needed tests with 'interp' testmods - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - tests pass, namelists differ as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - Unexpected baseline failures for these two tests that are in the - expected fail list for other reasons: - FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest - FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest - - Differences are just in some cism fields that I’m not concerned - about: roundoff-level differences in internal_time; big differences - in tempstag, uvel and vvel, but those fields don’t really make sense - in this configuration (and I have removed them in the latest CISM - tag). (Note that I did two runs of each of these tests from my - branch, and for both tests, the two runs had identical cism hist - files, so I don’t think this is a reproducibility problem.) - - -CLM tag used for the baseline comparisons: clm5.0.dev008 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #352 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev008 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Apr 27 13:28:41 MDT 2018 -One-line Summary: With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 - -Purpose of changes ------------------- - -Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #351 -- FATES external to https - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - -Code reviewed by: wweider, rfischer - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev007 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 BGC with FUN on - - what platforms/compilers: All - - nature of change: climate very nearly the same - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - rfisher case -- clm5_nbug_test_case ----- short f45 resolution - oleson case --- clm5_nbug_test_case ----- AD spinup f45 resolution - oleson case --- clm5_nbug_test_casepAD -- Post AD spinup f45 resolution - - URL for LMWG diagnostics output used to validate new climate: - http://webext.cgd.ucar.edu/I1850/clm5_nbug_test_casepAD/lnd/clm5_nbug_test_casepAD.281_300-clm5_nbug_control_casepAD.281_300/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates changed to https form rather than ssh - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #344 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev007 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Apr 24 14:50:19 MDT 2018 -One-line Summary: Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit - -Purpose of changes ------------------- - -Important updates in land-ice model (CISM) version used that changes answers. Fix some initial condition problems -with CLM5.0 cases. Update the FATES version to a new updated science version that hence changes answers. -Change the default orbit for testing of 1850 cases to use 1850 orbit rather than 1990. -Make sure to use f45_f45_g37 and not f45_f45 in test lists. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #313 -- Issues with initial condition files - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New IC file for clm5_0_CRUv7 - CLM5.0 finidat files choosen will be different for both GSWP3.1 and CRUNCEPv7 forcing - -Substantial timing or memory changes: No - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - When the cime version is updated the changes that make the 1850 orbit explicit in testing can be removed - -Changes to tests or testing: 1850 tests explicitly set a 1850 orbit, f45_f45 tests changed to include mask (f45_f45_mg37) - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev006 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes - - Summarize any changes to answers: - - what code configurations: All 1850 tests, all FATES, all with CISM, CLM50 initial conditions - - what platforms/compilers: All - - nature of change: Significant - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, cism - FATES to SCI_1.8.1_API_3.0.0 - cism to cism2_1_49 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #349 -- Update manage externals to manic_v1.1.3 - #348 -- Update FATES science version to 1.8.1, and bring in some answer changes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev006 -Originator(s): sacks (Bill Sacks) -Date: Thu Apr 12 06:16:16 MDT 2018 -One-line Summary: Don't allocate memory for zero-weight natveg patches and urban - -Purpose of changes ------------------- - -We have previously been allocating memory for all urban columns and all -natural veg PFTs, everywhere. In some cases this may still be desired, -but in some cases - and particularly non-transient cases - this is a -waste of memory and performance without any benefit. - -In timing runs of a CONUS test case set up by Mike Barlage, where there -were 2 PFTs per gridcell (bare plus grass), only allocating memory for -the non-zero-weight points (i.e., 2 natural pfts per gridcell and -nothing else) reduced land run time from 56.4 sec to 21.6 sec. - -This tag puts in place a more general solution, avoiding allocating -memory for zero-weight natural PFTs in non-transient runs, and avoiding -allocating memory for zero-weight urban points unless requested with a -namelist flag. - -For non-transient runs, this change improves performance and decreases -memory and restart file size substantially: For short timing runs on -cheyenne_intel at f09_g16 (I haven't looked closely at memory use, but -it probably is about the same reduction as the restart file size): -- I1850Clm50Sp - - 91% of the runtime (i.e., 9.0% reduction in runtime) - - Restart file size is 32% of original (68% reduction) -- I1850Clm50Bgc - - 77% of the runtime (i.e., 23% reduction in runtime) - - Restart file size is 33% of original (67% reduction) -- I1850Clm50BgcCrop - - 80% of the runtime (i.e., 20% reduction in runtime) - - Restart file size is 37% of original (63% reduction) - -(Non-transient cases should also be improved due to the urban change, -but I haven't investigated the improvement there.) - -This tag also fixes some other bugs, as noted below. - -NOTE: This change requires running init_interp on any existing initial -conditions files! In addition, moving forward, init_interp will always -be needed when going from a non-transient to a transient run (this has -already been the case when running with crop; now it will also be the -case when running without crop, too). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #298: Don't allocate memory for zero-weight PFTs and urban - columns -- Fixes #317: c14 bombspike and c13 timeseries code can use the wrong - year, with irreproducible behavior -- Fixes #320: I1850Clm50Sp compset mistakenly uses SGLC - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- You will need to run init_interp on any existing initial conditions - files -- Moving forward, init_interp will always be needed when going from a - non-transient to a transient run (this has already been the case when - running with crop; now it will also be the case when running without - crop, too) - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable: run_zero_weight_urban: If TRUE, run all urban - landunits everywhere where we have valid urban data. This has two - effects: (1) goes back to the previous behavior of allocating memory - for urban nearly everywhere; (2) makes all urban columns active, even - if they have zero weight. This can be used to evaluate potential urban - behavior globally. - -Changes made to namelist defaults (e.g., changed parameter values): -- Use init_interp for all out-of-the-box finidat files - -Changes to the datasets (e.g., parameter, surface or initial files): -- Remove initial conditions for Fates for 1x1 Brazil - -Substantial timing or memory changes: -- Substantial decreases in memory use and improvements in timing: see - notes above. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changed aux_clm Fates tests to use cold start -- Changed the allActive test to be a transient case so that we allocate and run all PFTs - -Code reviewed by: -- Quick review by Erik Kluzek -- Urban change reviewed by Keith Oleson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - Tests pass, namelists differ as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means: tests pass, some baseline failures as expected: - - DIMSIZEDIFF for vector output - - ERI_D_Ld9.f09_g16.I1850Clm50Sp.cheyenne_gnu.clm-default differs - due to fix of #320 - - ERP_D_Ld9.f09_g16.I1850Clm50SpCru.cheyenne_gnu.clm-default differs - because this uses init_interp whereas on master we did not use - init_interp, and this changes answers for this ERP test due to - #330 - - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 - differs due to fix of #317 - - Note: For changed tests (allActive and Fates tests), I ran the new - versions of the tests from clm5.0.dev005 and confirmed that dev006 - is bit-for-bit with dev005 for these changed tests. - -CLM tag used for the baseline comparisons: clm5.0.dev005 - - -Answer changes --------------- - -Changes answers relative to baseline: YES, but only in limited situations - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: see below - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Changes answers in the following situations: - - Vector output is not directly comparable, because dimension sizes - differ - - I1850Clm50Sp cases change substantially due to fix of #320 - - Cases with carbon isotope bombspike change due to fix of #317 - - In some situations, cases that use init_interp now but did not - before can change answers by roundoff due to #330 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #311: Avoid allocating memory for zero-weight natveg patches and urban - -=============================================================== -=============================================================== -Tag name: clm5.0.dev005 -Originator(s): sacks (Bill Sacks) -Date: Tue Apr 10 14:15:52 MDT 2018 -One-line Summary: Two fixes for init_interp - -Purpose of changes ------------------- - -Two fixes for init_interp: - -(1) Copy as many snow layers as possible in init_interp - - In most cases, we only need data from the existing snow layers. But in a - few cases - in particular, the flx_abs* variables - we need data even - from non-existing snow layers in order for interpolation to be - bit-for-bit. The change here reworks snow interpolation so that, in - addition to copying the existing snow layers, we also copy as many - non-existing snow layers as will fit in the destination layer structure. - - Fixes #326 - -(2) For glcmec, match col/patch types in some cases - - If glcmec used the same elevation class definitions in input and output, - then match classes as we do for most landunit types, rather than just - using topographic heights. (An exception is output cells with the - single_at_atm_topo behavior, because their types could change once we - enter the run loop.) - - Fixes #325 - -The new behavior is covered by unit tests. This tag also expands some -unit testing infrastructure to facilitate the addition of some of these -unit tests. - -I have confirmed that this test passes: -LII_D_Ld9.f09_g16.I1850Clm50SpCru.hobart_intel.clm-default, when I point -to an initial conditions file that I generated from the dev 002 tag -(because I wasn't sure if the current default initial conditions file -was exactly compatible with the latest master). Before the changes in -this tag, that test was failing. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #326: init_interp can change answers for absorbed radiation in - non-existent snow layers -- #325: init_interp can change answers over the CISM domain - -Known bugs introduced in this tag (include github issue ID): -- #339: cheyenne_gnu restart test fails exact restart comparison sporadically - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, baselines fail as expected (baseline failures - just for tests that use init_interp) - -CLM tag used for the baseline comparisons: clm5.0.dev004 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all configurations with use_init_interp = .true. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff / same climate - - Differences arise due to both fixes listed above. - - (1) Copy as many snow layers as possible in init_interp: It - appears that this only changes answers for some radiation - terms in the first time step after initialization when a snow - layer had just melted before the restart file was written. In - this case, the flx_abs* variables are set differently for this - just-disappeared layer. This can affect a lot of grid cells, - but I expect differences from this change to be very small and - not scientifically important. - - (2) For glcmec, match col/patch types in some cases: This seems to - only affect a small number of grid cells in Greenland. So I do - not expect the overall effect on a simulation to be significant. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #328: fixes for init_interp - -=============================================================== -=============================================================== -Tag name: clm5.0.dev004 -Originator(s): erik (Erik Kluzek) -Date: Mon Apr 9 00:20:03 MDT 2018 -One-line Summary: List of important bug fixes - -Purpose of changes ------------------- - -A list of important bug and usability fixes. One of those changes makes it easier for the user to end up with -initial condition files that don't match the start date of their simulation. This is problematic because of the -saved counters for prognostic crop. For sure a mismatched date will end up with bad results for the first season, -but this will also affect subsequent years running averages. So we don't recommend that you do that. - -Jim Edwards also brought in some changes for PIO for 64bit_data, and to fix fill values for integer data. And we updated -manage_externals to the newest version. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -#213 -- usability issue for CPLHIST that Keith found. -#210 -- Recent request to increase number of tapes to 10. -#169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. -#68 --- workaround for gnu compiler bug -#46 --- needed for multi-instance -#66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work -#65 --– need to change a check from "> 0" to "> [small val]" -#240 -- from Jim -#255 -- get PTCLM working -#253 -- bad clm40 IC file - -Known bugs introduced in this tag (include github issue ID): - #329 -- init_interp doesn't work if finidat points to finidat_interp_dest from a different case - #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers - #325 -- init_interp can change answers over the CISM domain - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - You can bypass the ignore_ic_date error when crop is being used - Matching for initial conditions for crop simulations are allowed to ignore the month/day - When crop is on and the start date doesn't match the date for the initial conditions file, - the counters for the crop model will be incorrect -- and hence the first season will be screwed - up, and the screwed up results will affect the running averages for the future. This was a condition - that we didn't allow you to easily do -- we've made it easier for this to happen now. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - Allow ten streams of history tapes rather than just six. - Correct the I1850Clm50BgcSpinup compset - You can bypass the ignore_ic_date error when crop is being used (may affect results) - Matching for initial conditions for crop simulations are allowed to ignore the month/day - The precision control settings for Nitrogen and Carbon are now making it to the namelist - -Changes made to namelist defaults (e.g., changed parameter values): ncrit=1.d-8 (10X looser) - -Changes to the datasets (e.g., parameter, surface or initial files): Correct to a few finidat files (clm4_0_CRUv7) - -Substantial timing or memory changes: Maybe 3% to memory - - There is a 3% increase to memory, but memory high water mark seems to double - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - Added aux_cime_baseline tests - add cplhist test - Add edison to fates testlist - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev003 - - -Answer changes --------------- - -Changes answers relative to baseline: no but, there are some specific potential or small apparant change to answers - in terms of the test suite - 3 fields have a different missing value pattern: landmask, pftmask, nbedrock - roundoff difference in F_N2O_DENIT due to #65 - LVG_Ld5_D.f10_f10.I1850Clm50Bgc.cheyenne_intel.clm-no_vector_output - landmask was different for two cases: - ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): manic - manage_externals to manicv1.0.2 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #337 Update manage_externals to manicv1.0.2 - #333 Important fixes - #241 Add support for 64bit_data, fix fillvalues - -=============================================================== -=============================================================== -Tag name: clm5.0.dev003 -Originator(s): erik (Erik Kluzek) -Date: Fri Mar 9 00:34:04 MST 2018 -One-line Summary: Bug fixes for energy imbalance associated with surface water and lakes - -Purpose of changes ------------------- - -These are bug fixes for the land energy imbalance over land as determined by coupler diagnostics. -They include bug fixes for surface water phase change and lake/snow interactions developed by -Sean Swenson and Keith Oleson. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #304 - #304 -- Energy imbalance over land per coupler diagnostics - -Known bugs introduced in this tag (include github issue ID): [If none, remove this line] - #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior - #313 -- Problems with CLM5 initial conditions files - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - There is some dupliciation in calculations by level that could be consolidated - For example, the calculation of c1. - There is a check for ffrac_sno(c) > 0, that probably should be greater than a small value - -Changes to tests or testing: none - -Code reviewed by: self, sacks, swensosc - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev002 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 and clm5_0 - - what platforms/compilers: all - - nature of change: climate similar - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461 - - username: oleson - - machine: cheyenne - - URL for LMWG diagnostics output used to validate new climate: - -http://webext.cgd.ucar.edu/I1850/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850/lnd/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461-clm50_r272_1deg_GSWP3V1_iso_1850.1443_1461/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #307 -- Bug fixes for energy imbalance associated with surface water and lakes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev002 -Originator(s): sacks (Bill Sacks) -Date: Sun Feb 25 06:53:36 MST 2018 -One-line Summary: Add some land ice diagnostic vars needed for CMIP6 - -Purpose of changes ------------------- - -Add some diagnostic variables needed for analyzing land ice that have -been requested by some of the MIPs in CMIP6 (especially ISMIP). - -Also, fixes c2l_scale_type to fix urban scaling for SNOWICE, SNOWLIQ - -Some changes from Leo van Kampenhout. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- https://github.com/ESCOMP/ctsm/issues/271 Add some land ice fields for cmip6 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self, Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, answer changes as expected, as noted below - -CLM tag used for the baseline comparisons: clm5.0.dev001 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - just changes the diagnostic fields SNOWICE, SNOWLIQ, due to - fixed c2l_scale_type for these fields - - - The test - ERP_P72x2_Ly3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-irrig_o3_reduceOutput - also showed small answer changes just in the cpl field - l2x_Sl_tsrf00, for a single grid cell in Antarctica - (221.485144932008 vs. 221.485144910486). However, I reran it 10 - times, and it was bit-for-bit (other than SNOWICE and SNOWLIQ) in - all 10 of those re-runs. So I'm chalking this up to a machine - fluke. (The restart file from the problematic run showed diffs in - a bunch of fields; from spot-checking one - SNOW_DEPTH - diffs - were just in one point. But since this is a reduceOutput run, - diffs didn't show up in CLM history files. I confirmed that there - were no diffs in finidat_interp_dest or in namelists.) I - regenerated baselines for this test using one of the cases without - this machine fluke. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#303 - Snow integrated temperature -#306 - Add some land ice diagnostic variables needed for cmip6 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev001 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Feb 14 14:14:34 MST 2018 -One-line Summary: Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM - -Purpose of changes ------------------- - -Fix problem with default LND_TUNING_MODE for cases coupled to CAM. Update some of the README -files. And also bring in a PTCLM version that will work in the new CTSM git checkout directory -structure. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -#255 PTCLMmkdata doesn't work in the CLM git checkout - -Known bugs found in this tag (include github issue ID): - -#262 hirespft option for mksurfdata.pl doesn't work - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: doc - -PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - PASS - - Extra Tests: - -ERS_Ld5.f19_g17.E1850L45TEST.cheyenne_intel.cice-default -SMS_Ld1.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist1d -SMS_Ld7.f09_g17.B1850.cheyenne_intel.allactive-defaultio - -CLM tag used for the baseline comparisons: clm5.0.dev000 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): PTCLM - PTCLM to PTCLM2_180214 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#297 -- README files -#296 -- Make LND_TUNING_MODE correct and consistent when coupled with CAM -#295 -- Bring in a working PTCLMmkdata version -#261 -- Reorder links - -=============================================================== -=============================================================== -Tag name: clm5.0.dev000 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Feb 05 2018 -One-line Summary: Initial version of CLM5.0 - -This is the initial science version of CLM5.0. - -Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly -notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop -modeling. -The updates to CLM science are documented here: - -https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 - -This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary -versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, -and future scenarios. - -Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution -(fv 0.9x1.25 with g1xv6 ocean mask). - -=============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index 79e7b0b4fd..0bf3bd0426 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,8 @@ Tag Who Date Summary ============================================================================================================================ release-clm5.0.05 erik 08/05/2018 Update 1850 ndep file, and last year for transient streams + ctsm1.0.dev007 sacks 08/05/2018 Avoid glacier dynamic landunit adjustments in first time step + ctsm1.0.dev006 sacks 08/04/2018 Minor bug fixes, cleanup, documentation and enhancements release-clm5.0.04 erik 07/18/2018 Fix some NFIX variables, update cime/cism for upgraded hobart new glade, new diagnostic fields, update cmip6 output ctsm1.0.dev004 erik 07/18/2018 Add some new diagnostic fields, fix a few issues, update cmip6 output ctsm1.0.dev003 erik 07/15/2018 Update cime/cism to work on upgraded hobart and with glade changes on cheyenne @@ -523,518 +525,3 @@ release-clm5.0.01 erik 05/22/2018 First release branch tag for CESM2.0 relea clm3_5_02 mvertens 05/22/2007 put in hourly coupling with sequential driver clm3_5_01 erik 05/16/2007 Move newcn06 branch to trunk clm3_5_00 erik 05/03/2007 New surface datasets, improved canopy integration, and various improvements to Hydrology -||||||| merged common ancestors - clm5.0.dev012 sacks 05/17/2018 Fixes for variable_year orbital mode - clm5.0.dev011 erik 05/16/2018 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing - clm5.0.dev010 erik 05/15/2018 Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit - clm5.0.dev009 sacks 05/10/2018 New init_interp method - clm5.0.dev008 erik 04/27/2018 With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 - clm5.0.dev007 erik 04/24/2018 Bring in a few answer changing things: FATES, cism updates, IC file fix, - testing 1850 compset use 1850 orbit - clm5.0.dev006 sacks 04/12/2018 Don't allocate memory for zero-weight natveg patches and urban - clm5.0.dev005 sacks 04/10/2018 Two fixes for init_interp - clm5.0.dev004 erik 04/09/2018 List of important bug fixes - clm5.0.dev003 erik 03/09/2018 Bug fixes for energy imbalance associated with surface water and lakes - clm5.0.dev002 sacks 02/25/2018 Add some land ice diagnostic vars needed for CMIP6 - clm5.0.dev001 erik 02/14/2018 Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM - clm5.0.dev000 erik 02/05/2018 Double tag of clm5.0.000 with new naming convention, some updated documentation - clm5.0.000 erik 02/05/2018 Double tag of clm4_5_18_r275 for clm5.0 release - clm4_5_18_r275 erik 02/05/2018 Update initial condition files, update fates, new CMIP6 pop-dens, more lnd_tuning_mod options, updated ndep for fully coupled - clm4_5_18_r274 sacks 01/30/2018 Fix auto-detection of CIME_MODEL in a standalone checkout - clm4_5_18_r273 sacks 01/26/2018 Support a standalone checkout from git - clm4_5_18_r272 erik 01/25/2018 Bring in latest FATES release version to CLM trunk: fates_s1.4.1_a3.0.0_rev2 - clm4_5_18_r271 erik 01/20/2018 Update testlist to v2 and remove yellowstone - clm4_5_18_r270 sacks 12/20/2017 Always use multiple elevation classes for glacier, even with stub glc - clm4_5_18_r269 erik 12/16/2017 Move externals to version in github - clm4_5_18_r268 erik 12/11/2017 Fix calculation of stomatal resistence used in dry-deposition, increase threshold of totvegc for soil decomposition to 0.1 - clm4_5_18_r267 sacks 12/07/2017 Fixes to accumulator fields - clm4_5_17_r266 sacks 11/27/2017 Avoid negative snow densities - clm4_5_17_r265 erik 11/18/2017 Update the clm50 parameter file for better behavior with prognostic crop, and fix a bug in clm50 urban model - clm4_5_17_r264 erik 11/16/2017 Changes from Dave Lawrenece on resetting soil carbon for spinup - clm4_5_17_r263 erik 11/08/2017 Drydep vel. for SO2 doubled, influence of organic mater in soil calmed, max daylength not hardwired to present day - clm4_5_16_r262 sacks 10/27/2017 Rename atm2lnd history fields for downscaled fields, properly turn on vic for clm45, and other minor fixes - clm4_5_16_r261 sacks 10/25/2017 Add option to reset snow over glacier columns - clm4_5_16_r260 erik 10/24/2017 Update paramater file for CLM50 as well as fates, fix a few issues - clm4_5_16_r259 erik 10/17/2017 Update to latest cime from cesm2_0_beta07 and config_components version 3 - clm4_5_16_r258 erik 10/06/2017 Revert change to fire, set n_melt_glcmec=10, update mosart to version that doesn't accumulate water in short rivers - clm4_5_16_r257 erik 09/29/2017 Fix two bugs found by Hui Tang, one for Carbon isotopes and one in the fire model - clm4_5_16_r256 erik 09/20/2017 Fresh snow grain radius is temperature dependent - clm4_5_16_r255 erik 09/18/2017 Changes to crop and enabling Carbon isotopes for crop and some miscellaneous small changes - clm4_5_16_r254 erik 09/01/2017 Update surface datasets, and point to new CMIP6 population density dataset - clm4_5_16_r253 erik 08/04/2017 Check on reasonable import/export from CLM, check ndep units from input file - clm4_5_16_r252 erik 07/24/2017 Update parameter file for some crop albedo issues, and fix a bug in urban albedo for nightime - clm4_5_16_r251 erik 07/14/2017 Update mksurfdata_map for soil depth/color, add new mapping files - clm4_5_16_r250 erik 07/13/2017 Update finundation dataset, new fsurdat files with updated soil color and soil depth, - update mosart areas, fix cheyenne_gnu - clm4_5_16_r249 sacks 07/06/2017 All new compsets, reworked test lists, and related fixes - clm4_5_16_r248 sacks 06/28/2017 Melt most ice runoff - clm4_5_16_r247 sacks 06/26/2017 New GLACIER_REGION field with CISM domain split in two - clm4_5_16_r246 sacks 06/14/2017 Update to latest cime - clm4_5_16_r245 sacks 06/14/2017 Only adjust glc_mec topographic heights if glc_do_dynglacier is true - clm4_5_16_r244 erik 06/09/2017 Update cime and cism externals, changes answers for IG compsets, test g17 grids, fix a few - issues, update mksurfdata_map - clm4_5_16_r243 andre 05/23/2017 History output cleanup from Dave Lawrence - clm4_5_16_r242 erik 05/21/2017 Use finundated streams for CLM50, and use ndep if it comes from cpl - clm4_5_16_r241 sacks 05/16/2017 Fix ch4 subtle dependence on processor count - clm4_5_16_r240 sacks 05/15/2017 Make glc_dyn_runoff_routing real-valued - clm4_5_16_r239 sacks 05/13/2017 Avoid division by zero in snow WindDriftCompaction - clm4_5_16_r238 andre 05/13/2017 ED is now an external library 'fates' - clm4_5_16_r237 erik 05/09/2017 Latest parameter file and some changes for CLM50, CLM45-transient changes answers also - clm4_5_15_r236 erik 05/01/2017 New surface datasets, and landuse.timeseries files, as well as interpolating initial conditions for - almost all cases - clm4_5_15_r235 sacks 04/27/2017 Zero dynbal fluxes if namelist variable is set - clm4_5_15_r234 andre 04/14/2017 Update rtm and mosart externals - clm4_5_15_r233 erik 04/11/2017 Pull out some constants and options to namelist - clm4_5_15_r232 erik 04/05/2017 Some small changes that affect both clm4_5 and clm5_0 answers (can be considered bug fixes to clm4_5) - clm4_5_14_r231 sacks 04/02/2017 Add option to reset snow pack over non-glacier columns - clm4_5_14_r230 sacks 03/31/2017 Fix dynamic landunits water and energy conservation - clm4_5_14_r229 erik 03/10/2017 Update cime and make some changes to drv_flds_in namelist, fix some minor bugs - clm4_5_14_r228 erik 03/07/2017 Bring in changes that were accidentally dropped as part of the clm4_5_14_r226 tag - clm4_5_14_r227 sacks 03/06/2017 Improve performance of dynamic landunits code - clm4_5_14_r226 erik 03/02/2017 Update cime, mosart and ccism to a version that is cesm2_0_beta05 or part of beta06 - clm4_5_14_r225 sacks 02/19/2017 Fix GDD accumulation in new crop columns - clm4_5_14_r224 sacks 02/10/2017 Tweaks for glaciers and snow - clm4_5_14_r223 sacks 02/03/2017 Handle patch-level C&N variables correctly with dynamic landunits - clm4_5_14_r222 sacks 01/27/2017 Fix energy budget bug with fractional snow on glacier and wetland columns - clm4_5_14_r221 sacks 01/24/2017 Change rain-snow partitioning and ice albedo for glacier columns - clm4_5_14_r220 sacks 01/22/2017 Fix crop seeding - clm4_5_14_r219 erik 01/21/2017 Answer changes for CLM50 for several issues that lead to dead crops - clm4_5_14_r218 sacks 01/13/2017 For newly initiating columns: do not copy snow state - clm4_5_14_r217 sacks 01/13/2017 Bug fix for snow radiation absorption - clm4_5_14_r216 erik 01/12/2017 Fix previous broken tag - clm4_5_14_r215 erik 01/12/2017 Update mksurfdata_map to work with new updated datasets from Peter, and use hand-edited - surfdata/landuse.timeseries datasets for f09/f19 - clm4_5_14_r214 sacks 01/03/2017 Update column states based on dwt terms between dyn_cnbal_patch and dyn_cnbal_col, and minor fixes - clm4_5_14_r213 sacks 12/30/2016 Convert buildnml to python - clm4_5_14_r212 sacks 12/22/2016 Bump science version number due to changes in clm4_5_13_r211 - clm4_5_13_r211 sacks 12/22/2016 Apply transient land cover and harvest all at once in first time step of year - clm4_5_13_r210 sacks 12/17/2016 Update cime to cesm2_0_beta04 version - clm4_5_13_r209 sacks 12/11/2016 Change definition of NBP; bring back some r205 changes that were lost in r207 - clm4_5_13_r208 sacks 12/10/2016 Rework irrigation; remove glc_smb logical - clm4_5_13_r207 andre 12/08/2016 PHS - Calculate separate root water uptake resistances for soil and root pathways - clm4_5_13_r206 andre 11/29/2016 Bugfix for Luna causing arctic to die - clm4_5_13_r205 sacks 11/16/2016 Add diagnostics for snow and glacier; fix crash in Megan - clm4_5_13_r204 erik 11/15/2016 A few answer changing bug fixes - clm4_5_12_r203 sacks 11/10/2016 Bug fixes for snow-on-lake - clm4_5_12_r202 sacks 11/09/2016 Update to cime version used in cesm2_0_beta03 - clm4_5_12_r201 sacks 11/09/2016 Rework initialization of transient weights - important with use_init_interp - clm4_5_12_r200 erik 11/08/2016 Latest parameter updates from simulations, ignore surface soil layer for plant hydraulic stress - for greater variability in surface soil moisture - clm4_5_12_r199 sacks 10/29/2016 Use CISM2 by default - clm4_5_12_r198 sacks 10/20/2016 Rework mapping of irrigation from CLM to ROF - clm4_5_12_r197 erik 10/14/2016 Some cleanup for plant hydraulic stress and adding more namelist parameters - clm4_5_12_r196 erik 09/27/2016 Bring new cime5 to clm trunk - clm4_5_12_r195 sacks 09/18/2016 Remove dependence on column weights in fire code - clm4_5_12_r194 sacks 09/01/2016 Dribble annual dyn landunit adjustment fluxes; initialize water state for new crop columns - clm4_5_12_r193 andre 08/30/2016 Bugfix in BalanceCheckMod: revert tolerance change and removal of endrun call introduced in r192 - clm4_5_12_r192 andre 08/27/2016 ED bugfixes and initial refactoring for a standalone library - clm4_5_12_r191 sacks 08/21/2016 New parameterizations for snow overburden compaction and wind drift compaction - clm4_5_12_r190 sacks 08/20/2016 Fix snow capping bug - clm4_5_11_r189 erik 08/18/2016 Bring in time varying streams for urban data (currently triggers AC use) - clm4_5_11_r188 erik 08/05/2016 A set of small answer changing issues for both clm45 and clm50 - clm4_5_10_r187 erik 07/26/2016 CLM45/50 changes: seperate carbon and water root profile, turn off undercanopystability, - really turn PHS on, LUNA predict sunlit fraction N fractionation - clm4_5_9_r186 sacks 07/13/2016 Initialize biogeochem balance checks AFTER column area updates - clm4_5_9_r185 sacks 07/07/2016 Revert glacial melt behavior to the old treatment for mountain glaciers - clm4_5_9_r184 erik 07/06/2016 CLM50 changes: Atkin form of lmr changed, new parameters and files, turn PHS on by default, - new cold snow density, reseed at exit AD spinup, fix fire bug, fix npool and cpool errors - clm4_5_9_r183 erik 07/02/2016 Decomposition is not water limited after reaching a field capacity parameter (maxpsi_hr) - rather than only at soil saturation - clm4_5_8_r182 erik 06/24/2016 Bring in option for plant hydraulic stress for clm50 - clm4_5_8_r181 erik 06/17/2016 Update cime version which fixes several issues and changes answers - clm4_5_8_r180 sacks 06/06/2016 Refactor dyn_cnbal_patch - clm4_5_8_r179 sacks 05/27/2016 Update column-level BGC state variables with dynamic landunits - clm4_5_8_r178 sacks 04/17/2016 Remove some consistency checks, and merge crop_prog with use_crop in code - clm4_5_8_r177 sacks 04/14/2016 Move CN product pools to gridcell level - clm4_5_8_r176 sacks 04/13/2016 Calculate active flags and filters earlier in initialization - clm4_5_8_r175 sacks 04/09/2016 For glc_mec, change downscaling and where SMB is computed - clm4_5_8_r174 erik 03/25/2016 Bring Rosie's respiration changes to the trunk - clm4_5_8_r173 sacks 03/17/2016 Major refactor of CN Products - clm4_5_8_r172 sacks 03/08/2016 Exclude land use and product pools / fluxes from CN summary diagnostics - clm4_5_8_r171 erik 03/02/2016 Backout COMP_RUN_BARRIERS setting, and remove all ED tests from testlist (as they all fail) - clm4_5_8_r170 sacks 02/28/2016 Add a wrapper for CN Vegetation - clm4_5_8_r169 erik 02/23/2016 Add fire several fire constants to namelist, add some new clm45/50 surface datasets - clm4_5_8_r168 sacks 02/20/2016 Fix zero methane production - clm4_5_7_r167 sacks 02/20/2016 Fix carbon isotopes in transient runs - clm4_5_7_r166 sacks 02/02/2016 Infrastructure for carbon and nitrogen conservation with dynamic landunits - clm4_5_7_r165 sacks 01/29/2016 Remove fglcmask, recreate all surface datasets - clm4_5_7_r164 erik 01/12/2016 Update CIME and MOSART - clm4_5_7_r163 sacks 12/23/2015 Improve crop performance by allocating less memory - clm4_5_7_r162 andre 12/18/2015 negative runoff updates. - clm4_5_6_r161 sacks 12/17/2015 Collapse mountain glaciers to a single elevation class - clm4_5_6_r160 sacks 12/11/2015 For glc_mec, get gridcell topographic height from atm - clm4_5_6_r159 erik 12/10/2015 Update CIME version - clm4_5_6_r158 andre 12/04/2015 misc clm 5.0 bugfixes - clm4_5_6_r157 sacks 11/27/2015 Reduce memory use for init_interp - clm4_5_6_r156 sacks 11/24/2015 Fix QSNWCPICE and glacial inception - clm4_5_6_r155 erik 11/23/2015 Bring FUN (Fixation and Uptake of Nitrogen) code option to trunk - from Mingjie, as well as latitude varying spinup from Charlie, - and a fix for crop with dynamic roots from Beth - clm4_5_6_r154 andre 11/18/2015 one year grain product pool - clm4_5_6_r153 sacks 11/17/2015 Fix snow cover fraction bug - clm4_5_5_r152 sacks 11/17/2015 Fix glc_mec energy conservation bug - clm4_5_4_r151 erik 11/13/2015 Fix broken r150 tag, with bgc_spinup issue in it - clm4_5_4_r150 erik 11/13/2015 Some needed answer changing fixes for: fire, disallow - negative photosynthis, and reduce LAI of DBT in evergreen state - clm4_5_3_r149 sacks 11/08/2015 Change cold start initialization of snow pack - clm4_5_3_r148 sacks 11/07/2015 For CLM5, increase max snow depth to 20 m - clm4_5_3_r147 andre 11/05/2015 swenson bedrock and coupler runoff bugfixes - clm4_5_3_r146 sacks 11/04/2015 Implement vertical interpolation in init_interp - clm4_5_3_r145 andre 11/03/2015 update clm50 defaults, enable clm50 crop compsets - clm4_5_3_r144 sacks 10/27/2015 Better fix for bug that leads to infinite growth in snow depth - clm4_5_3_r143 andre 10/22/2015 flexibleCN and luna bugfixes. - clm4_5_3_r142 sacks 10/19/2015 Fix bug in initialization of 12-layer snow pack - clm4_5_3_r141 sacks 10/19/2015 Fix bug that leads to infinite growth in snow depth - clm4_5_3_r140 andre 10/15/2015 mosart direct to ocean runoff - clm4_5_3_r139 andre 10/13/2015 dynamic roots from Beth Drewniak - clm4_5_3_r138 andre 10/11/2015 new accelerated spinup and soil vertical structure - clm4_5_3_r137 erik 10/09/2015 Bring in changes for fire-emissions as well tuning changes to the fire model to be used with clm5_0 - clm4_5_3_r136 andre 10/08/2015 coupler field prep for mosart and externals update - clm4_5_3_r135 sacks 10/06/2015 Substantial reduction in memory allocation for prognostic crops - clm4_5_3_r134 sacks 10/04/2015 Fixes for transient and preindustrial crop cases - clm4_5_3_r133 andre 10/02/2015 Bugfix for mksurfdata_map - add file missed by clm4_5_2_r125. - clm4_5_3_r132 andre 10/02/2015 Modify soil BGC diffusion and cryoturbation code to allow for spatially variable soil thickness. - clm4_5_3_r131 sacks 09/30/2015 Bring in cime3 - clm4_5_3_r130 andre 09/28/2015 add namelist option to reduce lake evaporation and irrigation when river water storage falls below a threshold value, and add an additional constraint on stress deciduous leaf onset. - clm4_5_3_r129 andre 09/25/2015 bump tag revision number because clm4_5_2_r128 was climate changing. - clm4_5_2_r128 andre 09/24/2015 science bugfixes (not bfb) for root fraction and bedrock thermal properties - clm4_5_2_r127 sacks 09/18/2015 Fix interpolation of initial conditions for glc_mec and crop <-> non-crop - clm4_5_2_r126 andre 09/17/2015 New decomp_depth_efolding value for clm5.0, set as a namelist parameter instead of netcdf params file. - clm4_5_2_r125 andre 09/15/2015 clm 50 hydrology updates. - clm4_5_2_r124 sacks 09/13/2015 Wind-dependent snow density - clm4_5_2_r123 sacks 09/10/2015 Fix some problems with pgi and nag compilers - clm4_5_2_r122 sacks 09/09/2015 Update to latest cime - clm4_5_2_r121 sacks 09/04/2015 Rework snow capping - clm4_5_1_r120 andre 08/29/2015 CLM 5 nitrogen models Flexible CN and LUNA - clm4_5_1_r119 erik 08/26/2015 Bring hobart/nag bug fixes to trunk, and fix a few bugs - clm4_5_1_r118 sacks 08/05/2015 Minor rework of glc coupling fields - clm4_5_1_r117 sacks 07/28/2015 Repartition rain vs. snow from atmosphere - clm4_5_1_r116 sacks 07/22/2015 Rename some history fields - clm4_5_1_r115 sacks 07/15/2015 Remove redundant code, rename a variable - clm4_5_1_r114 sacks 07/10/2015 Update cime external, remove genf90-generated files - clm4_5_1_r113 sacks 07/09/2015 Support backwards compatibility of restart variable names - clm4_5_1_r112 oleson 07/01/2015 Justin Perket snow on vegetation - clm4_5_1_r111 sacks 06/12/2015 Remove temporary hack to get bfb results in InitSnowLayers - clm4_5_1_r110 sacks 06/12/2015 Add flexibility to have more snow layers - clm4_5_1_r109 sacks 06/06/2015 Fix bug in DivideSnowLayers - clm4_5_1_r108 andre 05/29/2015 Crop changes from Sam Levis - clm4_5_1_r107 andre 05/19/2015 Update externals to use github version of cime1.0.7. - clm4_5_1_r106 erik 05/14/2015 Fix CO2 forcing for MEGAN - clm4_5_1_r105 erik 04/16/2015 Move test lists to beneath active components, change build scripts from cshell to perl, move to new cime directory structure - clm4_5_1_r104 erik 01/27/2015 Update externals to latest cesm beta tag + bring in shared build for clm4_5/clm5_0 for testing - clm4_5_1_r103 sacks 01/01/2015 enable transient crops - clm4_5_1_r102 sacks 12/27/2014 make new input datasets to support transient crops - clm4_5_1_r101 sacks 12/09/2014 rework cold start initialization for transient runs - clm4_5_1_r100 sacks 12/03/2014 update pio calls to pio2 API - clm4_5_1_r099 sacks 12/02/2014 add ozone stress code from Danica Lombardozzi - clm4_5_1_r098 sacks 11/29/2014 update externals to cesm1_3_beta14 or beyond - clm4_5_1_r097 mvertens 11/24/2014 major refactorization to introduce new soilbiogeochem data types and routines that are independent of either ED or CN datatypes - clm4_5_1_r096 erik 11/19/2014 Several answer changing bug-fixes: snow grain size, lake hydrology, default settings, organic soil - clm4_5_1_r095 andre 11/10/2014 N comp refactoring by Jinyun Tang (LBL) and transpiration sink isolation by Gautam Bisht (LBL) - clm4_5_1_r094 sacks 11/07/2014 misc. glacier-related updates - clm4_5_1_r093 sacks 11/07/2014 change cold-start snow initialization, update cism external - clm4_5_1_r092 muszala 11/04/2014 bug fixes from santos that address valgrind problems. update rtm external - clm4_5_1_r091 muszala 10/27/2014 update externals. fix bug so CLM runs with Intel 14x. - clm4_5_1_r090 sacks 10/16/2014 modularize irrigation; do some unit test rework - clm4_5_1_r089 erik 10/13/2014 Bring new urban building temperature to trunk as a clm5.0 feature as well as human-stress index calculations - clm4_5_1_r088 muszala 10/01/2014 pull out ED deps. in TemperatureTypeMod, can now compile with pgi 14.7 - clm4_5_1_r087 erik 09/30/2014 Fix two balance check errors, and turn abort for balance check back on to appropriate levels - clm4_5_1_r086 muszala 09/25/2014 critical ED modifications from r fisher, fix bug 2043 - clm4_5_1_r085 sacks 09/19/2014 replace conditionals with polymorphism for soil water retention curve - clm4_5_1_r084 sacks 09/18/2014 make glc_dyn_runoff_routing spatially-varying, based on input from glc - clm4_5_1_r083 muszala 09/17/2014 only update scripts and run new baselines. this due to an error in yellowstone pgi test naming (clm_aux45 changed to aux_clm45) - clm4_5_1_r082 muszala 09/11/2014 Merge in a number of ED changes to address science bugs and infrastructure (partiulararly restarts) - clm4_5_1_r081 mvertens 08/24/2014 major infrastructure changes and directory reorganization under src - clm4_5_1_r080 erik 08/16/2014 Update externals to trunk version, allow eighth degree as a valid resolution - clm4_5_1_r079 andre 07/31/2014 G. Bisht (LBL) soil temperature refactor; machines update for goldbach-intel - clm4_5_1_r078 muszala 07/23/2014 add lai stream capability and the ability to run with V5 cruncep data - clm4_5_1_r077 andre 07/10/2014 Refactor from Jinyun Tang (LBL) to make hydrology more modular. - clm4_5_1_r076 erik 07/07/2014 Answer changes for fire code from Fang Li - clm4_5_75 muszala 05/30/2014 update externals to rtm1_0_38 and esmf_wrf_timemgr_140523 - clm4_5_74 sacks 05/28/2014 misc. bfb changes - see detailed summary below - clm4_5_73 erik 05/28/2014 Add the stub ability for clm5_0 physics to CLM build system - clm4_5_72 muszala 05/05/2014 Introduce code for Ecosystem Demography (CLM(ED)) Model - clm4_5_71 sacks 05/02/2014 2-way feedbacks for glacier, veg columns compute glacier SMB, and related changes - clm4_5_70 muszala 04/18/2014 bring in SHR_ASSERT macros - clm4_5_69 andre 03/18/2014 start unit testing build-namelist - clm4_5_68 erik 03/07/2014 Update scripts to version that turns on transient CO2 streams for transient compsets, and update CISM (changes answers) - clm4_5_67 mvertens 03/06/2014 removed initSurfAlb as part of the initialization - clm4_5_66 mvertens 03/03/2014 refactoring of initialization and introduction of run-time finidat interpolation - clm4_5_65 mvertens 02/25/2014 Turn off MEGAN vocs when crops is running - clm4_5_64 muszala 02/19/2014 fix and clean ncdio_pio.F90.in. clean clm_time_manager. update externals. - clm4_5_63 sacks 02/14/2014 add some code needed for dynamic landunits; activate 0-weight veg landunit sometimes - clm4_5_62 erik 02/10/2014 Get PTCLM working robustly, US-UMB test working, add CO2 streams to datm, add more consistency testing between compsets and user settings - clm4_5_61 sacks 02/04/2014 add 3-d snow history fields; continue harvest past end of pftdyn timeseries - clm4_5_60 andre 01/30/2014 refactor build-namelist - clm4_5_59 sacks 01/22/2014 use new get_curr_yearfrac function in clm_time_manager - clm4_5_58 sacks 01/22/2014 major refactor of transient pft code, in prep for dynamic landunits - clm4_5_57 sacks 01/07/2014 change CNDV water conservation to use the pftdyn method - clm4_5_56 sacks 01/02/2014 update scripts external to fix I20TRCLM45BGC compset - clm4_5_55 sacks 12/27/2013 add hooks to Sean Santos's unit test frameworks, and begin to add CLM unit tests - clm4_5_54 sacks 12/27/2013 update externals to cesm1_3_beta06 - clm4_5_53 muszala 12/19/2013 refactor restart interfaces - clm4_5_52 sacks 11/26/2013 turn on longwave radiation downscaling for glc_mec by default - clm4_5_51 sacks 11/26/2013 rework downscaling of atm fields for glc_mec - clm4_5_50 erik 11/24/2013 Bring in a bunch of b4b bugfixes, fix getregional script, start move of PTCLM to PTCLMmkdata tool - clm4_5_49 muszala 11/16/2013 swenson anomaly forcing - part 1 - clm4_5_48 muszala 11/14/2013 bug fixes for CLM dry deposition and MEGAN VOC emissions - clm4_5_47 muszala 11/12/2013 fix Bug 1858 - AGDD now reset annually - clm4_5_46 sacks 11/08/2013 remove zeroing out of slope for special landunits - clm4_5_45 sacks 11/08/2013 refactor daylength calculation, and other minor changes - clm4_5_44 sacks 11/08/2013 temporary hack to daylength initialization to provide baselines for the next tag - clm4_5_43 sacks 11/06/2013 allocate memory for most landunits in every grid cell (needed for dynamic landunits) - clm4_5_42 sacks 11/04/2013 fix bug 1857 for CLM4.5 - CNDV running temperature means are incorrect - clm4_5_41 andre 10/30/2013 update scripts to convert clm4_5 CPP flags to namelist variables. - clm4_5_40 muszala 10/24/2013 fix Bug 1752 - urban conductances depend on weights in an undesirable way - clm4_5_39 muszala 10/23/2013 bug fix from santos - h2osoi_vol not passed to atmosphere model on restart - clm4_5_38 sacks 10/18/2013 change irrigation variables to be pft-level - clm4_5_37 muszala 10/10/2013 Modifications to bring clm up to date with major driver refactoring in drvseq5_0_01 - clm4_5_36 sacks 10/04/2013 new surface datasets, and other minor fixes - clm4_5_35 sacks 10/01/2013 get CLM running on edison - clm4_5_34 erik 09/30/2013 Get PTCLM working, fix a few small bugs - clm4_5_33 muszala 09/26/2013 clean up from mistakes in previous tag - clm4_5_32 muszala 09/26/2013 bug fix tag - 1798, 1810 - clm4_5_31 sacks 09/25/2013 fix bug 1820: incomplete conditional in CNSoyfix leads to buggy results and decomposition dependence - clm4_5_30 sacks 09/24/2013 fix performance bug in decomposition initialization - clm4_5_29 sacks 09/24/2013 fix threading in CLM4.5, and other misc fixes - clm4_5_28 sacks 09/20/2013 fix FracH2oSfc bug - clm4_5_27 sacks 09/20/2013 fix crop nyrs bug - clm4_5_26 muszala 09/19/2013 water balance and SMS_Ly1.f19_g16.ICLM45BGCCROP fix - clm4_5_25 erik 09/13/2013 Bring in Tony's changes to kick sno all the way up to the coupler layer, makes all - CESM components more similar to each other - clm4_5_24 sacks 09/03/2013 update externals to cesm1_3_beta02 or later - clm4_5_23 muszala 08/22/2013 refactor to allow CH4 params. to be read from netcdf file and clean up clm4_5_20 - clm4_5_22 muszala 07/30/2013 aux_clm testlist reorganization - clm4_5_21 muszala 07/24/2013 ifdef and bounds refactor - clm4_5_20 muszala 07/20/2013 refactor to allow CN and BGC params. to be read from netcdf file - clm4_5_19 sacks 07/17/2013 fix setting of bd in iniTimeConst - clm4_5_18 sacks 07/09/2013 rework urban indexing - clm4_5_17 sacks 07/03/2013 misc cleanup and bug fixes - clm4_5_16 sacks 07/02/2013 only run filters over 'active' points - clm4_5_15 muszala 07/01/2013 complete associate refactor for pointers in clm4_5 source - clm4_5_14 muszala 06/20/2013 preparation for associate refactor in clm4_5_15 - clm4_5_13 andre 06/14/2013 hydrology reordering from Jinyun Tang - clm4_5_12 muszala 06/13/2013 NoVS test, NAG mods and remove TWS from restart file - clm4_5_11 sacks 06/11/2013 Change pct_pft and related surface dataset variables to be % of landunit - clm4_5_10 muszala 06/10/2013 refactor clmtype - clm4_5_09 muszala 06/04/2013 volr and vic fix, update mct and rtm - clm4_5_08 muszala 06/03/2013 port for NAG compiler - clm4_5_07 erik 05/31/2013 New spinup files for CLM45 AND RTM, work on PTCLM, turn drydep off by default, update externals - clm4_5_06 erik 05/15/2013 A few small bug fixes, more updates to README files - clm4_5_05 muszala 05/14/2013 hcru bug fixes - clm4_5_04 erik 05/13/2013 Fix the previous broken tag - clm4_5_03 erik 05/10/2013 Several bug fixes for release, urban and test single point surface datasets - clm4_5_02 sacks 05/07/2013 make 'shared' tools directory, and other minor tools fixes - clm4_5_01 muszala 05/06/2013 update externals - clm4_5_00 erik 05/02/2013 Official end to CLM4.5 development for CLM offline - clm4_0_81 bandre 04/29/2013 Charlie Koven's variable consolidation, cryoturbation and BSW CPP changes - clm4_0_80 erik 04/26/2013 Bring Fang Li. Fire model into CLM4.5 science, update ALL CLM4.5 surface datasets, - provide a working initial condition file for CLM45BGC@f19_g16-1850 - clm4_0_79 muszala 04/24/2013 pftdyn, pft-phys*.nc and datm8 update - clm4_0_78 muszala 04/23/2013 MEGAN fixes - clm4_0_77 sacks 04/23/2013 fix carbon balance bug in transient runs with VERTSOI, and fix Soil Hydrology bug - clm4_0_76 muszala 04/22/2013 spinup changes from Charlie Koven (part 1) - clm4_0_75 muszala 04/19/2013 run propset - clm4_0_74 muszala 04/17/2013 snow_depth changes, major scripts overhaul, bug fix for tools - clm4_0_73 sacks 04/15/2013 update mksurfdata_map for CLM4.5, and other misc. updates, mainly to tools - clm4_0_72 muszala 04/11/2013 maoyi bug fix for vic hydro - clm4_0_71 muszala 04/10/2013 compsets refactoring by mvertens - clm4_0_70 muszala 04/01/2013 bring in vic hydrology - clm4_0_69 muszala 03/26/2013 remove hydro reorder, volr and esmf mods - clm4_0_68 erik 03/16/2013 Fix some issues in mksurfdata_map for generation of ne120np surface data file. - Put error back in CLM if weights don't sum to 100. Add in Keith's photosynthesis change for CLM45. - clm4_0_67 muszala 03/12/2013 Jinyun photosynthesis and hydrology reorder - clm4_0_66 sacks 03/07/2013 turn off subgrid topography snow parameterization for glc_mec landunits - clm4_0_65 sacks 03/07/2013 back out Machines external to get more tests to pass, especially IG - clm4_0_64 muszala 03/06/2013 update externals. fixes 40/45 intial condition problem - clm4_0_63 muszala 03/04/2013 bug 1635 fix - 4_0 CN bug - clm4_0_62 sacks 02/24/2013 add active flags, change subgrid weighting convention, other misc fixes - clm4_0_61 muszala 02/20/2013 rtm, drv and clm mods: tws, olr, r01 rdric file and SoilHydroMod - clm4_0_60 erik 02/11/2013 Bring CLM4.5 code from clm45sci branch to trunk as an option set at configure time - clm4_0_59 mvertens 12/20/2012 restructure clmtype and all pointer references, new directory structure - clm4_0_58 erik 12/14/2012 Uncomment us20 and wus12 datasets, more testing to: bluefire, yellowstone, frankfurt - clm4_0_57 muszala 11/30/2012 update trunk with release mods, some rtm fixes - clm4_0_56 sacks 11/27/2012 fix s2x tsrf, add s2x diagnostics - clm4_0_55 muszala 11/14/2012 bring in flooding capability - clm4_0_54 erik 10/09/2012 Fix esmf for carma field, fix some CLM_USRDAT issues - clm4_0_53 erik 10/03/2012 Update to fsurdat, fpftdyn, finidat datasets, new high resolution organic/fmax/glacier raw datasets - clm4_0_52 sacks 09/27/2012 new pct_glacier raw data file - clm4_0_51 muszala 09/26/2012 bug fixes, pio performance and SCRIP files - clm4_0_50 muszala 09/21/2012 testing of clm and new rof component - clm4_0_49 erik 09/16/2012 Move clm testing to use CESM test framework - clm4_0_48 muszala 09/11/2012 bug fixes, xFail to tests and normalize test output for CLM - clm4_0_47 muszala 08/23/2012 bug fixes - clm4_0_46 muszala 08/08/2012 R01 support and update externals - clm4_0_45 sacks 07/20/2012 fix virtual columns; new urban mksurfdata_map - clm4_0_44 erik 07/09/2012 Add wrf resolutions, update externals to cesm1_1_beta15, all components use build-namelist now - clm4_0_43 sacks 04/06/2012 Add diagnostic fields, modify some existing history fields - clm4_0_42 erik 03/27/2012 Bring in Francis Vitt's MEGAN changes. - clm4_0_41 erik 03/13/2012 Bring rmfmesh/rtmmap branches to trunk - clm4_0_40 erik 02/16/2012 Back out update to new T31 surface datasets - clm4_0_39 erik 02/01/2012 Bring newgrid branch to trunk - clm4_0_38 erik 01/23/2012 Fix f09 surface datasets - clm4_0_37 erik 09/26/2011 Fix unstructured grids history files - clm4_0_36 erik 09/22/2011 Comment out RTM mapping files for f09 and f19 - clm4_0_35 erik 09/13/2011 Bring in Mariana's non2D grid branch to trunk, enabling HOMME grids: ne30np4/ne120np4 - clm4_0_34 erik 08/18/2011 Bring tcens branch to trunk, fix a few issues - clm4_0_33 erik 07/25/2011 Move changes on release branch over to trunk - clm4_0_32 erik 05/19/2011 Make I1850SPINUPCN compset use MOAR data, various bug fixes, work on test lists - clm4_0_31 erik 05/13/2011 Fix answers for transient_CN, fix interpinic - clm4_0_30 erik 05/11/2011 New finidat/fsurdat files for T31 - clm4_0_29 erik 05/05/2011 Backout interpinic changes to one that works - clm4_0_28 erik 05/03/2011 Remove DUST/PROGSSLT in land coupler layer, update driver and scripts - clm4_0_27 erik 05/02/2011 Move crop branch over to trunk - clm4_0_26 erik 03/23/2011 Update externals, driver update changes answers, drydep changes from fvitt, fix bugs - clm4_0_25 erik 03/22/2011 Always output restart-history files add more meta-data to them, fix urbanc_alpha and 2.5x3.33 datasets, Changes from Keith O on SNOWLIQ/SNOWICE - clm4_0_24 erik 02/09/2011 Fix mksurfdata and add ability to override soil_fmax - clm4_0_23 erik 02/03/2011 Add in new glacier-MEC use-cases - clm4_0_22 erik 01/20/2011 Move coupler field indicies to clm, move cpl_* directories up a level, add the cpl_share directory - clm4_0_21 jedwards 01/12/2011 Remove includes, finish PIO transition - clm4_0_20 erik 01/11/2011 Update for ESMF metadata, update doc. from release branch, bug fixes (doc of qflx_evap_tot, threading CNDV, aer/ndepregrid) - clm4_0_19 erik 12/08/2010 Bring irrigation branch to the trunk - clm4_0_18 erik 11/21/2010 Fix a problem with the clm template, update scripts version to fix bug with linking with ESMF - clm4_0_17 erik 11/20/2010 Update to externals that change answers to roundoff, use drv pio namelist, add in T341 datasets - clm4_0_16 erik/mverten 10/27/2010 Fix downscaling roundoff difference for same-grids by copying scale factor when needed - clm4_0_15 erik/mverten 10/24/2010 Move pio branch to trunk - clm4_0_14 erik 10/19/2010 Fix finidat file for T31 sim_year=2000 cases - clm4_0_13 erik 10/16/2010 Bring in PTCLM branch, add in T31 finidat file and turn off ice_runoff for T31 - clm4_0_12 erik 09/10/2010 Add U10 to history, cesm1_0_rel06 updates, PTCLM02 updates (except mksurfdata), remove ndepdat/dyn/faerdep - clm4_0_11 erik 08/27/2010 New files for rcp6, fix MPI bug, update externals - clm4_0_10 erik 08/04/2010 Update doc to cesm_rel05, bug-fixes, fix issues for single-point, mksurfdata/getregional scripts - clm4_0_09 erik 06/14/2010 Fix some small issues, update documentation, and externals - clm4_0_08 erik 06/04/2010 Snow hydrology bug fix from Keith and Dave - clm4_0_07 erik 06/03/2010 Some cleanup/fix bugs, add RTM var, add albice to namelist, allow last-millenium in mksurfdata, allow setting of datm_presaero in clm test-suite - clm4_0_06 erik 05/26/2010 Update gglc to cism - clm4_0_05 erik 05/25/2010 Move Nitrogen deposition stream branch to trunk - clm4_0_04 erik 05/20/2010 New namelist items: ice_runoff, scaled_harvest, carbon_only, - new RTM hist vars, new finidat files, update esmf interface, turn off aerosol read quicker - clm4_0_03 erik 05/17/2010 Changes from Francis for VOC and drydep - clm4_0_02 erik 05/13/2010 Make sure dtime is initialized, so that answers are consistently the same as clm4_0_00 - clm4_0_01 erik 05/11/2010 Move glacier multiple elevation class branch to the trunk so that we can work with the active glacier model - clm4_0_00 erik 05/04/2010 Update to datm8, redirect aquifer overflow - to drainage, add gx3v7 masks, script to extract regional - datasets, add harvesting for CN, modify shrubs, include urban - model, ice stream for snowcapping, new build-namelist system, - scale solar by solar zenith angle in datm, deep soil with - bedrock at bottom, organic matter in soils, SNICAR for snow - radiation, sparce dense aero, snow cover changes - clm3_8_00 erik 05/04/2010 Get future scenarios working, finalize - documentation, bring in MEGAN VOC and CNDV, simplify, - mksurfdata optimization, fix bugs: snow enthalpy, BMOZ, pergro, - use pft weights from fsurdat NOT finidat - clm3_7_15 erik 04/27/2010 Finish User's Guide, surfdata files for urban-1pt, fix mksurfdata ifort bugs, work with testing - clm3_7_14 erik 04/08/2010 Fix rcp=2.6/4.5 1-degree fndepdyn filenames - clm3_7_13 erik 04/08/2010 Add in missing rcp=2.6/6 use-cases, and fix syntax errors in the namelist_defaults file - clm3_7_12 erik 04/08/2010 rcp=2.6/4.5 datasets for fndepdyn and aerdepdat, fix some minor issues, new 1pt urban surfdata files - clm3_7_11 erik 04/07/2010 qtr-degree and T85 surfdata, rcp=2.6/4.5 datasets, doc updates - clm3_7_10 erik 03/22/2010 Fix drydep so that BMOZ case will work - clm3_7_09 erik 03/21/2010 Fix snow enthalpy bug, cndv datasets, various fixes - clm3_7_08 mvertens 03/12/2010 Removal of check for weights if dynamic land use is -used - clm3_7_07 erik 03/10/2010 New finidat datasets for 1-deg, 2-deg, and abort if weights from finidat/fsurdat files are too different, and use fsurdat files as truth - clm3_7_06 erik 03/10/2010 Bring cndv branch to trunk - clm3_7_05 erik 02/24/2010 Bring VOC branch source code to trunk - clm3_7_04 erik 02/17/2010 Bring VOC branch (vocemis-drydep18_clm3_7_03) tools, testing, and build to trunk (everything other than VOC code changes) - clm3_7_03 erik 02/10/2010 Add in more future scenario datasets, new history fields from Keith - clm3_7_02 erik 02/06/2010 Start adding in new rcp=8.5 datasets, remove some junk, change some env_conf variables, add user_nl_clm - clm3_7_01 erik 01/29/2010 OpenMP fix for pftdyn, start adding in rcp's, update ndeplintInterp.ncl script - clm3_7_00 erik 01/22/2010 Update to datm8, redirect aquifer overflow to drainage, add gx3v7 masks, script to extract regional datasets, add harvesting for CN, modify shrubs, include urban model, ice stream for snowcapping, new build-namelist system, scale solar by solar zenith angle in datm, deep soil with bedrock at bottom, organic matter in soils, SNICAR for snow radiation, sparce dense aero, snow cover changes - clm3_6_64 erik 01/22/2010 Update documentation and README/Quickstart files, set NetCDF large-file format on by default in template, update pio, update some fsurdat files to vocemis-drydep versions, add 2.5x3.33_gx3v7 frac file, make gx3v7 default for 4x5 res - clm3_6_63 erik 01/09/2010 Get answers to be identical with ccsm4_0_beta38 for 1 and 2 degree transient cases - clm3_6_62 erik 01/08/2010 Fix startup of PFT transient cases so properly use data from pftdyn file rather than finidat file - clm3_6_61 erik 01/07/2010 Comment out endrun on finidat and fsurdat weights being incomptable, and go back to using finidat weights - clm3_6_60 erik 01/05/2010 Fix clm template - clm3_6_59 erik 01/05/2010 Update to datm8, fix so wts used are from fsurdat file NOT finidat file - clm3_6_58 erik 12/08/2009 Fix rpointer, correct units for export of nee, start adding testing for intrepid - clm3_6_57 erik 11/20/2009 Redirect aquifer overflow to drainage, so doesn't end up in ocean - clm3_6_56 erik 11/10/2009 New ndepdat and ndepdyn datasets - clm3_6_55 erik 11/05/2009 Fix tool to create Nitrogen deposition datasets, and change configure to use CCSM Makefile as source for TopLevel Makefile - clm3_6_54 erik 10/28/2009 Allow comp_intf to change on ccsm build, reduce default hist fields, start adding 2.5x3.33, start adding VOC fsurdat datasets, new finidat files for f09 and f19 - clm3_6_53 erik 09/22/2009 Fix so that T31_gx3v7 file is actually included - clm3_6_52 erik 09/17/2009 Add T31_gx3v7 support, remove forganic, read from fsurdat, add script to extract regional datasets, work with CN output, add more urban/rural fields - clm3_6_51 erik 09/01/2009 Update fndepdyn and aerdep datasets (f02,f05,f09,f10) (1850,2000) and f09, f10 transient (1850-2000) - clm3_6_50 erik 08/28/2009 Fix ncl regridding scripts so that NO missing values are allowed for aerosol and nitrogen deposition - clm3_6_49 erik 08/25/2009 Fix ncl interpolation scripts, update externals, turn on CLM_CCSM_BLD for bluefire,jaguar, ESMF3 compliance - clm3_6_48 erik 08/12/2009 New aerosol/nitrogen deposition datasets, mksurfdata work, scm work, clm_usr_name option to build-namelist - clm3_6_47 erik 08/03/2009 Fix hybrid bug for dynpft case, update externals - clm3_6_46 erik 07/22/2009 Get more tests to work/document them, add use cases for 1850_control, 2000_control, and - 20thC_transient, straighten out single-point grids, Listen to LND_CDF64 env variable from - template, remove CLM_ARB_IC. - clm3_6_45 erik 07/10/2009 Remove inconsistent finidat file in clm3_6_44 - clm3_6_44 erik 07/09/2009 Fix C13 bug, update scripts, drv, datm. Add domain files for idmap atm-ocn grids for datm. Remove SEQ_MCT, add new ESMF env vars to template. Work with ndeplintInterp - clm3_6_43 erik 06/10/2009 Fix pftdyn bug, enable 1D primary hist files, fix time-const3D output, fix template bug, enable cpl_esmf/cpl_mct - clm3_6_42 erik 06/02/2009 Bring CN Harvest branch to trunk - clm3_6_41 kauff 05/29/2009 shrub mods, abort if nthreads > 1 (temporary, wrt bugz #965) - clm3_6_40 erik 05/28/2009 Fix openMP bug, add fndepdyn ncl script, fix interpinic for urban, add mkharvest to mksurfdata, new spinups, turn CLAMP on for CASA or CN - clm3_6_39 erik 05/07/2009 Bug fix for script version and maxpatchpft back to numpft+1 - clm3_6_38 erik 05/06/2009 New fsurdat for other resolutions, bug-fixes, deep wetlands to bedrock, new spinups for 1.9x2.5 1850, 2000 - clm3_6_37 erik 04/27/2009 Update faerdep dataset for 1.9x2.5 to point to version cice is using for 1850 and 2000 - clm3_6_36 erik 04/27/2009 Handle transient aersol, make maxpatchpft=numpft+1 default, new datasets for 1.9x2.5 and 0.9x1.25, change doalb - clm3_6_35 erik 04/20/2009 Fix major logic bug in mksurfdata - clm3_6_34 oleson 04/19/2009 Fix bangkok urban bug - clm3_6_33 erik 04/16/2009 Bring in dynpft changes from cbgc branch - clm3_6_32 erik 04/15/2009 Add irrigation area to mksrfdata, fix high-res and pftdyn problems - clm3_6_31 erik 04/01/2009 New surface datasets for 1850,2000, support for 0.9x1.25_gx1v6, urban always on. New pft-physiology file. Update scripts so remove some CLM_ env_conf vars. Fix CN for urban/pftdyn. - clm3_6_30 oleson 03/19/2009 Fix urban roof/wall layers - clm3_6_29 oleson 03/19/2009 CN SAI, CN testing fix, rad step size fix - clm3_6_28 oleson 03/17/2009 Fix permission denied error when reading surface dataset - clm3_6_27 oleson 03/16/2009 Urban model changes and FGR12 fix - clm3_6_25 dlawren 03/13/2009 Daylength control on Vcmax, 1%Lake,wetland,glacier in mksrfdat, remove ELEVATION in surface data file - clm3_6_24 oleson 03/09/2009 Fix urban testing and some history field changes - clm3_6_23 oleson 03/08/2009 Prune history fields and change to snowdp threshold for solar radiation penetration into snow - clm3_6_21 oleson 03/04/2009 History file changes and finish testing on tags clm3_6_19 and clm3_6_20 - clm3_6_19 oleson 02/27/2009 Changes to urban model and urban surface data - clm3_6_17 oleson 02/26/2009 Urban model changes and mksurfdata changes to incorporate urban data - clm3_6_16 erik 02/12/2009 Multiple elevation classes on surface dataset, urban fixes, mpi-serial and testing fixes - clm3_6_15 erik 01/19/2009 Bring clm36sci branch to the trunk - clm3_6_14 erik 10/10/2008 Fix some global urban issues, fix pftdyn, really get compile-only option - working in testing - clm3_6_13 erik 10/01/2008 Update to new version of cpl7 scripts and build, update externals for versions - needed for clm36sci branch, add new CASA tests - clm3_6_12 erik 09/21/2008 Fix restarts for urban, add capability to do global urban experiments, - add in new forcing height changes - clm3_6_11 dlawren 08/26/2008 Ice stream for snow capped regions - clm3_6_10 tcraig 08/15/2008 extend rtm tracer, ascale for tri-grids, AIX O3 to O2 - clm3_6_09 erik 08/11/2008 Fix clm.cpl7.template to run hybrid and branch cases - clm3_6_08 erik 08/06/2008 Fix bugs, and build changes for inputdata repo - clm3_6_07 erik 07/08/2008 Implement new build namelist system from Vertenstein/Eaton, bluefire, and BGP updates - clm3_6_06 erik 05/30/2008 Small fix needed for ccsm4_alpha30 - (use gx1v5 for some resolutions when OCN_GRID==ATM_GRID) - clm3_6_05 erik 05/27/2008 Fix to compile with PGI-6, update scripts, fix cpl7.template for new scripts LND_GRID, - fix 2.65x3.33 frac dataset. - clm3_6_04 erik 05/20/2008 Remove all MCT permutes, fix cpl7 script issues, remove offline mode, - add ability to run over a range of years - clm3_6_03 erik 05/08/2008 Fix so listen to next_swcday to calculate albedo rather than using irad - clm3_6_02 erik 03/25/2008 Minor fix in configure remove perl5lib version under models/lnd/clm/bld - clm3_6_01 erik 03/20/2008 40 m forcing height changes for clm - clm3_6_00 erik 03/20/2008 Fully implement sequential-ccsm mode, upgrade configure, build-namelist and testing, - upgrade interpolation tool, add mkdatadomain, write to iulog rather than 6 explicitly, - SCAM update, Update datasets, add archiving, and build-streams, add in point version - of Urban model, change directory structure to mimic CCSM - clm3_5_20 erik 03/17/2008 Bug fixes before spinning off clm3_6_00, put in changes from ccsm4a01_clm3_5_18 - to ccsm4a04_clm3_5_18 - clm3_5_19 erik 03/06/2008 Change directory structure to mimic CCSM, fix so no NaNS on BGC interpinic output, - new half degree CN clmi dataset - clm3_5_18 erik 02/21/2008 Update to latest seq-ccsm4.alpha tag - clm3_5_17 erik 02/06/2008 Merge Tony Craig's FMI branch fmi12_clm3_5_16 to the clm trunk - clm3_5_16 erik 01/28/2008 Get point version of Urban code onto trunk (urban code can not restart) - clm3_5_15 erik 12/10/2007 Fix interpinic for half degree grid, add in large-file support, - allow configure to work with ccsm directory structure - clm3_5_14 erik 11/27/2007 Use build-streams, and archiving, multiple bug-fixes - clm3_5_13 erik 11/16/2007 Update xml file with file needed for ccsm3_5_beta18 - clm3_5_12 erik 11/08/2007 Tag with new files needed for ccsm3_5_beta17 - clm3_5_11 erik 09/28/2007 Update datasets in the DefaultCLM file for 0.23x0.31, 0.47x0.63, 0.9x1.25 and - add fndepdyn file for 1.9x2.5 - clm3_5_10 jet 09/18/2007 SCAM update - clm3_5_09 erik 08/31/2007 Change configure to NOT have csm_share code for ccsm_con option, and add in 1x1.25 file, - and update datm7 and csm_share - clm3_5_08 tcraig 08/20/2007 convert 6 to iulog in logfile, updates for I/O - clm3_5_07 erik 08/17/2007 Add mkdatadomain tool, add cprnc and perl5lib as externals - clm3_5_06 erik 08/10/2007 Update: interpolation, testing, script namelist build, and scripts. Fix bugs, - and fix possible - clm3_5_05 tcraig 07/11/2007 seq clm mods and first hist refactor mods - clm3_5_04 mvertens 06/05/2007 lnd_comp_mct.F90 change to work with sequential diagnostics - clm3_5_03 tcraig 05/23/2007 reduce memory, partial I/O refactor, downscaling implementation - clm3_5_02 mvertens 05/22/2007 put in hourly coupling with sequential driver - clm3_5_01 erik 05/16/2007 Move newcn06 branch to trunk - clm3_5_00 erik 05/03/2007 New surface datasets, improved canopy integration, and various improvements to Hydrology From 112cc9ebd2efe67e80cbd6c2b787f97f8c392b07 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 Aug 2018 13:20:33 -0600 Subject: [PATCH 143/144] Add clm5_0 series changelog --- doc/clm5_0_ChangeLog | 1742 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1742 insertions(+) create mode 100644 doc/clm5_0_ChangeLog diff --git a/doc/clm5_0_ChangeLog b/doc/clm5_0_ChangeLog new file mode 100644 index 0000000000..368d1742a0 --- /dev/null +++ b/doc/clm5_0_ChangeLog @@ -0,0 +1,1742 @@ +=============================================================== +Tag name: clm5.0.dev013 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Jun 12 13:46:31 MDT 2018 +One-line Summary: cleanup and update cime and cism + +Purpose of changes +------------------ + +Update cime and cism to newer versions used in release. These bring in some answer +changes. The cime version updates the orbit for 2000 compsets. The cism version +changes answers for two fields with NO_EVOLVE and more fields for EVOLVE. + +Fixes an important bug needed for use with Data Assimulation. Several changes +to testing. Adding wallclock as needed, changing a few compsets so science +supported compsets are used, added tput_tolerance to some tests known to be +variable. + +Many changes to the clm tools for creating input files. Added the version by +querying "git describe" and adding it as an attribute to NetCDF files. Changes +to get tools working, and tested. Also changed so that tools can be run in either +a CTSM checkout or a CESM checkout. + +Updated README files so they are accurate. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] + #188 -- Global PTCLM tools test fails + #187 -- PTCLM tools tests fail baseline comparisons due to a seg fault + #259 -- Most README files in ctsm are incorrect + #386 -- Shorten some currently very long debug tests + #387 -- Lots of testmods still set orb_iyear and orb_iyear_align + #388 -- Add "git describe" to input files that are created + #389 -- Post data-assimilation processing broken with multi-driver + #393 -- Increase wallclock + #399 -- minor format update needed in namelist_definition_clm4_5.xml + #402 -- Some smaller tests can be slow.. + #411 -- Refactor tools aren't useful anymore + #414 -- PTCLM tests aren't working + #415 -- mkprocdata_map tests aren't working because of bad return statement in script type: bug - other + #418 -- Path needs to be updated for getco2 script type: bug - other + +Known bugs found since the previous tag (include github issue ID): #404, #413, #414 + #404 -- Carbon balance error in decStart test just after new year + #413 -- Currently can't use DAV cluster to make mapping files + #414 -- With change in repo for fates, had to enter username/password four times + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Yes + Lengthen some of the wallclock times. Remove the 1850 test-mods that just change the orbit. + Change some of the compsets tested to cover the science supported compsets. + Allow decStart test modes to ignore errors, so Crop tests can run. Remove a very long debug test. + Add a setting for tput_tolerance for some tests that are shown to have a large variability. + Add a test mod for data assimulation. Remove some of the settings from the pauseResume test + as already done, or tested seperately in the DA test. + +Code reviewed by: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + hobart --- PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + hobart --- OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev012 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! Because of changes in cism and cime + + Summarize any changes to answers: + - what code configurations: All 2000 compsets and some cases with cism + - what platforms/compilers: All + - nature of change: similar climate + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, rtm, mosart, PTCLM + + cime to cime_cesm2_0_rel_03 (changes answers for 2000 cases because of change to orbit + cism to release-v2.1.01 (changes answers for two fields for NOEVOLVE and more fields for EVOLVE) + PTCLM to PTCLM2_180611 + + rtm and mosart changed to point to cesm2_0 release versions (identical to previous version) + +Pull Requests that document the changes (include PR ids): #398, #400, #407, #408, #417, #394 +(https://github.com/ESCOMP/ctsm/pull) + + #394 -- some final cleanup + #417 -- Make PR template questions less prominent + #408 -- Documentation updates + #407 -- Initial version of templates for contributing, PR's and issues + #400 -- Update CanopyStateType.F90 priority: high type: code cleanup/docs + #398 -- Allow first history tape to have other than one time point per file priority: high type: enhance - science + +=============================================================== +=============================================================== +Tag name: clm5.0.dev012 +Originator(s): sacks (Bill Sacks) +Date: Thu May 17 14:13:34 MDT 2018 +One-line Summary: Fixes for variable_year orbital mode + +Purpose of changes +------------------ + +Fixes for correctness and exact restartability with variable_year +orbital mode: + +(1) Update max day length (max_dayl) each time step, rather than just + updating it once in initialization + +(2) Update to a cime version that has a fix for datm, which updates the + orbital parameters (used for solar zenith angle-based interpolation) + each time step, rather than just once in initialization + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #379 (Problems with Hist decStart restart tests due to variable + orbital year) +- Fixes #260 (max daylength doesn't change over time for varying orbital + parameters) + +CIME Issues fixed (include issue #): +- ESMCI/cime#2598 (datm doesn't restart properly with variable year orbit) + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: Gave extra time to some tests so they would pass + +Code reviewed by: Erik Kluzek + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, some baselines fail as expected + + Also verified that this test (reported in #379) now passes: + ERS_D_P36x1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart + + Also verified that the ctsm code changes alone (without the cime + update) have the expected behavior in terms of baseline + passes/fails: + + FAIL SMS_D_Ld10.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE + Enters the second year + PASS SMS_D_Ld1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-decStart BASELINE + Stays in first year + PASS SMS_Lm1.f10_f10_musgs.IHistClm50Bgc.cheyenne_intel.clm-ciso_bombspike1963 BASELINE + Stays in first year + +CLM tag used for the baseline comparisons: clm5.0.dev011 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: multi-year runs with HIST compsets + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but expected to be larger than roundoff/same climate + + Bit-for-bit for runs with fixed orbital parameters (non-HIST + compsets) and for HIST runs that do not span multiple years. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: adds one commit that fixes ESMCI/cime#2598 + +Pull Requests that document the changes (include PR ids): +- #385 (Update max day length (max_dayl) each time step) + +=============================================================== +=============================================================== +Tag name: clm5.0.dev011 +Originator(s): erik (Erik Kluzek) +Date: Wed May 16 20:27:39 MDT 2018 +One-line Summary: 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing + +Purpose of changes +------------------ + +Update ndep file used for fully coupled 1850 cases to one being used in fully coupled +simulations. Update cism to latest release branch: release-v2.1.00. +Update PE layouts for f45, f09, f19. Turn BFBFLAG=TRUE for most CTSM testing. +Fix some issues with tools for batch submission. Remove a write statement for VIC +that was written a ridiculous amount of times. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #) #363 #374 #380 #382 #383: + #363 -- PE Layout + $374 -- Turn BFBFLAG on for testing (so PE layout changes won't appear to change answers) + #382 -- Write statement for VIC + $383 -- mkmapdata intel version + +Known bugs introduced in this tag (include github issue ID): #384 + #384 -- f09 resolution VIC test + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): PE layouts + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): ndep for clm50_cam6 forcing + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Added back tests + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - OK + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev010 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes for some + + Summarize any changes to answers, i.e., + - what code configurations: all with cism, tests as BFBFLAG on + - what platforms/compilers: all + - nature of change: similar + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism + + cism to release-v2.1.00 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #381 -- 1850 fully coupled ndep update, update cism, update PE layouts, turn BFBFLAG on for testing + +=============================================================== +=============================================================== +Tag name: clm5.0.dev010 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue May 15 03:00:38 MDT 2018 +One-line Summary: Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit + +Purpose of changes +------------------ + +Update externals to version in cesm2.0.beta10. Add in f05 crop datasets. Add pauseResume for DART and a +test for it. Fix several issues required for CESM2.0. Add model_doi_url to history files. + +update cism to very latest +Add model_doi_url to history files +Update rtm, mosart +Changes answers because of change in orbit (for testing orbit was already updated for 1850 so will appear to not change answers) +Using cime5.6.6 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #68 --- gnu compiler workaround + #364 -- crop f05 datasets + #362 -- svn checkout + #318 -- quadratic bug + #249 -- bypass balance checks for DART + #341 -- add model_doi_url + +CIME Issues fixed (include issue #): + +Known bugs introduced in this tag (include github issue ID): + #379 -- transient end-of-year exact restart issue + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): + + cime updates: + - manage_testlist was removed. + - Changes to matching behavior in env_mach_specific. + - New option to wait_for_tests. + - case.st_archive now has a --test option. + - New FORCE_BUILD_THREADED. + - New custom script option. + - env_archive.xml + - .case.run.sh file generated for E3SM. + - New selectors allowed for batch directives. + - Source code files beginning in test_ will be ignored in build. + - New prefix attribute available for batch directives. + - xmlquery will now accept derived attributes. + - Users may run on lawrencium lr3/lr2. + - In env_archive.xml. + - (cesm only) create_test and query_testlist now have --supported-only flag + - New allow_error attribute for module systems. + - check_input_data replace --svn-loc with --server and --protocal + - Some Tools with "acme" in the name now say "e3sm". + - env_archive.xml + - .case.run.sh file generated for E3SM. + - New selectors allowed for batch directives. + - Source code files beginning in test_ will be ignored in build. + - New prefix attribute available for batch directives. + - xmlquery will now accept derived attributes. + - Users may run on lawrencium lr3/lr2. + - In env_archive.xml. + - (cesm only) create_test and query_testlist now have --supported-only flag + - New allow_error attribute for module systems. + - check_input_data replace --svn-loc with --server and --protocal + - Some Tools with "acme" in the name now say "e3sm". + - cime_bisect changes. + - New XML variables, PAUSE_ACTIVE_XXX. + - module_lmod no longer a support module type. + - simple-py-prof sets PYTHONPATH for you, list_acme_tests assumes you want + to list tests + - jobid now added to CaseStatus case_submit entry. + -Splits GLC2OCN_RMAPNAME xml variable into + GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for + GLC2OCN_RMAPTYPE + - Better defaults for bless_test_results and compare_test_results. + - New bless_log file in baseline dirs. + - Allow multiple -m args to case.submit. Allows user to put email settings in .cime/config. + - New --retry option to create_test. + - Add --clean-depends to case.build, this argument can take a component list and will + clean all components if one is not provided. + - Some additional output from nl comp code in some cases + - --driver added to create_newcase, new _V$driver testopt. + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + Crop f05 surface datasets + +Substantial timing or memory changes: Seems to be slower and require more memory + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + pause/resume is still under development. This works for DART DA as needed for CESm2.0 + +Changes to tests or testing: + Added new pauseResume test on cheyenne_intel + Remove some of the higher PE count tests on cheyenne_gnu and replace with cheyenne_intel + Lengthen wallclock for a few of the tests on cheyenne + Change I1850Clm50BgcSpinup test to f09 resolution so it will run + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev009 + + +Answer changes +-------------- + +Changes answers relative to baseline: 1850 compsets change because orbit has been changed + + Summarize any changes to answers, i.e., + - what code configurations: 1850 compsets + - what platforms/compilers: all + - nature of change: 1850 orbit rather than 1990 + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, rtm, mosart, cism + + cime to cime5.6.6 + rtm to rtm1_0_66 + mosart to mosart1_0_31 + cism to cism2_1_54 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #377 -- update cime + #376 -- changes needed for DART + #372 -- Update manage_externals + +=============================================================== +=============================================================== +Tag name: clm5.0.dev009 +Originator(s): sacks (Bill Sacks) +Date: Thu May 10 13:48:32 MDT 2018 +One-line Summary: New init_interp method + +Purpose of changes +------------------ + +The main change in this tag is to introduce a new method for +init_interp. This is needed in order for subgrid areas to be the same in +initialization in runs with and without init_interp. + +The choice of init_interp method is controlled by a new namelist +variable, init_interp_method, whose documentation appears below: + + Method to use for init_interp. Only applies when use_init_interp = .true. + + 'general': The general-purpose method that can be used when changing + grids, configurations, etc. This starts off with subgrid areas taken + from the surface dataset. + + 'use_finidat_areas': This starts off with subgrid areas taken from the + input finidat file. This is needed to achieve bit-for-bit results in a + coupled case (where areas in initialization impact initial fields sent + to the atmosphere) (but using the 'general' method will typically have + only a very minor impact on results in this case). For this method to + work, the input finidat file needs to be at the same resolution as the + current configuration. So this is a less general form of + init_interp. However, it can be used when transitioning from a spinup + run to a transient run, or in other cases where the only difference is + in internal memory allocation. In order to catch possible problems, this + uses a different algorithm for finding the input point for each output + point, which ensures that each active output point is associated with + exactly one input point with the same latitude, longitude and type. This + method requires (a) the same grid for input and output, within roundoff; + (b) any non-zero-weight point in the input must have memory allocated + for it in this grid cell in the output (this will be satisfied if the + point is non-zero-weight on the surface dataset or if it's a point for + which we allocate memory even for zero-weight points); (c) any active + point in the output (based on the surface dataset and rules for + determining active points) must have a matching point in this grid cell + in the input. + +This tag also has some other changes: + +- Fixes #347 - endrun message behavior: needed for some of the new unit + tests + +- Fixes #345 - Add a cmip6_evolving_icesheet usermods directory: + unrelated, but folded in here for convenience of testing) + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- #346: New mode of operation for init_interp: Copy subgrid areas, too +- #347: endrun message behavior +- #345: Add a cmip6_evolving_icesheet usermods directory + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable - init_interp_method - documented above. Default + behavior is the same as before ('general') + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Added a new test type, similar to LII, that covers the new init_interp behavior +- Removed some no-longer-needed tests with 'interp' testmods + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + tests pass, namelists differ as expected + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + Unexpected baseline failures for these two tests that are in the + expected fail list for other reasons: + FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest + FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest + + Differences are just in some cism fields that I’m not concerned + about: roundoff-level differences in internal_time; big differences + in tempstag, uvel and vvel, but those fields don’t really make sense + in this configuration (and I have removed them in the latest CISM + tag). (Note that I did two runs of each of these tests from my + branch, and for both tests, the two runs had identical cism hist + files, so I don’t think this is a reproducibility problem.) + + +CLM tag used for the baseline comparisons: clm5.0.dev008 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #352 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev008 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri Apr 27 13:28:41 MDT 2018 +One-line Summary: With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 + +Purpose of changes +------------------ + +Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #351 -- FATES external to https + #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: + +Code reviewed by: wweider, rfischer + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev007 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: All CLM50 BGC with FUN on + - what platforms/compilers: All + - nature of change: climate very nearly the same + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + rfisher case -- clm5_nbug_test_case ----- short f45 resolution + oleson case --- clm5_nbug_test_case ----- AD spinup f45 resolution + oleson case --- clm5_nbug_test_casepAD -- Post AD spinup f45 resolution + + URL for LMWG diagnostics output used to validate new climate: + http://webext.cgd.ucar.edu/I1850/clm5_nbug_test_casepAD/lnd/clm5_nbug_test_casepAD.281_300-clm5_nbug_control_casepAD.281_300/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates changed to https form rather than ssh + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #344 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev007 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Apr 24 14:50:19 MDT 2018 +One-line Summary: Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit + +Purpose of changes +------------------ + +Important updates in land-ice model (CISM) version used that changes answers. Fix some initial condition problems +with CLM5.0 cases. Update the FATES version to a new updated science version that hence changes answers. +Change the default orbit for testing of 1850 cases to use 1850 orbit rather than 1990. +Make sure to use f45_f45_g37 and not f45_f45 in test lists. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + #313 -- Issues with initial condition files + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New IC file for clm5_0_CRUv7 + CLM5.0 finidat files choosen will be different for both GSWP3.1 and CRUNCEPv7 forcing + +Substantial timing or memory changes: No + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + When the cime version is updated the changes that make the 1850 orbit explicit in testing can be removed + +Changes to tests or testing: 1850 tests explicitly set a 1850 orbit, f45_f45 tests changed to include mask (f45_f45_mg37) + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev006 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers: + - what code configurations: All 1850 tests, all FATES, all with CISM, CLM50 initial conditions + - what platforms/compilers: All + - nature of change: Significant + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, cism + FATES to SCI_1.8.1_API_3.0.0 + cism to cism2_1_49 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #349 -- Update manage externals to manic_v1.1.3 + #348 -- Update FATES science version to 1.8.1, and bring in some answer changes + +=============================================================== +=============================================================== +Tag name: clm5.0.dev006 +Originator(s): sacks (Bill Sacks) +Date: Thu Apr 12 06:16:16 MDT 2018 +One-line Summary: Don't allocate memory for zero-weight natveg patches and urban + +Purpose of changes +------------------ + +We have previously been allocating memory for all urban columns and all +natural veg PFTs, everywhere. In some cases this may still be desired, +but in some cases - and particularly non-transient cases - this is a +waste of memory and performance without any benefit. + +In timing runs of a CONUS test case set up by Mike Barlage, where there +were 2 PFTs per gridcell (bare plus grass), only allocating memory for +the non-zero-weight points (i.e., 2 natural pfts per gridcell and +nothing else) reduced land run time from 56.4 sec to 21.6 sec. + +This tag puts in place a more general solution, avoiding allocating +memory for zero-weight natural PFTs in non-transient runs, and avoiding +allocating memory for zero-weight urban points unless requested with a +namelist flag. + +For non-transient runs, this change improves performance and decreases +memory and restart file size substantially: For short timing runs on +cheyenne_intel at f09_g16 (I haven't looked closely at memory use, but +it probably is about the same reduction as the restart file size): +- I1850Clm50Sp + - 91% of the runtime (i.e., 9.0% reduction in runtime) + - Restart file size is 32% of original (68% reduction) +- I1850Clm50Bgc + - 77% of the runtime (i.e., 23% reduction in runtime) + - Restart file size is 33% of original (67% reduction) +- I1850Clm50BgcCrop + - 80% of the runtime (i.e., 20% reduction in runtime) + - Restart file size is 37% of original (63% reduction) + +(Non-transient cases should also be improved due to the urban change, +but I haven't investigated the improvement there.) + +This tag also fixes some other bugs, as noted below. + +NOTE: This change requires running init_interp on any existing initial +conditions files! In addition, moving forward, init_interp will always +be needed when going from a non-transient to a transient run (this has +already been the case when running with crop; now it will also be the +case when running without crop, too). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #298: Don't allocate memory for zero-weight PFTs and urban + columns +- Fixes #317: c14 bombspike and c13 timeseries code can use the wrong + year, with irreproducible behavior +- Fixes #320: I1850Clm50Sp compset mistakenly uses SGLC + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- You will need to run init_interp on any existing initial conditions + files +- Moving forward, init_interp will always be needed when going from a + non-transient to a transient run (this has already been the case when + running with crop; now it will also be the case when running without + crop, too) + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable: run_zero_weight_urban: If TRUE, run all urban + landunits everywhere where we have valid urban data. This has two + effects: (1) goes back to the previous behavior of allocating memory + for urban nearly everywhere; (2) makes all urban columns active, even + if they have zero weight. This can be used to evaluate potential urban + behavior globally. + +Changes made to namelist defaults (e.g., changed parameter values): +- Use init_interp for all out-of-the-box finidat files + +Changes to the datasets (e.g., parameter, surface or initial files): +- Remove initial conditions for Fates for 1x1 Brazil + +Substantial timing or memory changes: +- Substantial decreases in memory use and improvements in timing: see + notes above. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed aux_clm Fates tests to use cold start +- Changed the allActive test to be a transient case so that we allocate and run all PFTs + +Code reviewed by: +- Quick review by Erik Kluzek +- Urban change reviewed by Keith Oleson + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + Tests pass, namelists differ as expected + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means: tests pass, some baseline failures as expected: + - DIMSIZEDIFF for vector output + - ERI_D_Ld9.f09_g16.I1850Clm50Sp.cheyenne_gnu.clm-default differs + due to fix of #320 + - ERP_D_Ld9.f09_g16.I1850Clm50SpCru.cheyenne_gnu.clm-default differs + because this uses init_interp whereas on master we did not use + init_interp, and this changes answers for this ERP test due to + #330 + - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 + differs due to fix of #317 + + Note: For changed tests (allActive and Fates tests), I ran the new + versions of the tests from clm5.0.dev005 and confirmed that dev006 + is bit-for-bit with dev005 for these changed tests. + +CLM tag used for the baseline comparisons: clm5.0.dev005 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but only in limited situations + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: see below + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + Changes answers in the following situations: + - Vector output is not directly comparable, because dimension sizes + differ + - I1850Clm50Sp cases change substantially due to fix of #320 + - Cases with carbon isotope bombspike change due to fix of #317 + - In some situations, cases that use init_interp now but did not + before can change answers by roundoff due to #330 + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #311: Avoid allocating memory for zero-weight natveg patches and urban + +=============================================================== +=============================================================== +Tag name: clm5.0.dev005 +Originator(s): sacks (Bill Sacks) +Date: Tue Apr 10 14:15:52 MDT 2018 +One-line Summary: Two fixes for init_interp + +Purpose of changes +------------------ + +Two fixes for init_interp: + +(1) Copy as many snow layers as possible in init_interp + + In most cases, we only need data from the existing snow layers. But in a + few cases - in particular, the flx_abs* variables - we need data even + from non-existing snow layers in order for interpolation to be + bit-for-bit. The change here reworks snow interpolation so that, in + addition to copying the existing snow layers, we also copy as many + non-existing snow layers as will fit in the destination layer structure. + + Fixes #326 + +(2) For glcmec, match col/patch types in some cases + + If glcmec used the same elevation class definitions in input and output, + then match classes as we do for most landunit types, rather than just + using topographic heights. (An exception is output cells with the + single_at_atm_topo behavior, because their types could change once we + enter the run loop.) + + Fixes #325 + +The new behavior is covered by unit tests. This tag also expands some +unit testing infrastructure to facilitate the addition of some of these +unit tests. + +I have confirmed that this test passes: +LII_D_Ld9.f09_g16.I1850Clm50SpCru.hobart_intel.clm-default, when I point +to an initial conditions file that I generated from the dev 002 tag +(because I wasn't sure if the current default initial conditions file +was exactly compatible with the latest master). Before the changes in +this tag, that test was failing. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- #326: init_interp can change answers for absorbed radiation in + non-existent snow layers +- #325: init_interp can change answers over the CISM domain + +Known bugs introduced in this tag (include github issue ID): +- #339: cheyenne_gnu restart test fails exact restart comparison sporadically + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, baselines fail as expected (baseline failures + just for tests that use init_interp) + +CLM tag used for the baseline comparisons: clm5.0.dev004 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: all configurations with use_init_interp = .true. + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but expected to be larger than roundoff / same climate + + Differences arise due to both fixes listed above. + + (1) Copy as many snow layers as possible in init_interp: It + appears that this only changes answers for some radiation + terms in the first time step after initialization when a snow + layer had just melted before the restart file was written. In + this case, the flx_abs* variables are set differently for this + just-disappeared layer. This can affect a lot of grid cells, + but I expect differences from this change to be very small and + not scientifically important. + + (2) For glcmec, match col/patch types in some cases: This seems to + only affect a small number of grid cells in Greenland. So I do + not expect the overall effect on a simulation to be significant. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) +- #328: fixes for init_interp + +=============================================================== +=============================================================== +Tag name: clm5.0.dev004 +Originator(s): erik (Erik Kluzek) +Date: Mon Apr 9 00:20:03 MDT 2018 +One-line Summary: List of important bug fixes + +Purpose of changes +------------------ + +A list of important bug and usability fixes. One of those changes makes it easier for the user to end up with +initial condition files that don't match the start date of their simulation. This is problematic because of the +saved counters for prognostic crop. For sure a mismatched date will end up with bad results for the first season, +but this will also affect subsequent years running averages. So we don't recommend that you do that. + +Jim Edwards also brought in some changes for PIO for 64bit_data, and to fix fill values for integer data. And we updated +manage_externals to the newest version. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] +#213 -- usability issue for CPLHIST that Keith found. +#210 -- Recent request to increase number of tapes to 10. +#169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. +#68 --- workaround for gnu compiler bug +#46 --- needed for multi-instance +#66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work +#65 --– need to change a check from "> 0" to "> [small val]" +#240 -- from Jim +#255 -- get PTCLM working +#253 -- bad clm40 IC file + +Known bugs introduced in this tag (include github issue ID): + #329 -- init_interp doesn't work if finidat points to finidat_interp_dest from a different case + #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers + #325 -- init_interp can change answers over the CISM domain + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + You can bypass the ignore_ic_date error when crop is being used + Matching for initial conditions for crop simulations are allowed to ignore the month/day + When crop is on and the start date doesn't match the date for the initial conditions file, + the counters for the crop model will be incorrect -- and hence the first season will be screwed + up, and the screwed up results will affect the running averages for the future. This was a condition + that we didn't allow you to easily do -- we've made it easier for this to happen now. + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): + Allow ten streams of history tapes rather than just six. + Correct the I1850Clm50BgcSpinup compset + You can bypass the ignore_ic_date error when crop is being used (may affect results) + Matching for initial conditions for crop simulations are allowed to ignore the month/day + The precision control settings for Nitrogen and Carbon are now making it to the namelist + +Changes made to namelist defaults (e.g., changed parameter values): ncrit=1.d-8 (10X looser) + +Changes to the datasets (e.g., parameter, surface or initial files): Correct to a few finidat files (clm4_0_CRUv7) + +Substantial timing or memory changes: Maybe 3% to memory + + There is a 3% increase to memory, but memory high water mark seems to double + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + Added aux_cime_baseline tests + add cplhist test + Add edison to fates testlist + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev003 + + +Answer changes +-------------- + +Changes answers relative to baseline: no but, there are some specific potential or small apparant change to answers + in terms of the test suite + 3 fields have a different missing value pattern: landmask, pftmask, nbedrock + roundoff difference in F_N2O_DENIT due to #65 + LVG_Ld5_D.f10_f10.I1850Clm50Bgc.cheyenne_intel.clm-no_vector_output + landmask was different for two cases: + ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): manic + manage_externals to manicv1.0.2 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #337 Update manage_externals to manicv1.0.2 + #333 Important fixes + #241 Add support for 64bit_data, fix fillvalues + +=============================================================== +=============================================================== +Tag name: clm5.0.dev003 +Originator(s): erik (Erik Kluzek) +Date: Fri Mar 9 00:34:04 MST 2018 +One-line Summary: Bug fixes for energy imbalance associated with surface water and lakes + +Purpose of changes +------------------ + +These are bug fixes for the land energy imbalance over land as determined by coupler diagnostics. +They include bug fixes for surface water phase change and lake/snow interactions developed by +Sean Swenson and Keith Oleson. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #304 + #304 -- Energy imbalance over land per coupler diagnostics + +Known bugs introduced in this tag (include github issue ID): [If none, remove this line] + #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior + #313 -- Problems with CLM5 initial conditions files + #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + There is some dupliciation in calculations by level that could be consolidated + For example, the calculation of c1. + There is a check for ffrac_sno(c) > 0, that probably should be greater than a small value + +Changes to tests or testing: none + +Code reviewed by: self, sacks, swensosc + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm5.0.dev002 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: clm4_5 and clm5_0 + - what platforms/compilers: all + - nature of change: climate similar + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461 + - username: oleson + - machine: cheyenne + + URL for LMWG diagnostics output used to validate new climate: + +http://webext.cgd.ucar.edu/I1850/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850/lnd/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461-clm50_r272_1deg_GSWP3V1_iso_1850.1443_1461/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #307 -- Bug fixes for energy imbalance associated with surface water and lakes + +=============================================================== +=============================================================== +Tag name: clm5.0.dev002 +Originator(s): sacks (Bill Sacks) +Date: Sun Feb 25 06:53:36 MST 2018 +One-line Summary: Add some land ice diagnostic vars needed for CMIP6 + +Purpose of changes +------------------ + +Add some diagnostic variables needed for analyzing land ice that have +been requested by some of the MIPs in CMIP6 (especially ISMIP). + +Also, fixes c2l_scale_type to fix urban scaling for SNOWICE, SNOWLIQ + +Some changes from Leo van Kampenhout. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- https://github.com/ESCOMP/ctsm/issues/271 Add some land ice fields for cmip6 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self, Erik Kluzek + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass, answer changes as expected, as noted below + +CLM tag used for the baseline comparisons: clm5.0.dev001 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: All + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + - just changes the diagnostic fields SNOWICE, SNOWLIQ, due to + fixed c2l_scale_type for these fields + + + The test + ERP_P72x2_Ly3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-irrig_o3_reduceOutput + also showed small answer changes just in the cpl field + l2x_Sl_tsrf00, for a single grid cell in Antarctica + (221.485144932008 vs. 221.485144910486). However, I reran it 10 + times, and it was bit-for-bit (other than SNOWICE and SNOWLIQ) in + all 10 of those re-runs. So I'm chalking this up to a machine + fluke. (The restart file from the problematic run showed diffs in + a bunch of fields; from spot-checking one - SNOW_DEPTH - diffs + were just in one point. But since this is a reduceOutput run, + diffs didn't show up in CLM history files. I confirmed that there + were no diffs in finidat_interp_dest or in namelists.) I + regenerated baselines for this test using one of the cases without + this machine fluke. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +#303 - Snow integrated temperature +#306 - Add some land ice diagnostic variables needed for cmip6 + +=============================================================== +=============================================================== +Tag name: clm5.0.dev001 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Feb 14 14:14:34 MST 2018 +One-line Summary: Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM + +Purpose of changes +------------------ + +Fix problem with default LND_TUNING_MODE for cases coupled to CAM. Update some of the README +files. And also bring in a PTCLM version that will work in the new CTSM git checkout directory +structure. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +#255 PTCLMmkdata doesn't work in the CLM git checkout + +Known bugs found in this tag (include github issue ID): + +#262 hirespft option for mksurfdata.pl doesn't work + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: doc + +PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - PASS + + Extra Tests: + +ERS_Ld5.f19_g17.E1850L45TEST.cheyenne_intel.cice-default +SMS_Ld1.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist1d +SMS_Ld7.f09_g17.B1850.cheyenne_intel.allactive-defaultio + +CLM tag used for the baseline comparisons: clm5.0.dev000 + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): PTCLM + PTCLM to PTCLM2_180214 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +#297 -- README files +#296 -- Make LND_TUNING_MODE correct and consistent when coupled with CAM +#295 -- Bring in a working PTCLMmkdata version +#261 -- Reorder links + +=============================================================== +=============================================================== +Tag name: clm5.0.dev000 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Feb 05 2018 +One-line Summary: Initial version of CLM5.0 + +This is the initial science version of CLM5.0. + +Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly +notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop +modeling. +The updates to CLM science are documented here: + +https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 + +This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary +versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, +and future scenarios. + +Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution +(fv 0.9x1.25 with g1xv6 ocean mask). + +=============================================================== From eb0419e7e7e1b49b6e97fc381c7743ef8ae462b4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 Aug 2018 14:49:26 -0600 Subject: [PATCH 144/144] Update changelog for release-clm5.0.06 --- doc/.release-ChangeLog_template | 3 + doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 106 ++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) diff --git a/doc/.release-ChangeLog_template b/doc/.release-ChangeLog_template index a5b00cbba2..7d3bad891f 100644 --- a/doc/.release-ChangeLog_template +++ b/doc/.release-ChangeLog_template @@ -92,4 +92,7 @@ Externals being used: CTSM Tag versions pulled over from master development branch: +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + =============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index 0bf3bd0426..173aba1d24 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.06 erik 08/07/2018 Bring in some simple fixes from ctsm1.0.dev006 and avoid glacier adjustment at startup from ctsm1.0.dev007 release-clm5.0.05 erik 08/05/2018 Update 1850 ndep file, and last year for transient streams ctsm1.0.dev007 sacks 08/05/2018 Avoid glacier dynamic landunit adjustments in first time step ctsm1.0.dev006 sacks 08/04/2018 Minor bug fixes, cleanup, documentation and enhancements diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 60a395e4cb..a6f32c1bcb 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,110 @@ =============================================================== +Tag name: release-clm5.0.06 +Originator(s): erik (Erik Kluzek) +Date: Tue Aug 7 14:49:04 MDT 2018 +One-line Summary: Bring in some simple fixes from ctsm1.0.dev006 and avoid glacier adjustment at startup from ctsm1.0.dev007 + +Purpose of this version: +------------------------ + +Bring in a list of simple fixes that came to CTSM master. Also change so glacier initialization is *ALWAYS* done +at startup (time step zero) even if it isn't cold or interpolated initial conditions. Also synchronize some of the +files in the doc directory with the files in ctsm/master. + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev007 (minus ctsm1.0.dev005 and ctsm1.0.dev001) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): +- Fixes #340 (Avoid generating dynamic landunit adjustment fluxes for + glacier changes in the first timestep) +- Fixes #24 (ncd_io_1d_log_glob is broken) +- Fixes #120 (Incorrect comments in Biogeophysics1Mod.F90 +- Fixes #245 (Put all .gitignore entries in top-level file) +- Fixes #272 (Code should error on missing mxsoil_color when SOIL_COLOR + is used) +- Fixes #283 (Add more helpful message about need to do init_interp with + wrong number of vertical layers) +- Fixes #367 (For cmip6 runs: Turn on cpl hist output needed to drive a + TG compset) +- Fixes #412 (Fix documentation of init_interp_method) +- Fixes #419 (Do not allow SOYFIXN diagnostic field with FUN) +- Fixes #465 (Remove backwards compatibility check for snw_rds) + +Science changes since: release-clm5.0.05 (always do glacier initialization at startup even if NOT cold or interpolated startup) + +Software changes since: release-clm5.0.05 + remove ncd_io_1d_log_glob, remove a backwards compatability check for snw_rds on restart file + +Changes to User Interface since: release-clm5.0.05 + Add another field to cmip6_outputA, Remove SOYFIXN history field when FUN is on + Add error for missing mxsoil_color, better error message for wrong # of vertical soil layers, + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.05 + +Changes answers relative to baseline: possibly at startup + + Summarize any changes to answers, i.e., + - what code configurations: startup with Glacier model and NOT a cold or interpolated start + - what platforms/compilers: All + - nature of change: nearly identical + + Only tests that showed differences in answers were: + + ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default + SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.00 + mosart: release-cesm2.0.00 + cime: cime5.6.10 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: ctsm1.0.dev006, ctsm1.0.dev007 + + ctsm1.0.dev007 sacks 08/05/2018 Avoid glacier dynamic landunit adjustments in first time step + ctsm1.0.dev006 sacks 08/04/2018 Minor bug fixes, cleanup, documentation and enhancements + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #473 -- Always do glacier startup even if not cold or interpoalted start (ctsm1.0.dev007) + #468 -- Minor bug fixes (ctsm1.0.dev006) + +=============================================================== +=============================================================== Tag name: release-clm5.0.05 Originator(s): erik (Erik Kluzek) Date: Sun Aug 5 23:31:45 MDT 2018