Closed christos-e closed 1 year ago
Error verified, working on the solution
For the inline emissions file created by Smkmerge, the file gets opened in src/smkmerge/openmrgout.f starting at line 307 (checks for INLINEFLAG). Setting up the output file variable names and units gets handled by a call to the SETUP_VARIABLES subroutine, which checks if speciation is being used (SFLAG which is from the MRG_SPCMAT_YN envvar) and then copies over variable names from the list of species (or inventory or temporal if not using speciated data). The units come from the array GRDUNIT, which is populated in src/smkmerge/mrgunits.f, again based on how Smkmerge is being run and the user’s requested output units (MRG_GRDOUT_UNIT).
One option is to override the output file variable after it gets set up in openmrgout.f:
IF( INLINEFLAG ) THEN
C............. Get variable names for I/O API file
CALL SETUP_VARIABLES( PNIPOL, PNMSPC, PEINAM, PEMNAM )
DO V = 1, NVARSET
IF (VNAMESET(V) == 'HFLUX') THEN
VUNITSET(V) = 'BTU/hr'
END IF
END DO
I'm not sure if the units should always be BTU/hr or if the value gets converted depending on the MRG_GRDOUT_UNIT setting.
Implementing this ends up with a crash on smkinven:
/proj/ie/proj/TRECH/emissions/2017NEI/2017gb_17j_tests/inputs/ptfire/ptday_ptfire_2017NEI_20200407_CONUS_HAPs_07apr2020_v0 Successful open for emissions file: /proj/ie/proj/TRECH/emissions/2017NEI/2017gb_17j_tests/inputs/ptfire/ptday_ptfire_2017NEI_20200206_CONUS_CAPs_07apr2020_nf_v1 Value for HOURLY_TO_DAILY not defined;returning default: FALSE Value for HOURLY_TO_PROFILE not defined;returning default: FALSE
The crash was related to running methods (SLURM or outside it) not propagating correctly. Fixed and now and the issue is resolved with the added code. The actual values need to be confirmed for their temporal aggregation (i.e. are they indeed BTU/hr).
The unit for HFLUX in inline emissions file is incorrectly designated as "moles/s" instead of "BTU/hr"