예제 #1
0
 def _case_two_setup(self):
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component="clm",
         contents=
         "glacier_region_behavior = 'single_at_atm_topo', 'virtual', 'virtual', 'virtual'"
     )
예제 #2
0
    def test_append_multiple_files(self):
        # Simulates a multi-instance test
        component = 'foo'
        orig_contents1 = 'bar = 42'
        orig_contents2 = 'bar = 17'
        contents_to_append = 'baz = 101'

        # Setup
        filename1 = self.write_user_nl_file(component,
                                            orig_contents1,
                                            suffix='_0001')
        filename2 = self.write_user_nl_file(component,
                                            orig_contents2,
                                            suffix='_0002')

        # Exercise
        user_nl_utils.append_to_user_nl_files(caseroot=self._caseroot,
                                              component=component,
                                              contents=contents_to_append)

        # Verify
        expected_contents1 = orig_contents1 + '\n' + contents_to_append + '\n'
        expected_contents2 = orig_contents2 + '\n' + contents_to_append + '\n'
        self.assertFileContentsEqual(expected_contents1,
                                     os.path.join(self._caseroot, filename1))
        self.assertFileContentsEqual(expected_contents2,
                                     os.path.join(self._caseroot, filename2))
예제 #3
0
파일: lciso.py 프로젝트: zhyun1123/CTSM
 def _case_two_setup(self):
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component=self.comp,
         contents=
         "use_c13=.true.,use_c14=.true.,use_c13_timeseries=.true.,use_c14_bombspike=.true."
     )
예제 #4
0
 def _case_one_setup(self):
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component="clm",
         contents=
         "soil_layerstruct_userdefined_nlevsoi = 4,soil_layerstruct_userdefined = 0.1d0,0.3d0,0.6d0,1.0d0,1.0d0"
     )
예제 #5
0
    def test_append_multiple_files(self):
        # Simulates a multi-instance test
        component = "foo"
        orig_contents1 = "bar = 42"
        orig_contents2 = "bar = 17"
        contents_to_append = "baz = 101"

        # Setup
        filename1 = self.write_user_nl_file(component,
                                            orig_contents1,
                                            suffix="_0001")
        filename2 = self.write_user_nl_file(component,
                                            orig_contents2,
                                            suffix="_0002")

        # Exercise
        user_nl_utils.append_to_user_nl_files(caseroot=self._caseroot,
                                              component=component,
                                              contents=contents_to_append)

        # Verify
        expected_contents1 = orig_contents1 + "\n" + contents_to_append + "\n"
        expected_contents2 = orig_contents2 + "\n" + contents_to_append + "\n"
        self.assertFileContentsEqual(expected_contents1,
                                     os.path.join(self._caseroot, filename1))
        self.assertFileContentsEqual(expected_contents2,
                                     os.path.join(self._caseroot, filename2))
예제 #6
0
 def _common_setup(self):
     nl_contents_common = '''
         ! DIMCS test changes
     '''
     append_to_user_nl_files(caseroot=self._case.get_value("CASEROOT"),
                             component=self.comp,
                             contents=nl_contents_common)
예제 #7
0
 def _case_two_setup(self):
     append_to_user_nl_files(caseroot = self._get_caseroot(),
                             component = "clm",
                             contents = "use_c13=.true.,use_c14=.true.,use_c13_timeseries=.true.,use_c14_bombspike=.true.," + \
                             "hist_fexcl1='C13_AR','C13_GPP','C13_HR','C13_NBP','C13_SOILC_vr','C13_TOTECOSYSC'," + \
                             "'C13_TOTLITC','C13_TOTSOMC','C13_TOTVEGC','C14_AR','C14_GPP','C14_HR','C14_NBP'," + \
                             "'C14_SOILC_vr','C14_TOTECOSYSC','C14_TOTLITC','C14_TOTSOMC','C14_TOTVEGC'")
예제 #8
0
 def _case_one_setup(self):
     # Turn off history output for the given ice sheet in the multi-ice sheet case:
     # otherwise, the comparison between the cases will fail due to a history file
     # being present in one case but not the other.
     append_to_user_nl_files(caseroot = self._get_caseroot(),
                             component = "cism_{}".format(self._remove_icesheet_grid_name),
                             # setting history_frequency to 10000 years should be effectively the same as 'never'
                             contents = "history_frequency = 10000")
예제 #9
0
파일: lwiso.py 프로젝트: IMMM-SFA/im3-clm
 def _case_one_setup(self):
     # BUG(wjs, 2019-07-30, ESCOMP/ctsm#495) We currently can't turn on actual water
     # isotopes in a multi-timestep test, so we're setting
     # enable_water_tracer_consistency_checks rather than enable_water_isotopes;
     # eventually, though, we should change this to the latter. (See
     # <https://github.com/ESCOMP/ctsm/issues/495#issuecomment-516619853>.)
     append_to_user_nl_files(caseroot = self._get_caseroot(),
                             component = "clm",
                             contents = "enable_water_tracer_consistency_checks=.true.")
예제 #10
0
 def _case_two_setup(self):
     # This is needed in the nearly-standard case to prevent grain from being used to
     # replenish crop seed deficits, thus making grain act like the reproductive
     # structure pools. (It wouldn't hurt to do this in case one as well, but it
     # shouldn't be needed there, since we shouldn't have any grain there anyway.)
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component="clm",
         contents="for_testing_no_crop_seed_replenishment=.true.")
예제 #11
0
 def _case_one_setup(self):
     # We don't really need a second grain pool for this test, but we might as well do
     # this to further exercise the looping over different reproductive components.
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component="clm",
         contents="for_testing_use_second_grain_pool=.true.")
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component="clm",
         contents="for_testing_use_repr_structure_pool=.true.")
예제 #12
0
    def test_append(self):
        # Define some variables
        component = 'foo'
        # deliberately exclude new line from file contents, to make sure that's
        # handled correctly
        orig_contents = 'bar = 42'
        contents_to_append = 'baz = 101'

        # Setup
        filename = self.write_user_nl_file(component, orig_contents)

        # Exercise
        user_nl_utils.append_to_user_nl_files(caseroot=self._caseroot,
                                              component=component,
                                              contents=contents_to_append)

        # Verify
        expected_contents = orig_contents + '\n' + contents_to_append + '\n'
        self.assertFileContentsEqual(expected_contents,
                                     os.path.join(self._caseroot, filename))
예제 #13
0
    def test_append(self):
        # Define some variables
        component = 'foo'
        # deliberately exclude new line from file contents, to make sure that's
        # handled correctly
        orig_contents = 'bar = 42'
        contents_to_append = 'baz = 101'

        # Setup
        filename = self.write_user_nl_file(component, orig_contents)

        # Exercise
        user_nl_utils.append_to_user_nl_files(caseroot = self._caseroot,
                                              component = component,
                                              contents = contents_to_append)

        # Verify
        expected_contents = orig_contents + '\n' + contents_to_append + '\n'
        self.assertFileContentsEqual(expected_contents,
                                     os.path.join(self._caseroot, filename))
예제 #14
0
    def test_append_multiple_files(self):
        # Simulates a multi-instance test
        component = 'foo'
        orig_contents1 = 'bar = 42'
        orig_contents2 = 'bar = 17'
        contents_to_append = 'baz = 101'

        # Setup
        filename1 = self.write_user_nl_file(component, orig_contents1, suffix='_0001')
        filename2 = self.write_user_nl_file(component, orig_contents2, suffix='_0002')

        # Exercise
        user_nl_utils.append_to_user_nl_files(caseroot = self._caseroot,
                                              component = component,
                                              contents = contents_to_append)

        # Verify
        expected_contents1 = orig_contents1 + '\n' + contents_to_append + '\n'
        expected_contents2 = orig_contents2 + '\n' + contents_to_append + '\n'
        self.assertFileContentsEqual(expected_contents1,
                                     os.path.join(self._caseroot, filename1))
        self.assertFileContentsEqual(expected_contents2,
                                     os.path.join(self._caseroot, filename2))
예제 #15
0
 def _case_one_setup(self):
     super(LII2FINIDATAREAS, self)._case_one_setup()
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component="clm",
         contents="init_interp_method = 'use_finidat_areas'")
예제 #16
0
파일: lii.py 프로젝트: Toeroeoe/CTSM
 def _case_two_setup(self):
     append_to_user_nl_files(caseroot=self._get_caseroot(),
                             component="clm",
                             contents="use_init_interp = .false.")
예제 #17
0
파일: lwiso.py 프로젝트: IMMM-SFA/im3-clm
 def _case_two_setup(self):
     append_to_user_nl_files(caseroot = self._get_caseroot(),
                             component = "clm",
                             contents = "enable_water_tracer_consistency_checks=.false.")
예제 #18
0
    def _case_setup(self, i):

        # Second append user_nl change sepecific to case-i
        append_to_user_nl_files(caseroot=self._case.get_value("CASEROOT"),
                                component=self.comp,
                                contents=nl_contents[i])
예제 #19
0
 def _case_two_setup(self):
     append_to_user_nl_files(caseroot = self._get_caseroot(),
                             component = "clm",
                             contents = "use_init_interp = .true.")
예제 #20
0
 def _case_two_setup(self):
     append_to_user_nl_files(
         caseroot=self._get_caseroot(),
         component="clm",
         contents="soil_layerstruct_predefined = '4SL_2m'")
예제 #21
0
 def _common_setup(self):
     # Turn off history for CLM: We expect answer changes for CLM in the part of the
     # world where we turn off one of the ice sheets in the single-ice sheet case.
     append_to_user_nl_files(caseroot = self._get_caseroot(),
                             component = "clm",
                             contents = "hist_empty_htapes = .true.")
예제 #22
0
 def _case_two_setup(self):
     append_to_user_nl_files(caseroot = self._get_caseroot(),
                             component = "clm",
                             contents = "for_testing_use_second_grain_pool=.false.")
예제 #23
0
 def _case_one_setup(self):
     append_to_user_nl_files(caseroot=self._get_caseroot(),
                             component="clm",
                             contents="use_c13=F, use_c14=F")