Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Variable missing error when trying to use own emissions files

James King

James King
Member
Hi all,

I'm trying to use some NH3 emissions files of my own to force CAM-Chem. I have made sure the emissions are in the same units and sectors are summed; made sure the lons go from 0 to 360; and made sure that the file is in netcdf-classic format to match the CMIP6 emissions files the model uses by default. However, when running, I get this error in the cesm.log:

Opened existing file /work/n02/n02/jking/cesm/CESM2.2.2_test/cesm_inputdata/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc 297
Opened existing file /work/n02/n02/jking/cesm/UK_soil/SSP3_CONTROL_NH3_emissions_with_uk_sum_units_rotated_fixedgrid_classic.nc 298
Abort with message NetCDF: Variable not found in file /work/n02/n02/jking/cesm/CESM2.2.2_test/my_cesm_sandbox/cime/src/externals/pio2/src/clib/pio_nc.c at line 1164


Now, the variables in the CMIP6 emissions files I am otherwise using are as follows (output from cdo sinfon):

File format : NetCDF
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name
1 : unknown unknown v instant 1 1 1 1 I32 : date
2 : unknown unknown v instant 1 1 55296 2 F32 : emiss_anthro
Grid coordinates :
1 : generic : points=1
2 : lonlat : points=55296 (288x192)
lon : 0 to 358.75 by 1.25 degrees_east circular
lat : -90 to 90 by 0.9424084 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate :
time : 3301 steps
RefTime = 1750-01-01 00:00:00 Units = days Calendar = gregorian


The variables in the file I want to use are as follows:

File format : NetCDF
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name
1 : unknown unknown v instant 1 1 882432 1 F32 : emiss_anthro
2 : unknown unknown c instant 1 1 2 2 F64 : sector_bnds
Grid coordinates :
1 : lonlat : points=882432 (1149x768)
lon : 0 to 358.75 by 0.3125 degrees_east
lat : -89.88281 to 89.88281 by 0.234375 degrees_north
2 : generic : points=2
Vertical coordinates :
1 : surface : levels=1
Time coordinate :
time : 84 steps
RefTime = 2015-01-01 00:00:00 Units = days Calendar = 365_day Bounds = true


I can see that the CMIP6 files have a variable called 'date' which my file doesn't have, and my file has a variable called 'sector_bnds' which the CMIP6 files don't have. The time coordinates are also slightly differently formated. Is this mismatch causing the error, and if so, how should I fix it? I have tried to add a 'date' variable to my file using nco and dates formatted as YYYYMMDD, as per the CMIP6 'date' variable:

ncap2 -s 'date=20150116;20150216...'
but this results in a different error:

Opened existing file /work/n02/n02/jking/cesm/CESM2.2.2_test/cesm_inputdata/atm/cam/chem/emis/emissions_ssp370/emissions-cmip6-ScenarioMIP_IAMC-AIM-ssp370-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190222.nc 297
Opened existing file /work/n02/n02/jking/cesm/UK_soil/SSP3_CONTROL_NH3_emissions_with_uk_sum_units_rotated_fixedgrid_classic_withdatevar.nc 298
Opened existing file /work/n02/n02/jking/cesm/UK_soil/SSP3_CONTROL_NH3_emissions_with_uk_sum_units_rotated_fixedgrid_classic_withdatevar.nc 299
ERROR timeaddmonths(): MM out of range
set_time_float_from_date: error return from ESMF_TimeSet for set_time_float_from_date


Trying to run in DEBUG mode also doesn't help, as the model then fails after reading a standard CMIP6 FLBC file which works perfectly when DEBUG mode is off.
Any advice on how to run CAM-Chem with my own emissions file would be much appreciated - I've not had any luck on the forums with this error, or been able to find a page on the CAM-Chem wiki for using user-generated emissions files.

Thanks,

James
 
Top