From 9a7b67bd5aa284f925bfea17b3c25a83457fc5e6 Mon Sep 17 00:00:00 2001 From: David Clemens-Sewall Date: Fri, 3 Feb 2023 16:08:21 -0700 Subject: [PATCH] updated namelist settings and documentation. all tests pass --- configuration/driver/icedrv_restart.F90 | 11 +++---- .../{set_nml.ionetcdf => set_nml.histcdf} | 1 - configuration/scripts/options/set_nml.restcdf | 1 + configuration/scripts/tests/io_suite.ts | 6 ++++ .../scripts/tests/netcdf_nobgc_suite.ts | 32 +++++++++---------- doc/source/icepack_index.rst | 1 + doc/source/user_guide/ug_case_settings.rst | 1 + 7 files changed, 30 insertions(+), 23 deletions(-) rename configuration/scripts/options/{set_nml.ionetcdf => set_nml.histcdf} (50%) create mode 100644 configuration/scripts/options/set_nml.restcdf diff --git a/configuration/driver/icedrv_restart.F90 b/configuration/driver/icedrv_restart.F90 index 397620654..0adbb5c2a 100644 --- a/configuration/driver/icedrv_restart.F90 +++ b/configuration/driver/icedrv_restart.F90 @@ -32,6 +32,8 @@ module icedrv_restart write_restart_aero, read_restart_aero character (len=3), private :: nchar ! + + logical (kind=log_kind), private :: diag ! netCDF diagnostics flag #ifdef USE_NETCDF private :: & @@ -43,8 +45,6 @@ module icedrv_restart integer (kind=int_kind), private :: & ncid ! ID for NetCDF file - - logical (kind=log_kind), private :: diag ! netCDF diagnostics flag #endif public :: dumpfile, restartfile, final_restart, & @@ -285,9 +285,6 @@ subroutine restartfile (ice_ic) integer (kind=int_kind) :: & status - ! set this to .true. for netcdf diagnostic output - diag = .false. - ! Query tracers call icepack_query_tracer_indices(nt_Tsfc_out=nt_Tsfc, nt_sice_out=nt_sice, & nt_qice_out=nt_qice, nt_qsno_out=nt_qsno) @@ -315,6 +312,8 @@ subroutine restartfile (ice_ic) read (nu_restart) istep0,time,time_forc else if (restart_format == 'nc') then #ifdef USE_NETCDF + ! set this to .true. for netcdf diagnostic output + diag = .false. ! Open restart files status = nf90_open(trim(filename), nf90_nowrite, ncid) if (status /= nf90_noerr) call icedrv_system_abort(string=subname//'Couldnt open netcdf file', & @@ -714,7 +713,7 @@ subroutine read_restart_snow() call read_restart_field(nu_restart,trcrn(:,nt_smice+k-1,:),ncat,'smice'//trim(nchar)) call read_restart_field(nu_restart,trcrn(:,nt_smliq+k-1,:),ncat,'smliq'//trim(nchar)) call read_restart_field(nu_restart,trcrn(:,nt_rhos +k-1,:),ncat,'rhos'//trim(nchar)) - call read_restart_field(nu_restart,trcrn(:,nt_rsnw +k-1,:),ncat,'rsnow'//trim(nchar)) + call read_restart_field(nu_restart,trcrn(:,nt_rsnw +k-1,:),ncat,'rsnw'//trim(nchar)) enddo end subroutine read_restart_snow diff --git a/configuration/scripts/options/set_nml.ionetcdf b/configuration/scripts/options/set_nml.histcdf similarity index 50% rename from configuration/scripts/options/set_nml.ionetcdf rename to configuration/scripts/options/set_nml.histcdf index 264465010..a1b6d4289 100644 --- a/configuration/scripts/options/set_nml.ionetcdf +++ b/configuration/scripts/options/set_nml.histcdf @@ -1,2 +1 @@ history_format = 'nc' -restart_format = 'nc' diff --git a/configuration/scripts/options/set_nml.restcdf b/configuration/scripts/options/set_nml.restcdf new file mode 100644 index 000000000..014a61c4e --- /dev/null +++ b/configuration/scripts/options/set_nml.restcdf @@ -0,0 +1 @@ +restart_format = 'nc' diff --git a/configuration/scripts/tests/io_suite.ts b/configuration/scripts/tests/io_suite.ts index 2af2980d5..f4d5d88a5 100644 --- a/configuration/scripts/tests/io_suite.ts +++ b/configuration/scripts/tests/io_suite.ts @@ -1,2 +1,8 @@ restart col 1x1 debug,ionetcdf smoke col 1x1 run1year,diag1,ionetcdf +restart col 1x1 debug,ionetcdf,histcdf +smoke col 1x1 run1year,diag1,ionetcdf,histcdf +restart col 1x1 debug,ionetcdf,restcdf +smoke col 1x1 run1year,diag1,ionetcdf,restcdf +restart col 1x1 debug,ionetcdf,histcdf,restcdf +smoke col 1x1 run1year,diag1,ionetcdf,histcdf,restcdf \ No newline at end of file diff --git a/configuration/scripts/tests/netcdf_nobgc_suite.ts b/configuration/scripts/tests/netcdf_nobgc_suite.ts index 90d25c5cf..65365380d 100644 --- a/configuration/scripts/tests/netcdf_nobgc_suite.ts +++ b/configuration/scripts/tests/netcdf_nobgc_suite.ts @@ -1,18 +1,18 @@ # Test Grid PEs Sets BFB-compare -restart col 1x1 debug,ionetcdf -restart col 1x1 diag1,ionetcdf -restart col 1x1 pondlvl,ionetcdf -restart col 1x1 pondtopo,ionetcdf -restart col 1x1 thermo1,ionetcdf -restart col 1x1 swccsm3,ionetcdf -restart col 1x1 isotope,ionetcdf -restart col 1x1 alt01,ionetcdf -restart col 1x1 alt02,ionetcdf -restart col 1x1 alt03,ionetcdf -restart col 1x1 alt04,ionetcdf -restart col 1x1 saltflux,ionetcdf -restart col 1x1 dyn,ionetcdf -restart col 1x1 fsd12,short,ionetcdf -restart col 1x1 snwitdrdg,snwgrain,ionetcdf -restart col 1x1 modal,ionetcdf +restart col 1x1 debug,ionetcdf,restcdf +restart col 1x1 diag1,ionetcdf,restcdf +restart col 1x1 pondlvl,ionetcdf,restcdf +restart col 1x1 pondtopo,ionetcdf,restcdf +restart col 1x1 thermo1,ionetcdf,restcdf +restart col 1x1 swccsm3,ionetcdf,restcdf +restart col 1x1 isotope,ionetcdf,restcdf +restart col 1x1 alt01,ionetcdf,restcdf +restart col 1x1 alt02,ionetcdf,restcdf +restart col 1x1 alt03,ionetcdf,restcdf +restart col 1x1 alt04,ionetcdf,restcdf +restart col 1x1 saltflux,ionetcdf,restcdf +restart col 1x1 dyn,ionetcdf,restcdf +restart col 1x1 fsd12,short,ionetcdf,restcdf +restart col 1x1 snwitdrdg,snwgrain,ionetcdf,restcdf +restart col 1x1 modal,ionetcdf,restcdf diff --git a/doc/source/icepack_index.rst b/doc/source/icepack_index.rst index 52ac22342..08a3b0d94 100755 --- a/doc/source/icepack_index.rst +++ b/doc/source/icepack_index.rst @@ -383,6 +383,7 @@ either Celsius or Kelvin units). Deprecated parameters are listed at the end. "restart_bgc", ":math:`\bullet` if true, read bgc restart file", "" "restart_dir", ":math:`\bullet` path to restart/dump files", "" "restart_file", ":math:`\bullet` restart file prefix", "" + "restart_format", "history files are read/written in binary or netcdf format if set to 'bin' or 'nc' respectively", "bin" "restart_[tracer]", ":math:`\bullet` if true, read tracer restart file", "" "restore_bgc", ":math:`\bullet` if true, restore nitrate/silicate to data", "" "restore_ice", ":math:`\bullet` if true, restore ice state along lateral boundaries", "" diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index f5abe6539..ff347c2e8 100644 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -150,6 +150,7 @@ setup_nml "``restart``", "logical", "initialize using restart file", "``.false.``" "``restart_dir``", "string", "path to restart directory", "'./'" "``restart_file``", "string", "output file prefix for restart dump", "'iced'" + "``restart_format``", "string", "history files are read/written in binary or netcdf format if set to 'bin' or 'nc' respectively", "'bin'" "``use_leap_years``", "logical", "include leap days", "``.false.``" "``year_init``", "integer", "the initial year if not using restart", "0" "", "", "", ""