diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 06ea82d99b..fa8f41af55 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2867,7 +2867,7 @@ sub setup_logic_do_transient_pfts { } # if do_transient_pfts is .true. and any of these (n_dom_* or toosmall_*) - # are > 0 or collapse_urban = .true., then give fatal error + # are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error if (&value_is_true($nl->get_value($var))) { if (&value_is_true($nl->get_value('collapse_urban'))) { $log->fatal_error("$var cannot be combined with collapse_urban"); @@ -2875,6 +2875,12 @@ sub setup_logic_do_transient_pfts { if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) { $log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soi > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8"); } + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time', + 'do_transient_pfts'=>$nl_flags->{'do_transient_pfts'}); + if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) { + $log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_pfts is .true."); + } } } @@ -2944,7 +2950,7 @@ sub setup_logic_do_transient_crops { } # if do_transient_crops is .true. and any of these (n_dom_* or toosmall_*) - # are > 0 or collapse_urban = .true., then give fatal error + # are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error if (&value_is_true($nl->get_value($var))) { if (&value_is_true($nl->get_value('collapse_urban'))) { $log->fatal_error("$var cannot be combined with collapse_urban"); @@ -2952,6 +2958,12 @@ sub setup_logic_do_transient_crops { if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) { $log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8"); } + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time', + 'do_transient_crops'=>$nl_flags->{'do_transient_crops'}); + if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) { + $log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_crops is .true."); + } } my $dopft = "do_transient_pfts"; @@ -3021,7 +3033,7 @@ sub setup_logic_do_transient_lakes { } # if do_transient_lakes is .true. and any of these (n_dom_* or toosmall_*) - # are > 0 or collapse_urban = .true., then give fatal error + # are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error if (&value_is_true($nl->get_value($var))) { if (&value_is_true($nl->get_value('collapse_urban'))) { $log->fatal_error("$var cannot be combined with collapse_urban"); @@ -3031,6 +3043,12 @@ sub setup_logic_do_transient_lakes { if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) { $log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8"); } + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time', + 'do_transient_lakes'=>$nl_flags->{'do_transient_lakes'}); + if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) { + $log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_lakes is .true."); + } } } @@ -3093,7 +3111,7 @@ sub setup_logic_do_transient_urban { } # if do_transient_urban is .true. and any of these (n_dom_* or toosmall_*) - # are > 0 or collapse_urban = .true., then give fatal error + # are > 0 or collapse_urban = .true., or vars_1dwt_w_time = .false., then give fatal error if (&value_is_true($nl->get_value($var))) { if (&value_is_true($nl->get_value('collapse_urban'))) { $log->fatal_error("$var cannot be combined with collapse_urban"); @@ -3103,6 +3121,12 @@ sub setup_logic_do_transient_urban { if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) { $log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8"); } + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vars_1dwt_w_time', + 'do_transient_urban'=>$nl_flags->{'do_transient_urban'}); + if (!&value_is_true($nl->get_value('vars_1dwt_w_time'))) { + $log->fatal_error("vars_1dwt_w_time cannot be .false. if do_transient_urban is .true."); + } } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 50e3cf68ad..4876e5bd14 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2472,6 +2472,11 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 .false. .false. .false. +.true. +.true. +.true. +.true. +.false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 210e4bf243..174e5f245f 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2779,6 +2779,15 @@ or more, which causes CAM to blow up. However, note that setting it to true will break water and energy conservation! + +A TRUE setting adds the time dimension to all 1dwt variables that appear in +files generated as a result of hist_dov2xy = .false. (e.g. pfts1d_wtcol). +Transient simulations (run_has_transient_landcover = .true.) have the same +outcome as vars_1dwt_w_time = .true.. +Use this flag if you wish to change FALSE to TRUE when run_has_transient_landcover = .false.. + + diff --git a/doc/ChangeLog b/doc/ChangeLog index d728cf2464..a54ee50639 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,81 @@ =============================================================== +Tag name: ctsm5.3.064 +Originator(s): slevis (Samuel Levis) +Date: Thu 24 Jul 2025 01:13:00 PM MDT +One-line Summary: Add time dimension to 1d_wt fields in transient runs + +Purpose and description of changes +---------------------------------- + + 1d_wt fields (e.g. pfts1d_wtgcell) appear in history when hist_dov2xy = .false. + This PR: + - adds the time dimension to these variables in Hist runs because these variables change with time + - adds new namelist variable vars_1dwt_w_time to let users add the time dimension when it is not added by default, i.e. in non-transient runs + - throws a build namelist error when the new namelist variable is .false. in a transient simulation + +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.] + +[ ] clm6_0 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Resolves #3307 Updating vector history file output... + +Notes of particular relevance for users +--------------------------------------- +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New namelist variable vars_1dwt_w_time; user will get an error if they set it to .false. when any of the following is .true.: + do_transient_pfts, do_transient_crops, do_transient_lakes, do_transient_urban + +Changes made to namelist defaults (e.g., changed parameter values): + vars_1dwt_w_time defaults to true when any of the following is .true.: + do_transient_pfts, do_transient_crops, do_transient_lakes, do_transient_urban + else vars_1dwt_w_time defaults to .false. + +Changes to documentation: + Added vars_1dwt_w_time to namelist_definition_ctsm.xml with an explanation of its use + +Testing summary: +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + - 1d_wt fields with the time dimension will display different answers in transient simulations, though this is diagnostic in nature. + - Only one test is affected in aux_clm: RXCROPMATURITYSKIPGEN_Ld1097.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/3328 + +=============================================================== +=============================================================== Tag name: ctsm5.3.063 Originator(s): samrabin (Sam Rabin, UCAR/TSS) Date: Thu Jul 10 12:28:36 MDT 2025 diff --git a/doc/ChangeSum b/doc/ChangeSum index 473d47e2b1..5e42dc2189 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.064 slevis 07/24/2025 Add time dimension to 1d_wt fields in transient runs ctsm5.3.063 samrabin 07/10/2025 Merge b4b-dev to master ctsm5.3.062 slevis 07/09/2025 Put inst. and non-inst. fields on separate hist files ctsm5.3.061 slevis 06/26/2025 Merge b4b-dev to master diff --git a/src/dyn_subgrid/dynSubgridControlMod.F90 b/src/dyn_subgrid/dynSubgridControlMod.F90 index 72e7229d0b..4cabcc168a 100644 --- a/src/dyn_subgrid/dynSubgridControlMod.F90 +++ b/src/dyn_subgrid/dynSubgridControlMod.F90 @@ -26,6 +26,7 @@ module dynSubgridControlMod public :: get_do_transient_crops ! return the value of the do_transient_crops control flag public :: get_do_transient_lakes ! return the value of the do_transient_lakes control flag public :: get_do_transient_urban ! return the value of the do_transient_urban control flag + public :: get_vars_1dwt_w_time ! return the value of the vars_1dwt_w_time control flag public :: run_has_transient_landcover ! returns true if any aspects of prescribed transient landcover are enabled public :: get_do_harvest ! return the value of the do_harvest control flag public :: get_do_grossunrep ! return the value of the do_grossunrep control flag @@ -47,6 +48,7 @@ module dynSubgridControlMod logical :: do_transient_urban = .false. ! whether to apply transient urban from dataset logical :: do_harvest = .false. ! whether to apply harvest from dataset logical :: do_grossunrep = .false. ! whether to apply gross unrepresented landcover change from dataset + logical :: vars_1dwt_w_time = .false. ! whether to add the time dimension to 1dwt variables, e.g. pfts1d_wtcol logical :: reset_dynbal_baselines = .false. ! whether to reset baseline values of total column water and energy in the first step of the run @@ -126,6 +128,7 @@ subroutine read_namelist( NLFilename ) logical :: do_transient_urban logical :: do_harvest logical :: do_grossunrep + logical :: vars_1dwt_w_time logical :: reset_dynbal_baselines logical :: for_testing_allow_non_annual_changes logical :: for_testing_zero_dynbal_fluxes @@ -144,6 +147,7 @@ subroutine read_namelist( NLFilename ) do_transient_urban, & do_harvest, & do_grossunrep, & + vars_1dwt_w_time, & reset_dynbal_baselines, & for_testing_allow_non_annual_changes, & for_testing_zero_dynbal_fluxes @@ -156,6 +160,7 @@ subroutine read_namelist( NLFilename ) do_transient_urban = .false. do_harvest = .false. do_grossunrep = .false. + vars_1dwt_w_time = .false. reset_dynbal_baselines = .false. for_testing_allow_non_annual_changes = .false. for_testing_zero_dynbal_fluxes = .false. @@ -183,6 +188,7 @@ subroutine read_namelist( NLFilename ) call shr_mpi_bcast (do_transient_urban, mpicom) call shr_mpi_bcast (do_harvest, mpicom) call shr_mpi_bcast (do_grossunrep, mpicom) + call shr_mpi_bcast (vars_1dwt_w_time, mpicom) call shr_mpi_bcast (reset_dynbal_baselines, mpicom) call shr_mpi_bcast (for_testing_allow_non_annual_changes, mpicom) call shr_mpi_bcast (for_testing_zero_dynbal_fluxes, mpicom) @@ -195,6 +201,7 @@ subroutine read_namelist( NLFilename ) do_transient_urban = do_transient_urban, & do_harvest = do_harvest, & do_grossunrep = do_grossunrep, & + vars_1dwt_w_time = vars_1dwt_w_time, & reset_dynbal_baselines = reset_dynbal_baselines, & for_testing_allow_non_annual_changes = for_testing_allow_non_annual_changes, & for_testing_zero_dynbal_fluxes = for_testing_zero_dynbal_fluxes) @@ -397,6 +404,18 @@ logical function get_do_transient_urban() end function get_do_transient_urban + !----------------------------------------------------------------------- + logical function get_vars_1dwt_w_time() + ! !DESCRIPTION: + ! Return the value of the vars_1dwt_w_time control flag + !----------------------------------------------------------------------- + + SHR_ASSERT_FL(dyn_subgrid_control_inst%initialized, sourcefile, __LINE__) + + get_vars_1dwt_w_time = dyn_subgrid_control_inst%vars_1dwt_w_time + + end function get_vars_1dwt_w_time + !----------------------------------------------------------------------- logical function run_has_transient_landcover() ! !DESCRIPTION: @@ -406,6 +425,7 @@ logical function run_has_transient_landcover() run_has_transient_landcover = & (get_do_transient_pfts() .or. & get_do_transient_crops() .or. & + get_do_transient_lakes() .or. & get_do_transient_urban()) end function run_has_transient_landcover diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 74d4185a56..6e2af830c9 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -3819,6 +3819,7 @@ subroutine hfields_1dinfo(t, f, mode) ! !USES: use decompMod , only : gindex_global use domainMod , only : ldomain, ldomain + use dynSubgridControlMod, only : run_has_transient_landcover, get_vars_1dwt_w_time ! ! !ARGUMENTS: integer, intent(in) :: t ! tape index @@ -3880,9 +3881,6 @@ subroutine hfields_1dinfo(t, f, mode) call ncd_defvar(varname='land1d_gi', xtype=ncd_int, dim1name=namel, & long_name='1d grid index of corresponding landunit', ifill_value=ispval, ncid=ncid) - call ncd_defvar(varname='land1d_wtgcell', xtype=ncd_double, dim1name=namel, & - long_name='landunit weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) - call ncd_defvar(varname='land1d_ityplunit', xtype=ncd_int, dim1name=namel, & long_name='landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)', & ifill_value=ispval, ncid=ncid) @@ -3910,12 +3908,6 @@ subroutine hfields_1dinfo(t, f, mode) call ncd_defvar(varname='cols1d_li', xtype=ncd_int, dim1name=namec, & long_name='1d landunit index of corresponding column', ifill_value=ispval, ncid=ncid) - call ncd_defvar(varname='cols1d_wtgcell', xtype=ncd_double, dim1name=namec, & - long_name='column weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) - - call ncd_defvar(varname='cols1d_wtlunit', xtype=ncd_double, dim1name=namec, & - long_name='column weight relative to corresponding landunit', fill_value=spval, ncid=ncid) - call ncd_defvar(varname='cols1d_itype_col', xtype=ncd_int, dim1name=namec, & long_name='column type (see global attributes)', ifill_value=ispval, ncid=ncid) @@ -3952,15 +3944,6 @@ subroutine hfields_1dinfo(t, f, mode) call ncd_defvar(varname='pfts1d_ci', xtype=ncd_int, dim1name=namep, & long_name='1d column index of corresponding pft', ifill_value=ispval, ncid=ncid) - call ncd_defvar(varname='pfts1d_wtgcell', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) - - call ncd_defvar(varname='pfts1d_wtlunit', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding landunit', fill_value=spval, ncid=ncid) - - call ncd_defvar(varname='pfts1d_wtcol', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding column', fill_value=spval, ncid=ncid) - call ncd_defvar(varname='pfts1d_itype_veg', xtype=ncd_int, dim1name=namep, & long_name='pft vegetation type', ifill_value=ispval, ncid=ncid) @@ -3974,6 +3957,45 @@ subroutine hfields_1dinfo(t, f, mode) call ncd_defvar(varname='pfts1d_active', xtype=ncd_log, dim1name=namep, & ifill_value=0, long_name='true => do computations on this pft', ncid=ncid) + ! group the wt variables together in an if-statement + if (run_has_transient_landcover() .or. get_vars_1dwt_w_time()) then ! transient simulation + call ncd_defvar(varname='land1d_wtgcell', xtype=ncd_double, dim1name=namel, dim2name='time', & + long_name='landunit weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='cols1d_wtgcell', xtype=ncd_double, dim1name=namec, dim2name='time', & + long_name='column weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='cols1d_wtlunit', xtype=ncd_double, dim1name=namec, dim2name='time', & + long_name='column weight relative to corresponding landunit', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='pfts1d_wtgcell', xtype=ncd_double, dim1name=namep, dim2name='time', & + long_name='pft weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='pfts1d_wtlunit', xtype=ncd_double, dim1name=namep, dim2name='time', & + long_name='pft weight relative to corresponding landunit', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='pfts1d_wtcol', xtype=ncd_double, dim1name=namep, dim2name='time', & + long_name='pft weight relative to corresponding column', fill_value=spval, ncid=ncid) + else + call ncd_defvar(varname='land1d_wtgcell', xtype=ncd_double, dim1name=namel, & + long_name='landunit weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='cols1d_wtgcell', xtype=ncd_double, dim1name=namec, & + long_name='column weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='cols1d_wtlunit', xtype=ncd_double, dim1name=namec, & + long_name='column weight relative to corresponding landunit', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='pfts1d_wtgcell', xtype=ncd_double, dim1name=namep, & + long_name='pft weight relative to corresponding gridcell', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='pfts1d_wtlunit', xtype=ncd_double, dim1name=namep, & + long_name='pft weight relative to corresponding landunit', fill_value=spval, ncid=ncid) + + call ncd_defvar(varname='pfts1d_wtcol', xtype=ncd_double, dim1name=namep, & + long_name='pft weight relative to corresponding column', fill_value=spval, ncid=ncid) + end if + else if (mode == 'write') then ! Determine bounds @@ -4035,7 +4057,6 @@ subroutine hfields_1dinfo(t, f, mode) ilarr = get_global_index_array(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, & subgrid_level=subgrid_level_gridcell) call ncd_io(varname='land1d_gi' , data=ilarr, dim1name=namel, ncid=ncid, flag='write') - call ncd_io(varname='land1d_wtgcell' , data=lun%wtgcell , dim1name=namel, ncid=ncid, flag='write') call ncd_io(varname='land1d_ityplunit', data=lun%itype , dim1name=namel, ncid=ncid, flag='write') call ncd_io(varname='land1d_active' , data=lun%active , dim1name=namel, ncid=ncid, flag='write') @@ -4066,14 +4087,12 @@ subroutine hfields_1dinfo(t, f, mode) subgrid_level=subgrid_level_landunit) call ncd_io(varname='cols1d_li', data=icarr , dim1name=namec, ncid=ncid, flag='write') - call ncd_io(varname='cols1d_wtgcell', data=col%wtgcell , dim1name=namec, ncid=ncid, flag='write') - call ncd_io(varname='cols1d_wtlunit', data=col%wtlunit , dim1name=namec, ncid=ncid, flag='write') call ncd_io(varname='cols1d_itype_col', data=col%itype , dim1name=namec, ncid=ncid, flag='write') do c = bounds%begc,bounds%endc icarr(c) = lun%itype(col%landunit(c)) enddo - call ncd_io(varname='cols1d_itype_lunit', data=icarr , dim1name=namec, ncid=ncid, flag='write') + call ncd_io(varname='cols1d_itype_lunit', data=icarr , dim1name=namec, ncid=ncid, flag='write') call ncd_io(varname='cols1d_active' , data=col%active , dim1name=namec, ncid=ncid, flag='write') call ncd_io(varname='cols1d_nbedrock', data=col%nbedrock , dim1name=namec, ncid=ncid, flag='write') @@ -4109,9 +4128,6 @@ subroutine hfields_1dinfo(t, f, mode) subgrid_level=subgrid_level_column) call ncd_io(varname='pfts1d_ci' , data=iparr , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_wtgcell' , data=patch%wtgcell , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_wtlunit' , data=patch%wtlunit , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_wtcol' , data=patch%wtcol , dim1name=namep, ncid=ncid, flag='write') call ncd_io(varname='pfts1d_itype_veg', data=patch%itype , dim1name=namep, ncid=ncid, flag='write') do p = bounds%begp,bounds%endp @@ -4122,10 +4138,27 @@ subroutine hfields_1dinfo(t, f, mode) do p = bounds%begp,bounds%endp iparr(p) = lun%itype(patch%landunit(p)) enddo - call ncd_io(varname='pfts1d_itype_lunit', data=iparr , dim1name=namep, ncid=ncid, flag='write') + call ncd_io(varname='pfts1d_itype_lunit', data=iparr , dim1name=namep, ncid=ncid, flag='write') call ncd_io(varname='pfts1d_active' , data=patch%active , dim1name=namep, ncid=ncid, flag='write') + ! group the wt variables together in an if-statement + if (run_has_transient_landcover() .or. get_vars_1dwt_w_time()) then ! transient simulation + call ncd_io(varname='land1d_wtgcell' , data=lun%wtgcell , dim1name=namel, ncid=ncid, flag='write', nt=tape(t)%ntimes(f)) + call ncd_io(varname='cols1d_wtgcell', data=col%wtgcell , dim1name=namec, ncid=ncid, flag='write', nt=tape(t)%ntimes(f)) + call ncd_io(varname='cols1d_wtlunit', data=col%wtlunit , dim1name=namec, ncid=ncid, flag='write', nt=tape(t)%ntimes(f)) + call ncd_io(varname='pfts1d_wtgcell' , data=patch%wtgcell , dim1name=namep, ncid=ncid, flag='write', nt=tape(t)%ntimes(f)) + call ncd_io(varname='pfts1d_wtlunit' , data=patch%wtlunit , dim1name=namep, ncid=ncid, flag='write', nt=tape(t)%ntimes(f)) + call ncd_io(varname='pfts1d_wtcol' , data=patch%wtcol , dim1name=namep, ncid=ncid, flag='write', nt=tape(t)%ntimes(f)) + else + call ncd_io(varname='land1d_wtgcell' , data=lun%wtgcell , dim1name=namel, ncid=ncid, flag='write') + call ncd_io(varname='cols1d_wtgcell', data=col%wtgcell , dim1name=namec, ncid=ncid, flag='write') + call ncd_io(varname='cols1d_wtlunit', data=col%wtlunit , dim1name=namec, ncid=ncid, flag='write') + call ncd_io(varname='pfts1d_wtgcell' , data=patch%wtgcell , dim1name=namep, ncid=ncid, flag='write') + call ncd_io(varname='pfts1d_wtlunit' , data=patch%wtlunit , dim1name=namep, ncid=ncid, flag='write') + call ncd_io(varname='pfts1d_wtcol' , data=patch%wtcol , dim1name=namep, ncid=ncid, flag='write') + end if + deallocate(rgarr,rlarr,rcarr,rparr) deallocate(igarr,ilarr,icarr,iparr)