diff --git a/conf/real-from-d2-ana/simulation.yml b/conf/real-from-d2-ana/simulation.yml index 5de3e4841b702b2cf99202afb1faa247f85cd86b..e90817fe5dc7f859c15e1719222e8d9245e81f63 100644 --- a/conf/real-from-d2-ana/simulation.yml +++ b/conf/real-from-d2-ana/simulation.yml @@ -4,6 +4,7 @@ simulation: external_parameters_filename: icon_extpar_0047_R19B07_L_20220601_tiles.nc lateral_boundary_grid_filename: icon_grid_0047_R19B07_L_lbc.nc parent_grid_filename: icon_grid_0028_R02B07_N02.nc + lbc_hhl_filepath: "%HPCROOTDIR%/proj/templates/real-from-d2-ana/HHL.grib" date_format: '%Y-%m-%dT%H:%M:%SZ' namelist_paths: diff --git a/namelists/real-from-d2-ana/icon_atmosphere.namelist b/namelists/real-from-d2-ana/icon_atmosphere.namelist index 894efcd8ab359389421c8b284368f4c969f204e8..1ee7542c2b9fd00df981b2cecf5321ed39227529 100644 --- a/namelists/real-from-d2-ana/icon_atmosphere.namelist +++ b/namelists/real-from-d2-ana/icon_atmosphere.namelist @@ -34,12 +34,12 @@ inwp_psp = 1 ! PSP scheme 0(turn off) 1(turn one) 2(turn on with non-D wind pert) psp_scale = 5.0 ! scaling factor for stochastic perturbations scheme psp_rnd_seed = 31 - psp_apply_ddt_core = .False. ! True if vertical wind perturbations should be applied at the explicit dynamical core timestep + psp_apply_ddt_core = .false. ! True if vertical wind perturbations should be applied at the explicit dynamical core timestep inwp_gscp = 4 ! 1: default, 2: graupel scheme for convection-permitting scales - ccn_type_gscp4 = 8 ! CB new namelist parameter: - ccn_type_gscp5 = 8 ! CB new namelist parameter: + !ccn_type_gscp4 = 8 ! CB new namelist parameter: + !ccn_type_gscp5 = 8 ! CB new namelist parameter: !6: 100 maritime, 7: 500 intermediate, 8: 1700 continental, 9: 3200 polluted continental - cloudnue_value = 0 ! CB new namelist parameter for shape parameter (nu) of CDSD: + !cloudnue_value = 0 ! CB new namelist parameter for shape parameter (nu) of CDSD: ! -> cloud_cosmo5 (mu=1/3): 0 (REF), 1, 2, 4, 8 ! -> cloud_nue1mue1 (mu=1): 1 (REF), 2, 4, 8 mu_rain = 0.5 ! new tuning becoming operational in July 2018 diff --git a/templates/real-from-d2-ana/HHL.grib b/templates/real-from-d2-ana/HHL.grib new file mode 100644 index 0000000000000000000000000000000000000000..0325a918ed4cb48d41442cd353675bfd4329f131 Binary files /dev/null and b/templates/real-from-d2-ana/HHL.grib differ diff --git a/templates/real-from-d2-ana/icon-remap-helper.py b/templates/real-from-d2-ana/icon-remap-helper.py index 785deb2dd38f74a4634505fad3add8effbcbbd23..269e6d325e02981c48415a67bd0afc23dc34b616 100644 --- a/templates/real-from-d2-ana/icon-remap-helper.py +++ b/templates/real-from-d2-ana/icon-remap-helper.py @@ -186,7 +186,7 @@ def remap_one_file(in_grid, out_grid, one_file, dst_fodler, rename=None, src_vgr ext = ".grb" elif args.output_format == "nc": ext = ".nc" - if ext in ["grib", "grb", "grib2", "grb2"]: + if ext in [",grib", ",grb", ",grib2", ",grb2"]: out_filetype = 2 else: out_filetype = 4 diff --git a/templates/real-from-d2-ana/prepare_date_remote.sh b/templates/real-from-d2-ana/prepare_date_remote.sh index b1910df4c2dc044e00abb2c8b30fa2c9f6c82a36..2ac773500c7c42b857137332f867a39356387493 100644 --- a/templates/real-from-d2-ana/prepare_date_remote.sh +++ b/templates/real-from-d2-ana/prepare_date_remote.sh @@ -11,7 +11,16 @@ if [ "${IC_DATA_IS_LOCAL}" != "True" ]; then STARTDATE=%SDATE% HPCUSER=%HPCUSER% HPCHOST=%HPCHOST% - + + . ${WORKDIR}/proj/platforms/common/spack_utils.sh + load_spack "%spack.init%" "%spack.root%" "%spack.url%" "%spack.branch%" "%spack.externals%" "%spack.compiler%" "%spack.disable_local_config%" "%spack.user_cache_path%" "%spack.user_config_path%" "%spack.upstreams%" + + # Load icon module + spack load --first dwd-icon-tools + + # Set environment variable for eccodes-dwd definitions: + source ${WORKDIR}/eccodes_defs.env + # Define date directory, create it and go there COMMON_DATE_FOLDER=${WORKDIR}/${STARTDATE}/inidata @@ -61,6 +70,8 @@ if [ "${IC_DATA_IS_LOCAL}" != "True" ]; then awk '{print $1}' an_inc_file.txt | xargs -I[] ln -sf [] . awk '{print $1}' fg_file.txt | xargs -I[] ln -sf [] . + grib_set -s stepRange=0,dataTime=0,dataDate=${STARTDATE:0:8} "%simulation.lbc_hhl_filepath%" ${COMMON_DATE_FOLDER}/HHL.grib + # Change permissions to read only. #chmod 440 ./* fi \ No newline at end of file diff --git a/templates/real-from-d2-ana/prepare_lbc_remote.sh b/templates/real-from-d2-ana/prepare_lbc_remote.sh index f172ed30c28849bcd799bdc783cc7e32f445ea7d..3978035679374e1be331b1d7f9925086b7605168 100644 --- a/templates/real-from-d2-ana/prepare_lbc_remote.sh +++ b/templates/real-from-d2-ana/prepare_lbc_remote.sh @@ -80,16 +80,20 @@ if [ "${LBC_DATA_IS_LOCAL}" != "True" ]; then ${WORKDIR}/%python_environment.folder_name%/bin/python3 ${WORKDIR}/proj/templates/real-from-d2-ana/icon-remap-helper.py \ --src-grid ${COMMON_GRID_FOLDER}/${PARENT_GRID_FILE} \ --dst-grid ${COMMON_GRID_FOLDER}/${BOUNDARY_GRID_FILE} \ - --source work/iefff${EU_FC_TIME}0000.${MEMBER,} \ + --source work/iefff${EU_FC_TIME}0000.${MEMBER^} \ --dest work/${MEMBER} \ --output-format grb # rename to the comfortable style for ICON - mv work/${MEMBER}/iefff${EU_FC_TIME}0000.grb ${MEMBER_DIR}/latbc_${D2_FC_TIME}.${MEMBER,}.grib + mv work/${MEMBER}/iefff${EU_FC_TIME}0000.grb ${MEMBER_DIR}/latbc_${D2_FC_TIME}.${MEMBER^}.grib done + # add HHL + #grib_set -s stepRange=0,dataTime=2100,dataDate=${STARTDATE:0:8} ${COMMON_GRID_FOLDER}/HHL.grib + cat ${COMMON_DATE_FOLDER}/HHL.grib >> ${MEMBER_DIR}/latbc_00000.${MEMBER^}.grib + # clean up the working directory rm -r work/${MEMBER} diff --git a/templates/real-from-d2-ana/prepare_member.sh b/templates/real-from-d2-ana/prepare_member.sh index c6a57dfd3f76071ce0970a5bb89899e61cbd48bd..7250a08ef12dc8fcd3db976058321604b9b9eb9c 100644 --- a/templates/real-from-d2-ana/prepare_member.sh +++ b/templates/real-from-d2-ana/prepare_member.sh @@ -5,6 +5,7 @@ WORKDIR=%HPCROOTDIR% STARTDATE=%SDATE% MEMBER=%MEMBER% + # Common folder with data needed for all simulations COMMON_INIDATA_FOLDER=${WORKDIR}/inidata # Common folder for the same start date diff --git a/templates/real-from-d2-ana/prepare_namelist.py b/templates/real-from-d2-ana/prepare_namelist.py index f59f115878cdd2a3866ad71bab1a9c8610c42dd6..3ea9988e56e22b6d086b6a377cffa66f16e9d70a 100644 --- a/templates/real-from-d2-ana/prepare_namelist.py +++ b/templates/real-from-d2-ana/prepare_namelist.py @@ -36,13 +36,13 @@ Chunk_END_DATE = datetime(year=int(END_YEAR), month=int(END_MONTH), day=int(END_ # Read first-guess and analysis filenames from files: first_guess_filename = ( - RUNDIR / f"fc_R19B07.{(Chunk_START_DATE-timedelta(minutes=5)).strftime('%Y%m%d%H%M')}00_an.{MEMBER[1:]}" + RUNDIR / f"fc_R19B07.{(Chunk_START_DATE-timedelta(minutes=5)).strftime('%Y%m%d%H%M')}00.{MEMBER[1:]}" ) analysis_filename = RUNDIR / f"an_R19B07.{Chunk_START_DATE.strftime('%Y%m%d%H%M')}00_an.{MEMBER[1:]}" analysis_inc_filename = RUNDIR / f"an_R19B07.{Chunk_START_DATE.strftime('%Y%m%d%H%M')}00_inc.{MEMBER[1:]}" -boundary_filename = RUNDIR / f"latbc_<dddhh>.{MEMBER}.grib" +boundary_filename = f"latbc_<dddhh>.m{MEMBER[1:]}.grib" # Read custom namelist parameters from configuration atmosphere_namelist_string = """ @@ -75,17 +75,18 @@ atmosphere_namelist_replacements = { "dwdana_filename": str(analysis_inc_filename), }, "limarea_nml": { + "latbc_path" : str(RUNDIR), "latbc_filename": str(boundary_filename), "latbc_boundary_grid": "%simulation.lateral_boundary_grid_filename%", }, "nwp_phy_nml": { "psp_rnd_seed": int(MEMBER[1:]), - "psp_apply_ddt_core": '.False.', # True if vertical wind perturbations should be applied at the explicit dynamical core timestep + #"psp_apply_ddt_core": ".false.", # True if vertical wind perturbations should be applied at the explicit dynamical core timestep "inwp_gscp": 4 , # 1: default, 2: graupel scheme for convection-permitting scales - "ccn_type_gscp4": 8, # CB new namelist parameter: - "ccn_type_gscp5": 8, # CB new namelist parameter: + #"ccn_type_gscp4": 8, # CB new namelist parameter: + #"ccn_type_gscp5": 8, # CB new namelist parameter: # 6: 100 maritime, 7: 500 intermediate, 8: 1700 continental, 9: 3200 polluted continental - "cloudnue_value": 0, # CB new namelist parameter for shape parameter (nu) of CDSD: + #"cloudnue_value": 0, # CB new namelist parameter for shape parameter (nu) of CDSD: # -> cloud_cosmo5 (mu=1/3): 0 (REF), 1, 2, 4, 8 # -> cloud_nue1mue1 (mu=1): 1 (REF), 2, 4, 8 },