From b742505d519a9942cb1101ba9c418c846d1f7c09 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 18 Jan 2025 14:37:58 -0700 Subject: [PATCH 1/9] Add more error messaging fixing #524 --- cesm/driver/esm_time_mod.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cesm/driver/esm_time_mod.F90 b/cesm/driver/esm_time_mod.F90 index c423b96fc..4a81cc683 100644 --- a/cesm/driver/esm_time_mod.F90 +++ b/cesm/driver/esm_time_mod.F90 @@ -141,6 +141,7 @@ subroutine esm_time_clockinit(ensemble_driver, instance_driver, logunit, maintas inquire( file=trim(restart_pfile), exist=exists) if (.not. exists) then rc = ESMF_FAILURE + write(logunit,*) " drv_restart_pointer file does NOT exist, correct this and rerun = "//trim(restart_pfile) call ESMF_LogWrite(trim(subname)//' ERROR rpointer file '//trim(restart_pfile)//' not found', & ESMF_LOGMSG_ERROR, line=__LINE__, file=__FILE__) return @@ -150,6 +151,7 @@ subroutine esm_time_clockinit(ensemble_driver, instance_driver, logunit, maintas open(newunit=unitn, file=restart_pfile, form='FORMATTED', status='old',iostat=ierr) if (ierr < 0) then rc = ESMF_FAILURE + write(logunit,*) " error opening rpointer file " call ESMF_LogWrite(trim(subname)//' ERROR rpointer file open returns error', & ESMF_LOGMSG_ERROR, line=__LINE__, file=__FILE__) return @@ -157,6 +159,7 @@ subroutine esm_time_clockinit(ensemble_driver, instance_driver, logunit, maintas read(unitn,'(a)', iostat=ierr) restart_file if (ierr < 0) then rc = ESMF_FAILURE + write(logunit,*) " error in read of rpointer file " call ESMF_LogWrite(trim(subname)//' ERROR rpointer file read returns error', & ESMF_LOGMSG_INFO, line=__LINE__, file=__FILE__) return From ee2677f33943a634c156c03f6d73b5b107a7c186 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 18 Jan 2025 14:40:19 -0700 Subject: [PATCH 2/9] Change the list of groups added for writing out the cpl.input_data_list file to check for file existence, fixing #526 --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 7ffc28f82..e83fbabac 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -320,7 +320,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): # Write namelist file drv_in and initial input dataset list. # -------------------------------- namelist_file = os.path.join(confdir, "drv_in") - drv_namelist_groups = ["papi_inparm", "prof_inparm", "debug_inparm"] + drv_namelist_groups = ["DRIVER_attributes", "MED_attributes", "ALLCOMP_attributes", "ROF_attributes", "WAV_attributes"] nmlgen.write_output_file( namelist_file, data_list_path=data_list_path, groups=drv_namelist_groups ) From c1dcacbc73e9b76a8ad33da52677b6afe938947a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 18 Jan 2025 15:17:12 -0700 Subject: [PATCH 3/9] Only set drv_restart_pointer for branch type (NOTE: will also need to allow continue_run as well), add it as a file that will be put into cpl.input_data_list for existence checking, fixing #525 --- cime_config/config_component.xml | 5 ++++- cime_config/namelist_definition_drv.xml | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 8d5cb5dda..094c2da2f 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -404,13 +404,16 @@ char - rpointer.cpl + rpointer.cpl.${RUN_STARTDATE}-${RUN_REFTOD} run_begin_stop_restart env_run.xml Name of the restart pointer file, this can be used to restart from an intermediate restart by appending the restart date and time in format YYYY-MM-DD-SSSSS + + rpointer.cpl.${RUN_STARTDATE}-${RUN_REFTOD} + diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index 8835c53b8..516f54fac 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -18,6 +18,14 @@ + + char + nuopc + DRIVER_attributes + + $RUNDIR + + integer pio @@ -165,12 +173,16 @@ char expdef + none + + rel:rundir DRIVER_attributes Driver restart pointer file to initialize time info - $DRV_RESTART_POINTER + none + $DRV_RESTART_POINTER From f1146570b5fc2938e8d009c6e95257280c2f135b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 18 Jan 2025 16:34:09 -0700 Subject: [PATCH 4/9] Add continue_run to namelist definition so it can be used to make sure drv_restart_pointer is set in that case, also move it and rundir to the default_settings group so won't be output --- cime_config/namelist_definition_drv.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index 516f54fac..ab0e951a2 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -21,11 +21,23 @@ char nuopc - DRIVER_attributes + + default_settings $RUNDIR + + + logical + nuopc + + default_settings + + $CONTINUE_RUN + + + integer pio @@ -183,6 +195,7 @@ none $DRV_RESTART_POINTER + $DRV_RESTART_POINTER From 6ca33f9309ab034de09bb27bafe9ba97f105cd59 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 Jan 2025 00:03:17 -0700 Subject: [PATCH 5/9] Setting drv_restart_pointer to none tries to pull a file from svn inputdata named none -- but when UNSET is used it doesn't add it to cpl.input_data_list and so works --- cime_config/namelist_definition_drv.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index ab0e951a2..0ddb792e4 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -185,7 +185,7 @@ char expdef - none + UNSET rel:rundir DRIVER_attributes @@ -193,7 +193,7 @@ Driver restart pointer file to initialize time info - none + UNSET $DRV_RESTART_POINTER $DRV_RESTART_POINTER From cdb016cf7bf9bd087a03a22ba29c4d20afc42163 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 30 Nov 2025 15:06:55 -0700 Subject: [PATCH 6/9] Add back debug_inparm as it is required --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 9d9663ed1..9a9a1620a 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -318,7 +318,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): # Write namelist file drv_in and initial input dataset list. # -------------------------------- namelist_file = os.path.join(confdir, "drv_in") - drv_namelist_groups = ["DRIVER_attributes", "MED_attributes", "ALLCOMP_attributes", "ROF_attributes", "WAV_attributes"] + drv_namelist_groups = ["debug_inparm", "DRIVER_attributes", "MED_attributes", "ALLCOMP_attributes", "ROF_attributes", "WAV_attributes"] nmlgen.write_output_file( namelist_file, data_list_path=data_list_path, groups=drv_namelist_groups ) From c5bbd1fb2a9cd60bd5bb09bed41ca5228e6ca646 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 30 Nov 2025 15:33:27 -0700 Subject: [PATCH 7/9] Add back perf_inparm and papi_inparm which can be optionally added, but are external to CMEPS and can be called from either CIME or ESMF --- cime_config/buildnml | 2 ++ cime_config/namelist_definition_drv.xml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/cime_config/buildnml b/cime_config/buildnml index 9a9a1620a..c21185ae9 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -319,6 +319,8 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): # -------------------------------- namelist_file = os.path.join(confdir, "drv_in") drv_namelist_groups = ["debug_inparm", "DRIVER_attributes", "MED_attributes", "ALLCOMP_attributes", "ROF_attributes", "WAV_attributes"] + # Add optional namelista that the GPTL library can read (from CIME or ESMF) + drv_namelist_groups.extend( ["prof_inparm", "papi_inparm"] ) nmlgen.write_output_file( namelist_file, data_list_path=data_list_path, groups=drv_namelist_groups ) diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index b900e0952..4d409fa82 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -3419,6 +3419,8 @@ + + @@ -3553,6 +3555,8 @@ + + From 756065fa037393864876ad3dc1ba4180372034e5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 30 Nov 2025 15:54:03 -0700 Subject: [PATCH 8/9] Remove ROF_attributes and WAV_attributes from the list of groups on the config file, but add in CLOCK_attributes and PELAYOUT_attributes as they are read in Fortran code --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index c21185ae9..67f50c2fc 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -318,7 +318,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): # Write namelist file drv_in and initial input dataset list. # -------------------------------- namelist_file = os.path.join(confdir, "drv_in") - drv_namelist_groups = ["debug_inparm", "DRIVER_attributes", "MED_attributes", "ALLCOMP_attributes", "ROF_attributes", "WAV_attributes"] + drv_namelist_groups = ["debug_inparm", "DRIVER_attributes", "MED_attributes", "ALLCOMP_attributes", "CLOCK_attributes", "PELAYOUT_attributes"] # Add optional namelista that the GPTL library can read (from CIME or ESMF) drv_namelist_groups.extend( ["prof_inparm", "papi_inparm"] ) nmlgen.write_output_file( From 3497948aec564770a7acdec175c5524f50d49677 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 2 Dec 2025 16:36:50 -0700 Subject: [PATCH 9/9] OK this was wrong as well, as most of these are in the config file and NOT in the namelist file, debug_inparm needs to be first because it's read first, the prof_inparm and papi_inparm are searched for first so order doesn't matter --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 67f50c2fc..ab2926333 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -318,7 +318,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): # Write namelist file drv_in and initial input dataset list. # -------------------------------- namelist_file = os.path.join(confdir, "drv_in") - drv_namelist_groups = ["debug_inparm", "DRIVER_attributes", "MED_attributes", "ALLCOMP_attributes", "CLOCK_attributes", "PELAYOUT_attributes"] + drv_namelist_groups = ["debug_inparm"] # Add optional namelista that the GPTL library can read (from CIME or ESMF) drv_namelist_groups.extend( ["prof_inparm", "papi_inparm"] ) nmlgen.write_output_file(