Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible varkeys in dfmt.preprocess_merge_meteofiles_era5() #887

Open
4 tasks
veenstrajelmer opened this issue Jul 9, 2024 · 0 comments
Open
4 tasks

Flexible varkeys in dfmt.preprocess_merge_meteofiles_era5() #887

veenstrajelmer opened this issue Jul 9, 2024 · 0 comments
Assignees

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Jul 9, 2024

the varkey_list loop in dfmt.preprocess_merge_meteofiles_era5() only supports a limited set of meteo combinations. This should be more flexible. Better approach would be to:

  • create a dictionary of abbreviations/quantities and remove the if-loop
  • support for separate quantities, all should now be supported by the FM kernel since DIMRset 2.26.05 (8 dec 2023), consider adding a warning if not sticking to the four predefined combinations
  • add backwards compatibility for combined quantities. Do notice the rainfall rate +-operand.
  • test_preprocess_merge_meteofiles_era5_unsupported_varlist will fail since ["msl"] will not be unsupported anymore, so restructure this testcase

Old snippet of the code:

if varkey_list == ['msl','u10n','v10n','chnk']:
forcing_meteo = hcdfm.ExtOldForcing(quantity='airpressure_windx_windy_charnock',
filename=file_out,
varname='msl u10n v10n chnk',
filetype=hcdfm.ExtOldFileType.NetCDFGridData, #11
method=hcdfm.ExtOldMethod.InterpolateTimeAndSpaceSaveWeights, #3
operand=hcdfm.Operand.override, #O
)
ext_old.forcing.append(forcing_meteo)
elif varkey_list == ['d2m','t2m','tcc']:
forcing_meteo = hcdfm.ExtOldForcing(quantity='dewpoint_airtemperature_cloudiness',
filename=file_out,
varname='d2m t2m tcc',
filetype=hcdfm.ExtOldFileType.NetCDFGridData, #11
method=hcdfm.ExtOldMethod.InterpolateTimeAndSpaceSaveWeights, #3
operand=hcdfm.Operand.override, #O
)
ext_old.forcing.append(forcing_meteo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants