Skip to content

Commit

Permalink
Merge pull request #929 from brian-eaton/nstep0
Browse files Browse the repository at this point in the history
cam6_3_141: Improve handling of 0th / initial time in history output
  • Loading branch information
brian-eaton authored Dec 8, 2023
2 parents 32f2772 + 29b1080 commit e64a526
Show file tree
Hide file tree
Showing 23 changed files with 216 additions and 7 deletions.
9 changes: 9 additions & 0 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,15 @@ the {{ hilight }}fincl#{{ closehilight }} namelist items.
Default: FALSE
</entry>

<entry id="write_nstep0" type="logical" category="history"
group="cam_history_nl" valid_values="" >
If true then write the nstep==0 time sample to all history files except
the monthly average file. This output is primarily useful for development
and debugging as it captures changes to the model state made during the
initialization phase of the run.
Default: FALSE
</entry>

<entry id="fexcl1" type="char*24(1000)" category="history"
group="cam_history_nl" valid_values="" >
List of fields to exclude from the 1st history file (by default the name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
write_nstep0 = .true.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
write_nstep0 = .true.
ncdata='$DIN_LOC_ROOT/atm/cam/inic/fv/aqua_0006-01-01_1.9x2.5_L26_c161020.nc'
use_topo_file=.false.
atm_dep_flux=.false.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
write_nstep0 = .true.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
write_nstep0 = .true.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
rad_data_output = .false.
mfilt=100,100
nhtfrq=-120,73
write_nstep0 = .true.

prescribed_strataero_3modes = .true.
prescribed_strataero_cycle_yr = 1999
Expand Down
1 change: 1 addition & 0 deletions cime_config/testdefs/testmods_dirs/cam/nudging/user_nl_cam
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
fincl3='U','V','T','Q','PS','Nudge_U','Nudge_V','Nudge_T','Nudge_Q','Target_U','Target_V','Target_T','Target_Q'
nhtfrq=0,-6,1
mfilt =1,4,48
write_nstep0 = .true.

ncdata='$DIN_LOC_ROOT/atm/cam/nudging/ERAI_fv09_BILIN/ERAI_fv09_DART2.cam2.i.2009-01-01-00000.nc'
/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=-24,-24,-24,-24,-24,-24
write_nstep0 = .true.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mfilt=1,1,1,1,1,1,1,1,1,1
ndens=1,1,1,1,1,1,1,1,1,1
nhtfrq=-3,-3,-3,-3,-3,-3,-3,-3,-3,-3
write_nstep0 = .true.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=3,3,3,3,3,3
write_nstep0=.true.
inithist='ENDOFRUN'
pbuf_global_allocate=.false.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ndens=1,1,1,1,1,1
nhtfrq=3,3,3,3,-2,3
mfilt=1,1,1,1,1,1
write_nstep0=.true.
sathist_track_infile='$DIN_LOC_ROOT/atm/cam/sat/satellite_profilelist_20020125_20101030_c110204_noleap.nc'
sathist_fincl = 'Q','T','PS','U','V','FV'
fincl3 = 'Q','T','PS','FV','UWzm:I'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mfilt=1,1,1,1,1,1
ndens=2,2,2,2,2,2
nhtfrq=3,3,3,3,3,3
write_nstep0=.true.
inithist='ENDOFRUN'
history_amwg=.true.
history_aerosol=.true.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
write_nstep0=.true.
inithist='ENDOFRUN'
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
write_nstep0=.true.
inithist='ENDOFRUN'

mee_ion_inline=.true.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
write_nstep0=.true.
inithist='ENDOFRUN'

mee_fluxes_filepath='$DIN_LOC_ROOT/atm/waccm/mee/RBSP-ECT_FB_precip_c211124.nc'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=-24,-24,-24,-24,-24,-24
write_nstep0=.true.

fincl1 = ' '
fincl2 = ' '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ NDENS = 1,1
MFILT = 1,10
nhtfrq = 0,1
inithist_all = .true.
write_nstep0 = .true.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ NDENS = 1,1
MFILT = 1,10
nhtfrq = 0,1
inithist_all = .true.
write_nstep0 = .true.
1 change: 1 addition & 0 deletions cime_config/testdefs/testmods_dirs/cam/scmarm/user_nl_cam
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mfilt=1500
nhtfrq = 1
history_budget=.true.
write_nstep0 = .true.
1 change: 1 addition & 0 deletions cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dtime = 1800
nhtfrq = 0,-24,-6,-3
write_nstep0 = .true.
mfilt = 1,5000,5000
ndens = 2,2,2,2,2,2
history_budget = .true.
Expand Down
164 changes: 164 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,168 @@
===============================================================

Tag name: cam6_3_141
Originator(s): eaton
Date: 8 December 2023
One-line Summary: Improve handling of 0th / initial time in history output
Github PR URL: https://github.com/ESCOMP/CAM/pull/929

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

. Issue #459 - Improve handling of 0th / initial time in history output
- Add namelist variable, write_nstep0, to control output of nstep==0 time
sample. This output is now turned OFF by default.

. resolves #459

Describe any changes made to build system: none

Describe any changes made to the namelist:
. Add logical variable write_nstep0 to namelist group cam_history_nl.
Default value is .false.

List any changes to the defaults for the boundary datasets: none

Describe any substantial timing or memory changes: none

Code reviewed by: cacraigucar, peverwhee

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:

bld/namelist_files/namelist_definition.xml
. Add logical variable write_nstep0 to namelist group cam_history_nl.
Default value is .false.

doc/ChangeLog_template
. remove cheyenne test results section

cime_config/testdefs/testmods_dirs/cam/cam4_port/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/cam4_port5d/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/cam5_port_f45/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/cam5_port_ne30/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/cam6_port_f09/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/nudging/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq1d/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq3h/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq3s/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq3s_cospsathist/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq3s_diags/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq9s/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq9s_apmee/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/outfrq9s_mee_fluxes/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/reduced_hist1d/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/scm_prep/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/scm_prep_c6/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/scmarm/user_nl_cam
cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam
. add write_nstep0=.true.
- This change to the namelist keeps the output files unchanged so
baselines pass. It also keeps the nstep==0 output which is useful for
debugging.

src/control/cam_history.F90
. add write_nstep0 to namelist input and echo to atm.log file
. wshist
- add logic for nstep==0 to the code section that determines when history
buffers are written to files. If history buffers are not written at
nstep==0, then zero them. This partial time step from the
initialization process shouldn't be accumulated with subsequent
timestep output.

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:
ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
- pre-existing failures

ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s (Overall: NLFAIL) details:
ERC_D_Ln9_Vnuopc.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: NLFAIL) details:
ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_D_Ln9_Vnuopc.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_D_Ln9_Vnuopc.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_D_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.F2000dev.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ld3_Vnuopc.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: NLFAIL) details:
ERP_Lh12_Vnuopc.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: NLFAIL) details:
ERP_Ln9_P24x3_Vnuopc.f45_f45_mg37.QPWmaC6.derecho_intel.cam-outfrq9s_mee_fluxes (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.ne30_ne30_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERS_Ln9_Vnuopc.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERS_Ln9_Vnuopc.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
ERS_Ln9_Vnuopc.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep (Overall: NLFAIL) details:
SMS_D_Ld5_Vnuopc.f19_f19_mg17.PC4.derecho_intel.cam-cam4_port5d (Overall: NLFAIL) details:
SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.T42_T42.FSCAM.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
SMS_Ld1_Vnuopc.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: NLFAIL) details:
SMS_Ld1_Vnuopc.f19_f19.F2000dev.derecho_intel.cam-outfrq1d (Overall: NLFAIL) details:
SMS_Ld1_Vnuopc.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: NLFAIL) details:
SMS_Ld5_Vnuopc.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 (Overall: NLFAIL) details:
SMS_Lh12_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: NLFAIL) details:
SMS_Ln9_Vnuopc.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: NLFAIL) details:
SMS_Ln9_Vnuopc.f19_f19.F2000climo.derecho_intel.cam-silhs (Overall: NLFAIL) details:
- added write_nstep0=.true. to tests

izumi/nag/aux_cam:
DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
- pre-existing failure

ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: NLFAIL) details:
ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
ERC_D_Ln9_Vnuopc.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
ERS_Ln27_Vnuopc.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
ERS_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: NLFAIL) details:
PEM_D_Ln9_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
SMS_D_Ln3_Vnuopc.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
SMS_D_Ln7_Vnuopc.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: NLFAIL) details:
SMS_D_Ln9_P1x1_Vnuopc.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
SUB_D_Ln9_Vnuopc.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: NLFAIL) details:
- added write_nstep0=.true. to tests

izumi/gnu/aux_cam:
ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: NLFAIL) details:
ERC_D_Ln9_Vnuopc.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
ERC_D_Ln9_Vnuopc.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
ERC_D_Ln9_Vnuopc.ne5pg4_ne5pg4_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
ERP_Ln9_Vnuopc.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
PEM_D_Ln9_Vnuopc.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s (Overall: NLFAIL) details:
SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep (Overall: NLFAIL) details:
SCT_D_Ln7_Vnuopc.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: NLFAIL) details:
SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
SMS_D_Ln9_Vnuopc.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: NLFAIL) details:
SMS_P48x1_D_Ln9_Vnuopc.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: NLFAIL) details:
- added write_nstep0=.true. to tests

CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: BFB

===============================================================
===============================================================

Tag name: cam6_3_140
Originator(s): peverwhee
Date: 6 December 2023
Expand Down Expand Up @@ -604,6 +767,7 @@ izumi/gnu/aux_cam: All PASS

Summarize any changes to answers: bit-for-bit unchanged

===============================================================
===============================================================

Tag name: cam6_3_136
Expand Down
2 changes: 0 additions & 2 deletions doc/ChangeLog_template
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

cheyenne/intel/aux_cam:

derecho/intel/aux_cam:

izumi/nag/aux_cam:
Expand Down
29 changes: 24 additions & 5 deletions src/control/cam_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ module cam_history
logical :: rgnht(ptapes) = .false. ! flag array indicating regeneration volumes
logical :: hstwr(ptapes) = .false. ! Flag for history writes
logical :: empty_htapes = .false. ! Namelist flag indicates no default history fields
logical :: write_nstep0 = .false. ! write nstep==0 time sample to history files (except monthly)
logical :: htapes_defined = .false. ! flag indicates history contents have been defined

character(len=cl) :: model_doi_url = '' ! Model DOI
Expand Down Expand Up @@ -626,7 +627,7 @@ subroutine history_readnl(nlfile)

! History namelist items
namelist /cam_history_nl/ ndens, nhtfrq, mfilt, inithist, inithist_all, &
avgflag_pertape, empty_htapes, lcltod_start, lcltod_stop, &
avgflag_pertape, empty_htapes, write_nstep0, lcltod_start, lcltod_stop,&
fincl1lonlat, fincl2lonlat, fincl3lonlat, fincl4lonlat, fincl5lonlat, &
fincl6lonlat, fincl7lonlat, fincl8lonlat, fincl9lonlat, &
fincl10lonlat, collect_column_output, hfilename_spec, &
Expand Down Expand Up @@ -825,8 +826,14 @@ subroutine history_readnl(nlfile)
end do
end if ! masterproc

! Print per-tape averaging flags
! log output
if (masterproc) then

if (write_nstep0) then
write(iulog,*)'nstep==0 time sample will be written to all files except monthly average.'
end if

! Print per-tape averaging flags
do t = 1, ptapes
if (avgflag_pertape(t) /= ' ') then
write(iulog,*)'Unless overridden by namelist input on a per-field basis (FINCL),'
Expand Down Expand Up @@ -885,6 +892,7 @@ subroutine history_readnl(nlfile)
call mpi_bcast(lcltod_stop, ptapes, mpi_integer, masterprocid, mpicom, ierr)
call mpi_bcast(collect_column_output, ptapes, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(empty_htapes,1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(write_nstep0,1, mpi_logical, masterprocid, mpicom, ierr)
call mpi_bcast(avgflag_pertape, ptapes, mpi_character, masterprocid, mpicom, ierr)
call mpi_bcast(hfilename_spec, len(hfilename_spec(1))*ptapes, mpi_character, masterprocid, mpicom, ierr)
call mpi_bcast(fincl, len(fincl (1,1))*pflds*ptapes, mpi_character, masterprocid, mpicom, ierr)
Expand Down Expand Up @@ -5585,9 +5593,20 @@ subroutine wshist (rgnht_in)
hstwr(t) = nstep /= 0 .and. day == 1 .and. ncsec(instantaneous_file_index) == 0
prev = .true.
else
hstwr(t) = mod(nstep,nhtfrq(t)) == 0
prev = .false.
end if
if (nstep == 0) then
if (write_nstep0) then
hstwr(t) = .true.
else
! zero the buffers if nstep==0 data not written
do f = 1, nflds(t)
call h_zero(f, t)
end do
end if
else
hstwr(t) = mod(nstep,nhtfrq(t)) == 0
endif
prev = .false.
end if
end if
end if
time = ndcur + nscur/86400._r8
Expand Down

0 comments on commit e64a526

Please sign in to comment.