geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
169 stars 165 forks source link

Reading emissions file with HEMCO #2552

Open ktravis213 opened 1 week ago

ktravis213 commented 1 week ago

Your name

Katie Travis

Your affiliation

NASA LaRC

What happened? What did you expect to happen?

I was given files for FINN fire emissions for Jan-Jun 2024 for modeling ASIA-AQ. I processed them to be compliant for GEOS-Chem. See the ncdump here:

 ncdump -h emissions-finnv2.5.1nrt_modvrs_BC_bb_surface_daily_20240101-20240630_0.1x0.1_CF.nc 
netcdf emissions-finnv2.5.1nrt_modvrs_BC_bb_surface_daily_20240101-20240630_0.1x0.1_CF {
dimensions:
        time = UNLIMITED ; // (182 currently)
        lat = 1799 ;
        lon = 3600 ;
variables:
        int date(time) ;
                date:units = "YYYYMMDD" ;
                date:long_name = "Date" ;
        float fire(time, lat, lon) ;
                fire:_FillValue = NaNf ;
                fire:units = "molecules/cm^2/s" ;
                fire:map = "BC->BC;aerosol" ;
                fire:long_name = "BC fire emissions" ;
        float lat(lat) ;
                lat:_FillValue = NaNf ;
                lat:units = "degrees_north" ;
                lat:long_name = "latitude" ;
                lat:axis = "Y" ;
        float lon(lon) ;
                lon:_FillValue = NaNf ;
                lon:long_name = "longitude" ;
                lon:axis = "X" ;
                lon:units = "degrees_east" ;
        float time(time) ;
                time:_FillValue = NaNf ;
                time:long_name = "Time" ;
                time:axis = "T" ;
                time:units = "days since 1990-01-01" ;
                time:calendar = "Gregorian" ;
        float fire_kg_m2_s(time, lat, lon) ;
                fire_kg_m2_s:_FillValue = NaNf ;
                fire_kg_m2_s:units = "kg/m^2/s" ;
                fire_kg_m2_s:long_name = "fire" ;

// global attributes:
                :title = "FINNv2.5.1nrt_modvrs daily fire emissions" ;
                :TargetModel = "CAMFV" ;
                :TargetGrid = "0.1x0.1" ;
                :Frequency = "daily" ;

This is the verbose error output from HEMCO. There is no information about what 'not enough entires found' means. I set it to only have 6 months, hoping this would work but no luck.

Opened shortcut bracket: FINN_ASIAAQ
  - Skip content of this bracket:  F
 Not enough elements in: 0 FINN_BCPI_ASIA_AQ$ROOT/FINN/ASIA-AQ/emissions-finnv2.
 5.1nrt_modvrs_BC_bb_surface_daily_20240101-20240630_0.1x0.1_CF.nc    fire_kg_m2
 _s 2024/1-6/1-31/0 C xy kg/m2/s BCPI 70/75 5 1

HEMCO ERROR: STAT == 100; not enough entries found!
 --> LOCATION: Config_Read
 Cont (hco_config_mod.F90)

What are the steps to reproduce the bug?

Here is my implementation with HEMCO_Config.rc

0 FINN_BCPI_ASIA_AQ     $ROOT/FINN/ASIA-AQ/emissions-finnv2.5.1nrt_modvrs_BC_bb_surface_daily_20240101-20240630_0.1x0.1_CF.nc       fire_kg_m2_s 2024/1-6/1-31/0 C xy kg/m2/s BCPI 70/75 5 1

Please attach any relevant configuration and log files.

No response

What GEOS-Chem version were you using?

14.5.0_rc0

What environment were you running GEOS-Chem on?

Other (please explain below)

What compiler and version were you using?

ifort

Will you be addressing this bug yourself?

Yes

In what configuration were you running GEOS-Chem?

GCClassic

What simulation were you running?

Full chemistry

As what resolution were you running GEOS-Chem?

2x25

What meterology fields did you use?

MERRA-2

Additional information

Running on Discover

lizziel commented 1 week ago

Hi @ktravis213, the error message means the line in HEMCO_Config.rc has fewer than expected elements after splitting up the string. The error message contains no space between the HEMCO variable name and the filename:

 Not enough elements in: 0 FINN_BCPI_ASIA_AQ$ROOT/FINN/ASIA-AQ/emissions-finnv2.
 5.1nrt_modvrs_BC_bb_surface_daily_20240101-20240630_0.1x0.1_CF.nc    fire_kg_m2
 _s 2024/1-6/1-31/0 C xy kg/m2/s BCPI 70/75 5 1

Are you sure there is at least one space there in the file? Did you use a tab? I am not aware of a tab not being allowed but maybe this is true.

ktravis213 commented 1 week ago

@lizziel Yes it was because I used tabs! Thank you I would never have figured this out.

yantosca commented 1 week ago

Thanks @ktravis213 and @lizziel. Maybe in future we could add some logic to strip out the tabs and replace with spaces. I can add that as a feature request on the HEMCO repo.