Skip to content

Commit

Permalink
Add icon-art-oem-test (#40)
Browse files Browse the repository at this point in the history
* Add config.yaml

* Replace inidate with startdate_sim

* Fix icontools scripts

* Fix chem file names

* Set correct input file names

* Small fix for latbc grid file name

* Add prefix to chem file

* GitHub Action: Apply Pep8-formatting

* Fix for chem file

* GitHub Action: Apply Pep8-formatting

* More corrections for chem file

* GitHub Action: Apply Pep8-formatting

* Fix art namelist

* Fix art input folder

* Update on how to build icon(-art)

* Update .gitignore

* Correcting case name in comment

* Use config variables for num_procs in namelist

* Fix ICON namelists

* Remove config.py

* Only process initial file if present

* GitHub Action: Apply Pep8-formatting

* Add start of icontools runscript to logger

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
mjaehn and github-actions authored Nov 3, 2023
1 parent fe77929 commit 20a26ae
Show file tree
Hide file tree
Showing 14 changed files with 224 additions and 294 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ input/
output/
work/
src/*/
*.code-workspace
2 changes: 1 addition & 1 deletion cases/icon-art-global-test/icon_runjob.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
#SBATCH --job-name="{cfg.casename}_{cfg.inidate_yyyymmddhh}_{cfg.forecasttime}"
#SBATCH --job-name="{cfg.casename}_{cfg.startdate_sim_yyyymmddhh}_{cfg.forecasttime}"
#SBATCH --account={cfg.compute_account}
#SBATCH --time={cfg.icon_walltime}
#SBATCH --nodes={cfg.icon_np_tot}
Expand Down
153 changes: 0 additions & 153 deletions cases/icon-art-oem-test/config.py

This file was deleted.

71 changes: 71 additions & 0 deletions cases/icon-art-oem-test/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Configuration file for the 'icon-art-oem-test' case with ICON

model: icon-art-oem
constraint: gpu
run_on: cpu
compute_queue: normal
ntasks_per_node: 12
restart_step: PT6H
startdate: 2018-01-01T00:00:00Z
enddate: 2018-01-01T12:00:00Z

eccodes_dir: ./input/eccodes_definitions
iconremap_bin: iconremap
iconsub_bin: iconsub
latbc_filename: ifs_<y><m><d><h>_lbc.nc
inidata_prefix: ifs_init_
inidata_nameformat: '%Y%m%d%H'
inidata_filename_suffix: .nc
output_filename: icon-art-oem-test
filename_format: <output_filename>_DOM<physdom>_<ddhhmmss>
lateral_boundary_grid_order: lateral_boundary
art_input_folder: ./input/icon-art-oem/ART

meteo:
dir: ./input/meteo
prefix: ifs_
nameformat: '%Y%m%d%H'
suffix: .grb
inc: 3

chem:
dir: ./input/icon-art-oem/chem
prefix: cams_gqpe_
nameformat: '%Y%m%d_%H'
suffix: .grb
inc: 3

icontools_runjobs:
- icontools_remap_ic_runjob.cfg
- icontools_remap_00_lbc_runjob.cfg
- icontools_remap_lbc_rest_runjob.cfg
- icontools_remap_ic_chem_runjob.cfg
- icontools_remap_lbc_chem_runjob.cfg

input_files:
radiation_grid_filename: ./input/icon-art-oem/grid/testcase_DOM01.parent.nc
dynamics_grid_filename: ./input/icon-art-oem/grid/testcase_DOM01.nc
map_file_latbc: ./input/icon-art-oem/grid/map_file.latbc
lateral_boundary_grid: ./input/icon-art-oem/grid/lateral_boundary.grid.nc
extpar_filename: ./input/icon-art-oem/grid/external_parameter_icon_testcase_DOM01_tiles.nc
cldopt_filename: ./input/icon-art-oem/rad/rrtm_cldopt.nc
lrtm_filename: ./input/icon-art-oem/rad/rrtmg_lw.nc
map_file_ana: ./input/icon-art-oem/mapping/map_file.ana
chemtracer_xml_filename: ./input/icon-art-oem/XML/tracers_oh_pntsrc.xml
pntSrc_xml_filename: ./input/icon-art-oem/XML/pntSrc_example.xml
oem_gridded_emissions_nc: ./input/icon-art-oem/OEM/tno_3cat.nc
oem_vertical_profiles_nc: ./input/icon-art-oem/OEM/vertical_profiles.nc
oem_hourofday_nc: ./input/icon-art-oem/OEM/hourofday.nc
oem_dayofweek_nc: ./input/icon-art-oem/OEM/dayofweek.nc
oem_monthofyear_nc: ./input/icon-art-oem/OEM/monthofyear.nc

icon:
binary_file: ./src/icon-art/bin/icon
runjob_filename: icon_runjob.cfg
compute_queue: normal
walltime: '00:10:00'
np_tot: 8
np_io: 1
np_restart: 1
np_prefetch: 1

62 changes: 32 additions & 30 deletions cases/icon-art-oem-test/icon_runjob.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
#SBATCH --job-name="{cfg.casename}_{cfg.inidate_yyyymmddhh}_{cfg.forecasttime}"
#SBATCH --job-name="{cfg.casename}_{cfg.startdate_sim_yyyymmddhh}_{cfg.forecasttime}"
#SBATCH --account={cfg.compute_account}
#SBATCH --time={cfg.icon_walltime}
#SBATCH --nodes={cfg.icon_np_tot}
#SBATCH --ntasks-per-core=1
#SBATCH --ntasks-per-node={cfg.ntasks_per_node}
#SBATCH --cpus-per-task=1
#SBATCH --partition={cfg.compute_queue}
#SBATCH --constraint={cfg.constraint}
#SBATCH --hint=nomultithread
Expand Down Expand Up @@ -39,38 +37,42 @@ ln -sf {cfg.art_input_folder}/runctrl_examples/init_ctrl/* .
cat > icon_master.namelist << EOF
! master_nml: ----------------------------------------------------------------
&master_nml
lrestart = {cfg.lrestart} ! .TRUE.=current experiment is resumed
lrestart = {cfg.lrestart} ! .TRUE.=current experiment is resumed
read_restart_namelists = .true.
/
! master_time_control_nml: ---------------------------------------------------
&master_time_control_nml
calendar = 'proleptic gregorian'
restartTimeIntval = '{cfg.restart_step}'
checkpointTimeIntval = '{cfg.restart_step}'
experimentStartDate = '{cfg.ini_datetime_string}'
experimentStopDate = '{cfg.end_datetime_string}'
/
! master_model_nml: repeated for each model ----------------------------------
&master_model_nml
model_type = 1 ! identifies which component to run (atmosphere,ocean,...)
model_name = "ATMO" ! character string for naming this component.
model_namelist_filename = "NAMELIST_NWP" ! file name containing the model namelists
model_namelist_filename = "NAMELIST_{cfg.casename}" ! file name containing the model namelists
model_min_rank = 1 ! start MPI rank for this model
model_max_rank = 65536 ! end MPI rank for this model
model_inc_rank = 1 ! stride of MPI ranks
/
! time_nml: specification of date and time------------------------------------
&time_nml
ini_datetime_string = "{cfg.ini_datetime_string}" ! initial date and time of the simulation
end_datetime_string = "{cfg.end_datetime_string}" ! end date and time of the simulation 10T00
/
EOF

# ----------------------------------------------------------------------
# model namelists
# ----------------------------------------------------------------------

cat > NAMELIST_NWP << EOF
cat > NAMELIST_{cfg.casename} << EOF
! parallel_nml: MPI parallelization -------------------------------------------
&parallel_nml
nproma = 128 ! loop chunk length
p_test_run = .FALSE. ! .TRUE. means verification run for MPI parallelization
num_io_procs = 1 ! number of I/O processors
num_restart_procs = 0 ! number of restart processors
num_prefetch_proc = 1 ! number of processors for LBC prefetching
num_io_procs = {cfg.icon_np_io} ! number of I/O processors
num_restart_procs = {cfg.icon_np_restart} ! number of restart processors
num_prefetch_proc = {cfg.icon_np_prefetch} ! number of processors for LBC prefetching
iorder_sendrecv = 3 ! sequence of MPI send/receive calls
/
Expand Down Expand Up @@ -108,18 +110,18 @@ cat > NAMELIST_NWP << EOF
cart_cheminit_type = 'EMAC'
cart_cheminit_coord = '{inidata_filename}'
iart_seasalt = 0 ! enable seasalt
cart_chemtracer_xml = '{cfg.chemtracer_xml_filename_scratch}' ! path to xml file for passive tracers
cart_pntSrc_xml = '{cfg.pntSrc_xml_filename_scratch}'
cart_chemtracer_xml = '{cfg.input_files_scratch_chemtracer_xml_filename}' ! path to xml file for passive tracers
cart_pntSrc_xml = '{cfg.input_files_scratch_pntSrc_xml_filename}'
cart_input_folder = '{cfg.art_input_folder}' ! absolute Path to ART source code
/
! oem_nml: online emission module ---------------------------------------------
&oemctrl_nml
gridded_emissions_nc = '{cfg.oem_gridded_emissions_nc_scratch}'
vertical_profile_nc = '{cfg.oem_vertical_profiles_nc_scratch}'
hour_of_day_nc = '{cfg.oem_hourofday_nc_scratch}'
day_of_week_nc = '{cfg.oem_dayofweek_nc_scratch}'
month_of_year_nc = '{cfg.oem_monthofyear_nc_scratch}'
gridded_emissions_nc = '{cfg.input_files_scratch_oem_gridded_emissions_nc}'
vertical_profile_nc = '{cfg.input_files_scratch_oem_vertical_profiles_nc}'
hour_of_day_nc = '{cfg.input_files_scratch_oem_hourofday_nc}'
day_of_week_nc = '{cfg.input_files_scratch_oem_dayofweek_nc}'
month_of_year_nc = '{cfg.input_files_scratch_oem_monthofyear_nc}'
/
! diffusion_nml: horizontal (numerical) diffusion ----------------------------
Expand All @@ -145,7 +147,7 @@ cat > NAMELIST_NWP << EOF
! extpar_nml: external data --------------------------------------------------
&extpar_nml
itopo = 1 ! topography (0:analytical)
extpar_filename = '{cfg.extpar_filename_scratch}' ! filename of external parameter input file
extpar_filename = '{cfg.input_files_scratch_extpar_filename}' ! filename of external parameter input file
n_iter_smooth_topo = 1,1 ! iterations of topography smoother
heightdiff_threshold = 3000. ! height difference between neighb. grid points
hgtdiff_max_smooth_topo = 750.,750. ! see Namelist doc
Expand All @@ -157,15 +159,15 @@ cat > NAMELIST_NWP << EOF
init_mode = 2 ! 7: start from DWD fg with subsequent vertical remapping
lread_ana = .FALSE. ! no analysis data will be read
ifs2icon_filename = "{inidata_filename}" ! initial data filename
ana_varnames_map_file = "{cfg.map_file_ana_scratch}" ! dictionary mapping internal names onto GRIB2 shortNames
ana_varnames_map_file = "{cfg.input_files_scratch_map_file_ana}" ! dictionary mapping internal names onto GRIB2 shortNames
ltile_coldstart = .TRUE. ! coldstart for surface tiles
ltile_init = .FALSE. ! set it to .TRUE. if FG data originate from run without tiles
/
! grid_nml: horizontal grid --------------------------------------------------
&grid_nml
dynamics_grid_filename = "{cfg.dynamics_grid_filename_scratch}" ! array of the grid filenames for the dycore
radiation_grid_filename = "{cfg.radiation_grid_filename_scratch}" ! array of the grid filenames for the radiation model
dynamics_grid_filename = "{cfg.input_files_scratch_dynamics_grid_filename}" ! array of the grid filenames for the dycore
radiation_grid_filename = "{cfg.input_files_scratch_radiation_grid_filename}" ! array of the grid filenames for the radiation model
dynamics_parent_grid_id = 0 ! array of the indexes of the parent grid filenames
lredgrid_phys = .TRUE. ! .true.=radiation is calculated on a reduced grid
lfeedback = .TRUE. ! specifies if feedback to parent grid is performed
Expand Down Expand Up @@ -199,9 +201,9 @@ cat > NAMELIST_NWP << EOF
itype_latbc = 1 ! 1: time-dependent lateral boundary conditions
dtime_latbc = 10800 ! time difference between 2 consecutive boundary data
nlev_latbc = 90 ! Number of vertical levels in boundary data
latbc_boundary_grid = "{cfg.lateral_boundary_grid_scratch}" ! Grid file defining the lateral boundary
latbc_boundary_grid = "{cfg.input_files_scratch_lateral_boundary_grid}" ! Grid file defining the lateral boundary
latbc_path = "{cfg.icon_input_icbc}" ! Absolute path to boundary data
latbc_varnames_map_file = "{cfg.map_file_latbc_scratch}"
latbc_varnames_map_file = "{cfg.input_files_scratch_map_file_latbc}"
latbc_filename = "{cfg.latbc_filename}" ! boundary data input filename
init_latbc_from_fg = .FALSE. ! .TRUE.: take lbc for initial time from first guess
/
Expand Down Expand Up @@ -266,8 +268,8 @@ cat > NAMELIST_NWP << EOF
icapdcycl = 3 ! apply CAPE modification to improve diurnalcycle over tropical land
icpl_aero_conv = 1 ! coupling between autoconversion and Tegen aerosol climatology
icpl_aero_gscp = 1 ! coupling between autoconversion and Tegen aerosol climatology
lrtm_filename = '{cfg.lrtm_filename_scratch}' ! longwave absorption coefficients for RRTM_LW
cldopt_filename = '{cfg.cldopt_filename_scratch}' ! RRTM cloud optical properties
lrtm_filename = '{cfg.input_files_scratch_lrtm_filename}' ! longwave absorption coefficients for RRTM_LW
cldopt_filename = '{cfg.input_files_scratch_cldopt_filename}' ! RRTM cloud optical properties
dt_rad = 720. ! time step for radiation in s
dt_conv = 120.,90.,90. ! time step for convection in s (domain specific)
dt_sso = 120.,360.,360. ! time step for SSO parameterization
Expand Down
Loading

0 comments on commit 20a26ae

Please sign in to comment.