Skip to content

Commit

Permalink
merge branch
Browse files Browse the repository at this point in the history
  • Loading branch information
LucR31 committed Nov 10, 2023
2 parents c86986c + 432efe9 commit bf03388
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 23 deletions.
1 change: 1 addition & 0 deletions aiida_flexpart/parsers/flexpart_cosmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def parse(self, **kwargs):
if 'CONGRATULATIONS' not in content:
self.out('output_file', output_node)
return ExitCode(1)

# add output file
self.logger.info("Parsing '{}'".format(output_filename))
with self.retrieved.open(output_filename, 'rb') as handle:
Expand Down
4 changes: 3 additions & 1 deletion aiida_flexpart/workflows/multi_dates_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ def prepare_meteo_folder_ifs(self):

results, node = launch_shell_job(
self.inputs.check_meteo_ifs_code,
arguments=' -s {sdate} -e {edate} -a',
arguments=' -s {sdate} -e {edate} -g {gribdir} -m {model} -a',
nodes={
'sdate': orm.Str(s_date),
'edate': orm.Str(e_date),
'gribdir': self.inputs.gribdir,
'model' : self.inputs.model_offline
})

if node.is_finished_ok:
Expand Down
34 changes: 20 additions & 14 deletions examples/example_workflow_combi.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ def test_run(flexpart_code):
model = 'cosmo7'
model_offline = 'IFS_GL_05'
username='lfernand'
outgrid_main = 'Europe'
outgrid_nest = 'Switzerland'
integration_time = 24
integration_time_offline = 48

users_address=f'/users/{username}/resources/flexpart/'
scratch_address=f'/scratch/snx3000/{username}/FLEXPART_input/'

Expand All @@ -87,23 +92,25 @@ def test_run(flexpart_code):
surfdepo = orm.RemoteData(
remote_path = users_address+'surfdepo.t',
computer=flexpart_code.computer)
#parent_folder = orm.load_node(pk previous tsk)
parent_folder = orm.RemoteData(
remote_path = '/scratch/snx3000/lfernand/aiida/76/8d/cb2c-2fc6-46c4-b609-1d33fce0f60c',
computer=flexpart_code.computer)

# parent_folder = orm.load_node(pk previous tsk)
# parent_folder = orm.RemoteData(
# remote_path = '/scratch/snx3000/lfernand/aiida/76/8d/cb2c-2fc6-46c4-b609-1d33fce0f60c',
# computer=flexpart_code.computer)
parent_folder = None

#builder starts
workflow = plugins.WorkflowFactory('flexpart.multi_dates')
builder = workflow.get_builder()
builder.fcosmo_code = flexpart_code
builder.fifs_code = orm.load_code('flexpart_ifs@daint')
builder.check_meteo_ifs_code = orm.load_code('check-ifs-data@daint-direct-106')
builder.check_meteo_cosmo_code = orm.load_code('check-cosmo-data@daint-direct-106')
builder.check_meteo_ifs_code = orm.load_code('check-ifs-data@daint-direct')
builder.check_meteo_cosmo_code = orm.load_code('check-cosmo-data@daint-direct')

#basic settings
builder.simulation_dates = simulation_dates
builder.integration_time = orm.Int(24)
builder.offline_integration_time = orm.Int(48)
builder.integration_time = orm.Int(integration_time)
builder.offline_integration_time = orm.Int(integration_time_offline)

#meteo realted settings
builder.model = orm.Str(model)
Expand Down Expand Up @@ -131,7 +138,6 @@ def test_run(flexpart_code):

builder.gribdir=orm.Str(scratch_address)


#model settings
builder.command = orm.Dict(
dict=read_yaml_data('inputs/command.yaml')) #simulation date will be overwritten
Expand All @@ -147,12 +153,12 @@ def test_run(flexpart_code):
#other
builder.outgrid = orm.Dict(
dict=read_yaml_data('inputs/outgrid.yaml', names=[
'Europe',
])['Europe'])
outgrid_main,
])[outgrid_main])
builder.outgrid_nest = orm.Dict(dict=read_yaml_data(
'inputs/outgrid_nest.yaml', names=[
'Europe',
])['Europe'])
'inputs/outgrid.yaml', names=[
outgrid_nest,
])[outgrid_nest])
builder.species = species
builder.land_use = {
'glc': glc,
Expand Down
14 changes: 14 additions & 0 deletions examples/inputs/outgrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,17 @@ Europe:
- 200.0
- 500.0
- 15000.0
Switzerland:
output_grid_type: 0 # 1 for coos provided in rotated system 0 for geographical.
longitude_of_output_grid: 4.96 # Longitude of lower left corner of output grid (left boundary of the first grid cell - not its centre).
latitude_of_output_grid: 45.48 # Latitude of lower left corner of output grid (lower boundary of the first grid cell - not its centre).
number_of_grid_points_x: 305 # Number of grid points in x direction (= # of cells + 1).
number_of_grid_points_y: 205 # Number of grid points in y direction (= # of cells + 1).
grid_distance_x: 0.02 # Grid distance in x direction.
grid_distance_y: 0.015 # Grid distance in y direction.
heights_of_levels: # List of heights of leves (upper boundary).
- 50.0
- 100.0
- 200.0
- 500.0
- 15000.0
8 changes: 0 additions & 8 deletions examples/inputs/outgrid_nest.yaml

This file was deleted.

0 comments on commit bf03388

Please sign in to comment.