diff --git a/cicecore/cicedyn/analysis/ice_history_shared.F90 b/cicecore/cicedyn/analysis/ice_history_shared.F90 index 6d4850119..16a153c93 100644 --- a/cicecore/cicedyn/analysis/ice_history_shared.F90 +++ b/cicecore/cicedyn/analysis/ice_history_shared.F90 @@ -57,6 +57,9 @@ module ice_history_shared character (len=char_len), public :: & history_format + character (len=char_len), public :: & + hist_suffix(max_nstrm) ! appended to 'h' in filename when not 'x' + !--------------------------------------------------------------- ! Instructions for adding a field: (search for 'example') ! Here or in ice_history_[process].F90: @@ -763,9 +766,7 @@ subroutine construct_filename(ncfile,suffix,ns) endif cstream = '' -!echmod ! this was implemented for CESM but it breaks post-processing software -!echmod ! of other groups (including RASM which uses CESMCOUPLED) -!echmod if (ns > 1) write(cstream,'(i1.1)') ns-1 + if (hist_suffix(ns) /= 'x') cstream = hist_suffix(ns) if (hist_avg(ns)) then ! write averaged data if (histfreq(ns) == '1' .and. histfreq_n(ns) == 1) then ! timestep diff --git a/cicecore/cicedyn/general/ice_init.F90 b/cicecore/cicedyn/general/ice_init.F90 index 75c5a03cf..8875c7a29 100644 --- a/cicecore/cicedyn/general/ice_init.F90 +++ b/cicecore/cicedyn/general/ice_init.F90 @@ -79,7 +79,7 @@ subroutine input_data use ice_restart_shared, only: & restart, restart_ext, restart_coszen, restart_dir, restart_file, pointer_file, & runid, runtype, use_restart_time, restart_format, lcdf64 - use ice_history_shared, only: hist_avg, history_dir, history_file, & + use ice_history_shared, only: hist_avg, history_dir, history_file, hist_suffix, & incond_dir, incond_file, version_name, & history_precision, history_format, hist_time_axis use ice_flux, only: update_ocn_f, cpl_frazil, l_mpond_fresh @@ -188,6 +188,7 @@ subroutine input_data hist_time_axis, & print_global, print_points, latpnt, lonpnt, & debug_forcing, histfreq, histfreq_n, hist_avg, & + hist_suffix, & history_dir, history_file, history_precision, cpl_bgc, & histfreq_base, dumpfreq_base, timer_stats, memory_stats, & conserv_check, debug_model, debug_model_step, & @@ -324,6 +325,7 @@ subroutine input_data histfreq_n(:) = 1 ! output frequency histfreq_base(:) = 'zero' ! output frequency reference date hist_avg(:) = .true. ! if true, write time-averages (not snapshots) + hist_suffix(:) = 'x' ! appended to 'history_file' in filename when not 'x' history_format = 'default' ! history file format hist_time_axis = 'end' ! History file time axis averaging interval position @@ -911,6 +913,7 @@ subroutine input_data call broadcast_scalar(histfreq_base(n), master_task) call broadcast_scalar(dumpfreq(n), master_task) call broadcast_scalar(dumpfreq_base(n), master_task) + call broadcast_scalar(hist_suffix(n), master_task) enddo call broadcast_array(hist_avg, master_task) call broadcast_array(histfreq_n, master_task) @@ -2355,6 +2358,7 @@ subroutine input_data write(nu_diag,1023) ' histfreq_n = ', histfreq_n(:) write(nu_diag,1033) ' histfreq_base = ', histfreq_base(:) write(nu_diag,*) ' hist_avg = ', hist_avg(:) + write(nu_diag,1033) ' hist_suffix = ', hist_suffix(:) write(nu_diag,1031) ' history_dir = ', trim(history_dir) write(nu_diag,1031) ' history_file = ', trim(history_file) write(nu_diag,1021) ' history_precision= ', history_precision diff --git a/configuration/scripts/ice_in b/configuration/scripts/ice_in index a1bbea26a..85f502683 100644 --- a/configuration/scripts/ice_in +++ b/configuration/scripts/ice_in @@ -49,6 +49,7 @@ histfreq_n = 1 , 1 , 1 , 1 , 1 histfreq_base = 'zero','zero','zero','zero','zero' hist_avg = .true.,.true.,.true.,.true.,.true. + hist_suffix = 'x','x','x','x','x' history_dir = './history/' history_file = 'iceh' history_precision = 4 diff --git a/doc/source/cice_index.rst b/doc/source/cice_index.rst index bf5533d46..dae10eda4 100644 --- a/doc/source/cice_index.rst +++ b/doc/source/cice_index.rst @@ -325,6 +325,7 @@ section :ref:`tabnamelist`. "history_format", "history file format", "" "history_precision", "history output precision: 4 or 8 byte", "4" "hist_time_axis", "history file time axis interval location: begin, middle, end", "end" + "hist_suffix", "suffix to `history_file` in filename. x means no suffix", "x,x,x,x,x" "hm", "land/boundary mask, thickness (T-cell)", "" "hmix", "ocean mixed layer depth", "20. m" "hour", "hour of the year", "" diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index a3e6166aa..fd808fd8f 100644 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -198,6 +198,7 @@ setup_nml "``history_format``", "``default``", "read/write history files in default format", "``default``" "", "``pio_pnetcdf``", "read/write restart files with pnetcdf in pio", "" "``history_precision``", "integer", "history file precision: 4 or 8 byte", "4" + "``hist_suffix``", "character array", "appended to history_file when not x", "``x,x,x,x,x``" "``hist_time_axis``","character","history file time axis interval location: begin, middle, end","end" "``ice_ic``", "``default``", "equal to internal", "``default``" "", "``internal``", "initial conditions set based on ice\_data\_type,conc,dist inputs", "" diff --git a/doc/source/user_guide/ug_implementation.rst b/doc/source/user_guide/ug_implementation.rst index af246ccff..a67fc3a58 100644 --- a/doc/source/user_guide/ug_implementation.rst +++ b/doc/source/user_guide/ug_implementation.rst @@ -1158,8 +1158,11 @@ io package. The namelist variable ``history_format`` further refines the format approach or style for some io packages. Model output data can be written as instantaneous or average data as specified -by the ``hist_avg`` namelist array and is customizable by stream. The data is -written at the period(s) given by ``histfreq`` and +by the ``hist_avg`` namelist array and is customizable by stream. Characters +can be added to the ``history_filename`` to distinguish the streams. This can be changed +by modifying ``hist_suffix`` to something other than "x". + +The data written at the period(s) given by ``histfreq`` and ``histfreq_n`` relative to a reference date specified by ``histfreq_base``. The files are written to binary or netCDF files prepended by ``history_file`` in **ice_in**. These settings for history files are set in the @@ -1199,7 +1202,7 @@ is a character string corresponding to ``histfreq`` or ‘x’ for none. files, no matter what the frequency is.) If there are no namelist flags with a given ``histfreq`` value, or if an element of ``histfreq_n`` is 0, then no file will be written at that frequency. The output period can be -discerned from the filenames. Each history stream will be either instantaneous +discerned from the filenames or the ``hist_suffix`` can be used. Each history stream will be either instantaneous or averaged as specified by the corresponding entry in the ``hist_avg`` namelist array, and the frequency will be relative to a reference date specified by the corresponding entry in ``histfreq_base``. More information about how the frequency is