metno / emep-ctm

Open Source EMEP/MSC-W model
GNU General Public License v3.0
30 stars 20 forks source link

Applying a mask to emissions #125

Closed JanScheff closed 2 months ago

JanScheff commented 2 months ago

Hi,

I'm trying to run EMEP with a mask applied to the emissions and am following this recipe: https://emep-ctm.readthedocs.io/en/latest/Subrun.html#masks

I'm currently using EMEP rv4.45 and am trying to only mask PMCO and PM2.5 for this test. This is a global run with a nested domain in Asia. The mask nc-file has the same grid as the emissions and contains one variable (named mask_array) with 1s and 0s only.

EmisMask(1)%filename = '/path/to/MY_mask.nc', ! name of the netcdf file to read from
EmisMask(1)%cdfname  = 'mask_array',  ! name of the variable to read from the file
!EmisMask(1)%type     = 'CELL-FRACTION', ! the mask value is part of the reduction, default
EmisMask(1)%ID       = 'MY',  ! the name you give to that mask
EmisMask(1)%fac = 0.85, ! muliplicative factor to use. Default 0.0

  Emis_sourceFiles(1)%filename='co_emis_2018_0.01.nc',
  Emis_sourceFiles(2)%filename='nox_emis_2018_0.01.nc',
  Emis_sourceFiles(3)%filename='sox_emis_2018_0.01.nc',
  Emis_sourceFiles(4)%filename='nh3_emis_2018_0.01.nc',
  Emis_sourceFiles(5)%filename='pmco_emis_2018_0.01.nc',
  Emis_sourceFiles(6)%filename='pm25_emis_2018_0.01.nc',
  Emis_sourceFiles(7)%filename='voc_emis_2018_0.01.nc',

! apply mask to pm25 and pmco emissions
Emis_sourceFiles(5:6)%mask_ID = 2*'mask_array',

When I run it like this, I get the following warning in the out-file: WARNING mask not defined mask_array.

EMEP finished w/o error but compared to the base (normal setup w/o a mask) there is no difference in the PM fields.

Also, I tried to use "EmisMask(1)%type = 'CELL-FRACTION'," but that gave an error message: invalid reference to variable in NAMELIST input. I could not find where in the EMEP code the type or 'CELL-FRACTION' are actually defined or where. I'm not sure if the recipe I'm using is still up do date?

Am I missing anything in my setup?

Many thanks, Janice

gitpeterwind commented 2 months ago

Hi Janice,

First, the "latest" documentation is not for rv4.45 (Which does not have the "CELL-FRACTION" option). If you see a black box on the lower right part of the documentation pages, there are links to the documentation of other versions. And the mask_ID should be the ID: Emis_sourceFiles(5:6)%mask_ID = 2*'MY',

This is actually wrong in the "latest" docs! I will correct that.

Best wishes, Peter

JanScheff commented 2 months ago

Thank you, Peter! That works nicely now.