From 8c6b1ac43942a9786f9a69ef9e97a1f4b944ad38 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 1 Feb 2021 09:33:21 -0700 Subject: [PATCH 1/4] replace datm_clmncep_yr and datm_cplhist_yr with datm_yr --- datm/cime_config/buildnml | 4 +- datm/cime_config/config_component.xml | 75 ++++------ datm/cime_config/namelist_definition_datm.xml | 12 +- datm/cime_config/stream_definition_datm.xml | 132 +++++++++--------- dice/cime_config/namelist_definition_dice.xml | 8 +- doc/source/streams.rst | 14 +- docn/cime_config/namelist_definition_docn.xml | 8 +- 7 files changed, 113 insertions(+), 140 deletions(-) diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index ebfde5be8..fb0050f84 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -74,8 +74,8 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config['datm_co2_tseries'] = datm_co2_tseries config['datm_presaero'] = datm_presaero config['cime_model'] = get_model() - config['scol_mode'] = 'true' if case.get_value('PTS_MODE') else 'false' - config['create_mesh'] = 'true' if case.get_value("ATM_DOMAIN_MESH") == 'create_mesh' else 'false' + config['mode'] = 'scol' if case.get_value('PTS_MODE') else 'false' + config['mode'] = 'create_mesh' if case.get_value("ATM_DOMAIN_MESH") == 'create_mesh' nmlgen.init_defaults(infile, config) diff --git a/datm/cime_config/config_component.xml b/datm/cime_config/config_component.xml index 59f5aef4b..d5639c3fb 100644 --- a/datm/cime_config/config_component.xml +++ b/datm/cime_config/config_component.xml @@ -159,46 +159,7 @@ case name used to determine stream filenames when DATM_MODE is CPLHIST - - integer - - -999 - run_component_datm - env_run.xml - - Simulation year corresponding to DATM_CPLHIST_YR_START (only used - when DATM_MODE is CPLHIST). A common usage is to set this to - RUN_STARTDATE. With this setting, the forcing in the first year of - the run will be the forcing of year DATM_CPLHIST_YR_START. Another - use case is to align the calendar of transient forcing with the - model calendar. For example, setting - DATM_CPLHIST_YR_ALIGN=DATM_CPLHIST_YR_START will lead to the - forcing calendar being the same as the model calendar. The forcing - for a given model year would be the forcing of the same year. This - would be appropriate in transient runs where the model calendar is - setup to span the same year range as the forcing data. - - - - - integer - - -999 - run_component_datm - env_run.xml - starting year to loop data over (only used when DATM_MODE is CPLHIST) - - - - integer - - -999 - run_component_datm - env_run.xml - ending year to loop data over (only used when DATM_MODE is CPLHIST) - - - + integer 1 @@ -209,26 +170,38 @@ 1895 1901 1901 - $DATM_CLMNCEP_YR_START + $DATM_YR_START 1895 1901 1901 - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_START + $DATM_YR_START + $DATM_YR_START + $DATM_YR_START 1 1 - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_START + $DATM_YR_START + $DATM_YR_START + $DATM_YR_START + $DATM_YR_START run_component_datm env_run.xml - year align + + Simulation year corresponding to DATM_YR_START. A common usage + is to set this to RUN_STARTDATE. With this setting, the forcing + in the first year of the run will be the forcing of year + DATM_YR_START. Another use case is to align the calendar + of transient forcing with the model calendar. For example, + setting DATM_YR_ALIGN=DATM_YR_START will lead to + the forcing calendar being the same as the model calendar. The + forcing for a given model year would be the forcing of the same + year. This would be appropriate in transient runs where the + model calendar is setup to span the same year range as the + forcing data. + - + integer 2004 @@ -270,7 +243,7 @@ starting year to loop data over - + integer 2004 diff --git a/datm/cime_config/namelist_definition_datm.xml b/datm/cime_config/namelist_definition_datm.xml index a8c420889..eaaf9290d 100644 --- a/datm/cime_config/namelist_definition_datm.xml +++ b/datm/cime_config/namelist_definition_datm.xml @@ -133,8 +133,8 @@ $ATM_DOMAIN_MESH - null - null + null + null @@ -148,8 +148,8 @@ $ATM_DOMAIN_MESH - $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE - $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE + $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE + $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE @@ -163,8 +163,8 @@ null - $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE - $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE + $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE + $ATM_DOMAIN_PATH/$ATM_DOMAIN_FILE diff --git a/datm/cime_config/stream_definition_datm.xml b/datm/cime_config/stream_definition_datm.xml index d7a957bc3..24af2bacd 100644 --- a/datm/cime_config/stream_definition_datm.xml +++ b/datm/cime_config/stream_definition_datm.xml @@ -214,9 +214,9 @@ nn null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 coszen @@ -246,9 +246,9 @@ nn null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 nearest @@ -282,9 +282,9 @@ nn null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 linear @@ -317,9 +317,9 @@ bilinear null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 coszen @@ -348,9 +348,9 @@ bilinear null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 nearest @@ -383,9 +383,9 @@ nn null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 linear @@ -419,9 +419,9 @@ nn null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 coszen @@ -451,9 +451,9 @@ nn null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 nearest @@ -486,9 +486,9 @@ nn null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 linear @@ -522,7 +522,7 @@ nn null - $DATM_CLMNCEP_YR_ALIGN + $DATM_YR_ALIGN 2000 2004 0 @@ -554,7 +554,7 @@ nn null - $DATM_CLMNCEP_YR_ALIGN + $DATM_YR_ALIGN 2000 2004 0 @@ -589,7 +589,7 @@ nn null - $DATM_CLMNCEP_YR_ALIGN + $DATM_YR_ALIGN 2000 2004 0 @@ -624,9 +624,9 @@ redist null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 coszen @@ -655,9 +655,9 @@ redist null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 nearest @@ -690,9 +690,9 @@ redist null - $DATM_CLMNCEP_YR_ALIGN - $DATM_CLMNCEP_YR_START - $DATM_CLMNCEP_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 linear @@ -734,7 +734,7 @@ none null - $DATM_CLMNCEP_YR_ALIGN + $DATM_YR_ALIGN 1993 1993 0 @@ -774,7 +774,7 @@ none null - $DATM_CLMNCEP_YR_ALIGN + $DATM_YR_ALIGN 1992 1992 0 @@ -829,7 +829,7 @@ none null - $DATM_CLMNCEP_YR_ALIGN + $DATM_YR_ALIGN 0001 0002 0 @@ -3427,7 +3427,7 @@ $ATM_DOMAIN_MESH - $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x3h.%ym.nc + $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x3h.%ym.nc a2x3h_Sa_topo Sa_topo @@ -3438,9 +3438,9 @@ nn null - $DATM_CPLHIST_YR_ALIGN - $DATM_CPLHIST_YR_START - $DATM_CPLHIST_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 nearest @@ -3458,7 +3458,7 @@ $ATM_DOMAIN_MESH - $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x1d.%ym.nc + $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x1d.%ym.nc a2x1d_Faxa_bcphiwet Faxa_bcphiwet @@ -3482,9 +3482,9 @@ nn null - $DATM_CPLHIST_YR_ALIGN - $DATM_CPLHIST_YR_START - $DATM_CPLHIST_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 0 nearest @@ -3503,7 +3503,7 @@ $ATM_DOMAIN_MESH - $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x1hi.%ym.nc + $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x1hi.%ym.nc a2x1hi_Faxa_swndr Faxa_swndr @@ -3517,9 +3517,9 @@ nn null - $DATM_CPLHIST_YR_ALIGN - $DATM_CPLHIST_YR_START - $DATM_CPLHIST_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 2700 nearest @@ -3538,7 +3538,7 @@ $ATM_DOMAIN_MESH - $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x3h.%ym.nc + $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x3h.%ym.nc a2x3h_Faxa_rainc Faxa_rainc @@ -3553,9 +3553,9 @@ nn null - $DATM_CPLHIST_YR_ALIGN - $DATM_CPLHIST_YR_START - $DATM_CPLHIST_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 900 nearest @@ -3574,7 +3574,7 @@ $ATM_DOMAIN_MESH - $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x3h.%ym.nc + $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x3h.%ym.nc a2x3h_Sa_z Sa_z @@ -3593,9 +3593,9 @@ nn null - $DATM_CPLHIST_YR_ALIGN - $DATM_CPLHIST_YR_START - $DATM_CPLHIST_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 900 linear @@ -3614,7 +3614,7 @@ $ATM_DOMAIN_MESH - $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x1h.%ym.nc + $DATM_CPLHIST_DIR/$DATM_CPLHIST_CASE.cpl.ha2x1h.%ym.nc a2x1h_Sa_u Sa_u @@ -3626,9 +3626,9 @@ nn null - $DATM_CPLHIST_YR_ALIGN - $DATM_CPLHIST_YR_START - $DATM_CPLHIST_YR_END + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END 900 linear diff --git a/dice/cime_config/namelist_definition_dice.xml b/dice/cime_config/namelist_definition_dice.xml index fccb8d4e4..7f375bfc1 100644 --- a/dice/cime_config/namelist_definition_dice.xml +++ b/dice/cime_config/namelist_definition_dice.xml @@ -54,8 +54,8 @@ file specifying model mesh $ICE_DOMAIN_MESH - null - null + null + null @@ -80,8 +80,8 @@ file specifying if model mesh is to be created at runtime null - $ICE_DOMAIN_PATH/$ICE_DOMAIN_FILE - $ICE_DOMAIN_PATH/$ICE_DOMAIN_FILE + $ICE_DOMAIN_PATH/$ICE_DOMAIN_FILE + $ICE_DOMAIN_PATH/$ICE_DOMAIN_FILE diff --git a/doc/source/streams.rst b/doc/source/streams.rst index c2f7d9073..743f31b65 100644 --- a/doc/source/streams.rst +++ b/doc/source/streams.rst @@ -219,15 +219,15 @@ where: over the forcing data for 1901-1920, and then run the model for years 1901-2010 using the forcing data from 1901-2010. To do this, initially set:: - ./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 - ./xmlchange DATM_CLMNCEP_YR_START=1901 - ./xmlchange DATM_CLMNCEP_YR_END=1920 + ./xmlchange DATM_YR_ALIGN=1901 + ./xmlchange DATM_YR_START=1901 + ./xmlchange DATM_YR_END=1920 When the model has completed year 1900, set:: - ./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 - ./xmlchange DATM_CLMNCEP_YR_START=1901 - ./xmlchange DATM_CLMNCEP_YR_END=2010 + ./xmlchange DATM_YR_ALIGN=1901 + ./xmlchange DATM_YR_START=1901 + ./xmlchange DATM_YR_END=2010 With this setup, the correlation between model run year and forcing year looks like this:: @@ -235,7 +235,7 @@ where: RUN Year : 1850 ... 1860 1861 ... 1870 ... 1880 1881 ... 1890 ... 1900 1901 ... 2010 FORCE Year : 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 2010 - Setting ``DATM_CLMNCEP_YR_ALIGN`` to 1901 tells the code that you want + Setting ``DATM_YR_ALIGN`` to 1901 tells the code that you want to align model year 1901 with forcing data year 1901, and then it calculates what the forcing year should be if the model starts in year 1850. diff --git a/docn/cime_config/namelist_definition_docn.xml b/docn/cime_config/namelist_definition_docn.xml index cd7af94c0..aa5a050f5 100644 --- a/docn/cime_config/namelist_definition_docn.xml +++ b/docn/cime_config/namelist_definition_docn.xml @@ -119,8 +119,8 @@ $OCN_DOMAIN_MESH - null - null + null + null @@ -148,8 +148,8 @@ null - $OCN_DOMAIN_PATH/$OCN_DOMAIN_FILE - $OCN_DOMAIN_PATH/$OCN_DOMAIN_FILE + $OCN_DOMAIN_PATH/$OCN_DOMAIN_FILE + $OCN_DOMAIN_PATH/$OCN_DOMAIN_FILE From f36b2fea3abf1a3df09c923e1c3e17134a0ebe87 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 1 Feb 2021 10:10:01 -0700 Subject: [PATCH 2/4] namelist cleanup --- cime_config/testdefs/testlist_cdeps.xml | 14 +++++++------- datm/cime_config/buildnml | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cime_config/testdefs/testlist_cdeps.xml b/cime_config/testdefs/testlist_cdeps.xml index e49889d71..72f019c6c 100644 --- a/cime_config/testdefs/testlist_cdeps.xml +++ b/cime_config/testdefs/testlist_cdeps.xml @@ -1,7 +1,7 @@ - + @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index fb0050f84..265274521 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -74,8 +74,10 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config['datm_co2_tseries'] = datm_co2_tseries config['datm_presaero'] = datm_presaero config['cime_model'] = get_model() - config['mode'] = 'scol' if case.get_value('PTS_MODE') else 'false' - config['mode'] = 'create_mesh' if case.get_value("ATM_DOMAIN_MESH") == 'create_mesh' + if case.get_value('PTS_MODE'): + config['mode'] = 'single_column' + else: + config['mode'] = case.get_value("ATM_DOMAIN_MESH") nmlgen.init_defaults(infile, config) From b9bb0656200b27bcdb6356b51be5e1d87891c947 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 1 Feb 2021 14:41:50 -0700 Subject: [PATCH 3/4] remove scol_mode --- dice/cime_config/buildnml | 8 +++++--- dlnd/cime_config/buildnml | 5 ++--- docn/cime_config/buildnml | 1 - drof/cime_config/buildnml | 3 +-- dwav/cime_config/buildnml | 3 +-- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dice/cime_config/buildnml b/dice/cime_config/buildnml index 7b925d5b4..2250eae88 100755 --- a/dice/cime_config/buildnml +++ b/dice/cime_config/buildnml @@ -63,9 +63,11 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config = {} config['ice_grid'] = ice_grid config['dice_mode'] = dice_mode - config['scol_mode'] = 'true' if case.get_value('PTS_MODE') else 'false' - config['create_mesh'] = 'true' if case.get_value("ICE_DOMAIN_MESH") == 'create_mesh' else 'false' - scol_mode = True if case.get_value('PTS_MODE') else False + if case.get_value('PTS_MODE'): + config['mode'] = 'single_column' + else: + config['mode'] = case.get_value("ICE_DOMAIN_MESH") + config['set_model_maskfile'] = 'true' if scol_mode or (ice_nx==atm_nx and ice_ny==atm_ny) else 'false' # Initialize nmlgen diff --git a/dlnd/cime_config/buildnml b/dlnd/cime_config/buildnml index e6176e3bd..667657784 100755 --- a/dlnd/cime_config/buildnml +++ b/dlnd/cime_config/buildnml @@ -62,9 +62,8 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config['dlnd_mode'] = dlnd_mode config['create_mesh'] = 'true' if case.get_value("LND_DOMAIN_MESH") == 'create_mesh' else 'false' - # Do not allow single column mode for drof - scol_mode = True if case.get_value('PTS_MODE') else False - expect(not scol_mode, + # Do not allow single column mode for dlnd + expect(not case.get_value('PTS_MODE'), "for DLND, single column mode is not allowed") # Initialize nmlgen diff --git a/docn/cime_config/buildnml b/docn/cime_config/buildnml index e76b8d0c1..16066f7a3 100755 --- a/docn/cime_config/buildnml +++ b/docn/cime_config/buildnml @@ -69,7 +69,6 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config['docn_mode'] = docn_mode config['create_mesh'] = 'true' if case.get_value("OCN_DOMAIN_MESH") == 'create_mesh' else 'false' config['aqua_planet'] = 'true' if 'aquap' in docn_mode else 'false' - scol_mode = True if case.get_value('PTS_MODE') else False nmlgen.init_defaults(infile, config) diff --git a/drof/cime_config/buildnml b/drof/cime_config/buildnml index 316b46906..f7d567504 100755 --- a/drof/cime_config/buildnml +++ b/drof/cime_config/buildnml @@ -63,8 +63,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config['create_mesh'] = 'true' if case.get_value("ROF_DOMAIN_MESH") == 'create_mesh' else 'false' # Do not allow single column mode for drof - scol_mode = True if case.get_value('PTS_MODE') else False - expect(not scol_mode, + expect(not case.get_value('PTS_MODE'), "for, DROF single column mode is not allowed") # Initialize nmlgen diff --git a/dwav/cime_config/buildnml b/dwav/cime_config/buildnml index 88e4b19cd..5f9f508c8 100755 --- a/dwav/cime_config/buildnml +++ b/dwav/cime_config/buildnml @@ -61,8 +61,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config['dwav_mode'] = dwav_mode # do not allow single column mode for dwav - scol_mode = True if case.get_value('PTS_MODE') else False - expect(not scol_mode, + expect(not case.get_value('PTS_MODE'), "for, DWAV single column mode is not allowed") # Initialize nmlgen From b278ec19ebe5f4e92ed0e7981f50ee671f445b6a Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 2 Feb 2021 08:51:34 -0700 Subject: [PATCH 4/4] update logic for single column --- dice/cime_config/buildnml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dice/cime_config/buildnml b/dice/cime_config/buildnml index 2250eae88..aca70e45e 100755 --- a/dice/cime_config/buildnml +++ b/dice/cime_config/buildnml @@ -63,12 +63,15 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config = {} config['ice_grid'] = ice_grid config['dice_mode'] = dice_mode + config['set_model_maskfile'] = 'false' if case.get_value('PTS_MODE'): config['mode'] = 'single_column' + config['set_model_maskfile'] = 'true' else: config['mode'] = case.get_value("ICE_DOMAIN_MESH") - config['set_model_maskfile'] = 'true' if scol_mode or (ice_nx==atm_nx and ice_ny==atm_ny) else 'false' + if (ice_nx==atm_nx and ice_ny==atm_ny): + config['set_model_maskfile'] = 'true' # Initialize nmlgen nmlgen.init_defaults(infile, config)