geoschem / GCHP

The "superproject" wrapper repository for GCHP, the high-performance instance of the GEOS-Chem chemical-transport model.
https://gchp.readthedocs.io
Other
23 stars 26 forks source link

[BUG/ISSUE] Implementation of HTAPv3 for GCHP without any error but no emission concentration in the output file #225

Closed 1Dandan closed 2 years ago

1Dandan commented 2 years ago

What institution are you from?

Washington University in St. Louis

Description of the problem

I am trying to add new global HTAPv3 emission inventory for GCHP by editing HEMCO_Config.rc and ExtData.rc files. The simulation ran well without any error message. But the emission and concentration outputs are not reasonable. It looks like the emission from HTAPv3 is not read successfully because the anthropogenic emission is basically zero. For example, Anthropogenic emissions output for NO is only default fill value of 1e-25 at the 72 level.

Concentration output of NO2 at the first level: NO2-conc-HTAPv3

Anthropogenic emissions of NO from HTAPv3: HTAPv3-emission Anthropogenic emissions of NO from default CEDSv2: CEDSv2-emission

The processed emission files attributes:

$ ncdump -h HTAPv3_NO_0.1x0.1_2017.nc
netcdf HTAPv3_NO_0.1x0.1_2017 {
dimensions:
        time = UNLIMITED ; // (12 currently)
        lat = 1800 ;
        lon = 3600 ;
variables:
        double time(time) ;
                time:_FillValue = NaN ;
                time:units = "days since 2000-01-01 00:00:00" ;
                time:delta_t = "0000-01-00 00:00:00" ;
                time:axis = "T" ;
                time:standard_name = "Time" ;
                time:long_name = "Time" ;
                time:calender = "standard" ;
        double lat(lat) ;
                lat:_FillValue = NaN ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:standard_name = "Latitude" ;
                lat:lomg_name = "Latitude" ;
        double lon(lon) ;
                lon:_FillValue = NaN ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
                lon:standard_name = "Longitude" ;
                lon:long_name = "Longitude" ;
        double NO_SHP(time, lat, lon) ;
                NO_SHP:_FillValue = NaN ;
                NO_SHP:long_name = "NO emission in sector SHP" ;
                NO_SHP:units = "kg m-2 s-1" ;
        double NO_ENE(time, lat, lon) ;
                NO_ENE:_FillValue = NaN ;
                NO_ENE:long_name = "NO emission in sector ENE" ;
                NO_ENE:units = "kg m-2 s-1" ;
        double NO_IND(time, lat, lon) ;
                NO_IND:_FillValue = NaN ;
                NO_IND:long_name = "NO emission in sector IND" ;
                NO_IND:units = "kg m-2 s-1" ;
        double NO_SLV(time, lat, lon) ;
                NO_SLV:_FillValue = NaN ;
                NO_SLV:long_name = "NO emission in sector SLV" ;
                NO_SLV:units = "kg m-2 s-1" ;
        double NO_TRA(time, lat, lon) ;
                NO_TRA:_FillValue = NaN ;
                NO_TRA:long_name = "NO emission in sector TRA" ;
                NO_TRA:units = "kg m-2 s-1" ;
        double NO_RCO(time, lat, lon) ;
                NO_RCO:_FillValue = NaN ;
                NO_RCO:long_name = "NO emission in sector RCO" ;
                NO_RCO:units = "kg m-2 s-1" ;
        double NO_WST(time, lat, lon) ;
                NO_WST:_FillValue = NaN ;
                NO_WST:long_name = "NO emission in sector WST" ;
                NO_WST:units = "kg m-2 s-1" ;
        double NO_AGR(time, lat, lon) ;
                NO_AGR:_FillValue = NaN ;
                NO_AGR:long_name = "NO emission in sector AGR" ;
                NO_AGR:units = "kg m-2 s-1" ;

// global attributes:
                :Title = "COARDS/netCDF file containing monthly emissions of NO" ;
                :Conventions = "COARDS" ;
}

Example plots from HTAPv3 emissions of NO from sector transportation to show it does have nonzero emissions from the netcdf file: NO-2017-HTAPv3

GEOS-Chem version

v13.2.1

Description of code modifications

The source code is left as default. I only changed the HEMCO_Config.rc and ExtData.rc. The modified configuration files: ExtData.rc.txt HEMCO_Config.rc.txt logging.yml.txt

Log files

The allPEs.log is too large to attach here. The relevant lines are:

0047: CAP.EXTDATA: DEBUG:  >> REFFTIME for /storage1/fs1/rvmartin/Active/dandan.z/edgar_HTAPv3_lumped_sector/HTAPv3_NO_0.1x0.1_%y4.nc: <>
0048: CAP.EXTDATA: DEBUG:  >> Frequency     : 0000-00-00 00:00:00
0049: CAP.EXTDATA: DEBUG:  >> REFFTIME for /storage1/fs1/rvmartin/Active/dandan.z/edgar_HTAPv3_lumped_sector/HTAPv3_NO_0.1x0.1_%y4.nc: <>
0050: CAP.EXTDATA: DEBUG:  >> Frequency     : 0000-00-00 00:00:00
0051: CAP.EXTDATA: DEBUG:  >> Frequency     : 0000-00-00 00:00:00
0052: CAP.EXTDATA: DEBUG:  >> REFFTIME for /storage1/fs1/rvmartin/Active/dandan.z/edgar_HTAPv3_lumped_sector/HTAPv3_NO_0.1x0.1_%y4.nc: <>
0053: CAP.EXTDATA: DEBUG:  >> REFFTIME for /storage1/fs1/rvmartin/Active/dandan.z/edgar_HTAPv3_lumped_sector/HTAPv3_NO_0.1x0.1_%y4.nc: <>
0054: CAP.EXTDATA: DEBUG:  >> REFFTIME for /storage1/fs1/rvmartin/Active/dandan.z/edgar_HTAPv3_lumped_sector/HTAPv3_NO_0.1x0.1_%y4.nc: <>

0049: CAP.EXTDATA: DEBUG:  >> REFFTIME for ./HcoDir/CEDS/v2021-06/%y4/NO-em-anthro_CMIP_CEDS_%y4.nc: <>
0050: CAP.EXTDATA: DEBUG:  >> Frequency     : 0000-00-00 00:00:00
0051: CAP.EXTDATA: DEBUG:  >> Frequency     : 0000-00-00 00:00:00
0052: CAP.EXTDATA: DEBUG:  >> REFFTIME for ./HcoDir/CEDS/v2021-06/%y4/NO-em-anthro_CMIP_CEDS_%y4.nc: <>
0053: CAP.EXTDATA: DEBUG:  >> REFFTIME for ./HcoDir/CEDS/v2021-06/%y4/NO-em-anthro_CMIP_CEDS_%y4.nc: <>
0054: CAP.EXTDATA: DEBUG:  >> REFFTIME for ./HcoDir/CEDS/v2021-06/%y4/NO-em-anthro_CMIP_CEDS_%y4.nc: <>

Software versions

lizziel commented 2 years ago

Hi @1Dandan, it's hard to say based on this information alone. To be clear, your run did not have a run-time error, correct? I ask because your log file shows exit with an error after the first hour but you said it ran fine. Did you cancel the job which caused that error?

You can try doing the following and report back:

1) Add HTAP3 inventory diagnostics to HEMCO_Diagn.rc and HISTORY.rc by looking for existing diagnostics that start with INV in those files. Rerunning (no need to recompile) will output the HTAP3 data directly. 2) try changing the verbose and warnings settings at the top of HEMCO_Config.rc to 3 to get maximum output in the HEMCO.log file 3) Change the level setting in logging.yml for CAP.EXTDATA back to WARNING. This will greatly reduce the file size of allPEs.log. The relevant ExtData information in the file will get printed by all processors so we only need one. Alternatively, grep the log file you currently have for just one process, e.g. 0051. Then search for the HTAP v3 sections and post them here.

1Dandan commented 2 years ago

Thanks @lizziel. Yes, I manually terminated my job after 1 hour simulation. I will try your suggestions and attach relevant log files hopefully by the end of tomorrow.

1Dandan commented 2 years ago

Hi @lizziel. I added HTAPv3 inventory diagnostics in HEMCO_Diagn.rc and HISTORY.rc, but the Emission output doesn't contain "Inv" diagnostics, and emission diagnostics starting with "Emis" still don't look right with zero emission fluxes. I am wondering if I have missed something else. The emission output looks like: Emissions_attribute.txt

The configuration files: ExtData.rc.txt HEMCO_Config.rc.txt HEMCO_Diagn.rc.txt HISTORY.rc.txt logging.yml.txt

The log files: allPEs.log.txt HEMCO.log.txt run-HTAPv3.log.txt

lizziel commented 2 years ago

Hi @1Dandan, in your latest run it seems to have gone straight from initialize to finalize, without actually running any timesteps. What are your start and end dates set to in runConfig.sh? Also, try setting the MAPL entry for root_level to DEBUG in config file logging.yml.

1Dandan commented 2 years ago

Thanks @lizziel, sorry I only checked the updated files. For that run, I used the start date and end date in runConfig.sh of

Start_Time="20171201 000000"
End_Time="20171201 010000"
Duration="00000000 010000"

I didn't delete cap_restart and thus makes the simulation to start from 20171201 010000 for that run and for my current run as well. Thus my current run also starts with 20171201 010000.

I ran the simulation again with HTAPv3. I still encounter no emission fluxes problem. I have turned on MAPL entry for root_level to DEBUG for this run. For the current run, I can see the outputs of starting with Inv in emission diagnostics, but still it is zero. The attributes for the emission outputs: emission-attribute-01.txt

Configuration files are: CAP.rc.txt ExtData.rc.txt GCHP.rc.txt HEMCO_Config.rc.txt HISTORY.rc.txt runConfig.sh.txt logging.yml.txt

Log files are: allPEs.log.txt HEMCO.log.txt run-HTAPv3.log.txt

lizziel commented 2 years ago

Hi @1Dandan, thanks for rerunning and posting all of the config and logs. I've traced the problem to a silent bug we were previously unaware of. In HEMCO_Config.rc you can apparently not use tabs between bracket name and true/false switch in the "Extension switches" section (used for based emissions in addition to extensions).

For HTAPv3 you need to change these lines to use spaces and not tabs:

    --> HTAPv3             :       true # 2000-2018
    --> HTAPv3_SHIP        :       true # 2000-2018

I'm going to follow-up with a separate bug report in GEOS-Chem and HEMCO about this so that we can get it fixed asap.

1Dandan commented 2 years ago

Thanks @lizziel , this is really hard to find. Can I use tabs for the specific species emission under HTAPv3 and HTAPv3_SHIP?

lizziel commented 2 years ago

I believe you can but I have not tested it. In general it is best not to use tabs in our config files unless required by the config file format.

1Dandan commented 2 years ago

Got it. I will avoid using tabs in config files. Just to let you know it indeed runs well when I replace tabs by spaces.