From e5ff0720cf9426f7710b6ec82eae817ab18d99f7 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 11 Apr 2024 16:32:00 -0400 Subject: [PATCH] merge in changes from #428 from @hertneky --- scm/src/run_scm.py | 8 ++++---- scm/src/scm_input.F90 | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scm/src/run_scm.py b/scm/src/run_scm.py index 20cfbce6a..926fb68ba 100755 --- a/scm/src/run_scm.py +++ b/scm/src/run_scm.py @@ -488,12 +488,12 @@ def setup_rundir(self): try: input_type = case_nml['case_config']['input_type'] if input_type == 1: + surface_flux_spec = False #open the case data file and read the surfaceForcing global attribute - case_data_dir = case_nml['case_config']['case_data_dir'] - nc_fid = Dataset(os.path.join(SCM_ROOT, case_data_dir) + '/' + self._case + '_SCM_driver.nc' , 'r') - surfaceForcing = nc_fid.getncattr('surfaceForcing') + nc_fid = Dataset(os.path.join(SCM_ROOT, self._case_data_dir) + '/' + self._case + '_SCM_driver.nc' , 'r') + surfaceForcing = nc_fid.getncattr('surface_forcing_temp') nc_fid.close() - if (surfaceForcing.lower() == 'flux' or surfaceForcing.lower() == 'surfaceflux'): + if (surfaceForcing.lower() == 'flux' or surfaceForcing.lower() == 'surface_flux'): surface_flux_spec = True except KeyError: # if not using DEPHY format, check to see if surface fluxes are specified in the case configuration file (default is False) diff --git a/scm/src/scm_input.F90 b/scm/src/scm_input.F90 index 3269c16ac..cc3effcd5 100644 --- a/scm/src/scm_input.F90 +++ b/scm/src/scm_input.F90 @@ -950,7 +950,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) real(kind=sp) :: z_nudging_temp, z_nudging_theta, z_nudging_thetal, z_nudging_qv, z_nudging_qt, z_nudging_rv, z_nudging_rt, z_nudging_u, z_nudging_v real(kind=sp) :: p_nudging_temp, p_nudging_theta, p_nudging_thetal, p_nudging_qv, p_nudging_qt, p_nudging_rv, p_nudging_rt, p_nudging_u, p_nudging_v character(len=5) :: input_surfaceType - character(len=11) :: input_surfaceForcingWind='',input_surfaceForcingMoist='',input_surfaceForcingLSM='',input_surfaceForcingTemp='' + character(len=12) :: input_surfaceForcingWind='',input_surfaceForcingMoist='',input_surfaceForcingLSM='',input_surfaceForcingTemp='' ! initial variables (IC = Initial Condition) real(kind=dp), allocatable :: input_lat(:) !< column latitude (deg) @@ -1630,7 +1630,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) call NetCDF_read_var(ncid, "wprvp_s", .False., input_force_wprvp) call NetCDF_read_var(ncid, "wprtp_s", .False., input_force_wprtp) else if (trim(input_surfaceForcingMoist) == 'surface_flux') then - call NetCDF_read_var(ncid, "hfls", .False., input_force_sfc_sens_flx) + call NetCDF_read_var(ncid, "hfls", .False., input_force_sfc_lat_flx) endif ! @@ -1969,7 +1969,6 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) if (trim(input_surfaceForcingLSM) == "lsm") then scm_input%input_ozone = input_ozone(:,active_init_time) scm_input%input_area = input_area(active_init_time) - scm_state%area = input_area(active_init_time) scm_input%input_stddev = input_stddev(active_init_time) scm_input%input_convexity= input_convexity(active_init_time)