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
167 stars 162 forks source link

[BUG/ISSUE] Read regional nested ND51 output #564

Closed Rainbow1994 closed 3 years ago

Rainbow1994 commented 3 years ago

Report a GEOS-Chem bug or technical issue

Describe the bug:

I turned on ND51 switch in input.geos and set up an Asian nested methane run. When I read ND51 output bpch files using xbpch python module, the length of 'longitude' doesn't match the size of 'J-AVG-$_CH4' field. I wonder if something wrong I set up in input.geos.

Error messages

ValueError: conflicting sizes for dimension 'lon': length 145 on 'IJ-AVG-$_CH4' and length 576 on 'lon'

Required information:

Your GEOS-Chem version and runtime environment:

Input and log files to attach

Additional context

yantosca commented 3 years ago

Thanks for writing @Rainbow1994. I think the issue is this... the ND51 menu is set up to produce global 4x5 output:

%%% ND50 MENU %%%       :
Turn on ND50 diagnostic : F
24-hr avg timeser. file : /data/shzhu/rerun_ch4_as//ts_24h_avg.ST000.EN0001-EN0002.YYYYMMDD.bpch
Output as HDF5?         : F
Tracers to include      : 82 83 84 85 86 87
IMIN, IMAX of region    :   1  72
JMIN, JMAX of region    :   1  46
LMIN, LMAX of region    :   1   1

but your simulation is a nested-grid run:

%%% GRID MENU %%%       :
Grid resolution         : 0.5x0.625
Longitude min/max       :  60.0 150.0
Latitude  min/max       : -11.0  55.0
 Half-sized polar boxes?: F
Number of levels        : 47
Nested grid simulation? : T
 Buffer zone (N S E W ) :  3  3  3  3

and I believe this grid has 145 longitude points x 133 latitude points. Therefore, you should use these settings in the ND51 diagnostic:

IMIN, IMAX of region    :   1 145
JMIN, JMAX of region    :   1  133
LMIN, LMAX of region    :   1   1
Rainbow1994 commented 3 years ago

I've set IMIN, IMAX of region in ND51 section as what you said. Do you mean that the min and max parameters of the region in other sections should be the same as those in the ND51 section, though I turned off the section switches?
image

yantosca commented 3 years ago

I've set IMIN, IMAX of region in ND51 section as what you said. Do you mean that the min and max parameters of the region in other sections should be the same as those in the ND51 section, though I turned off the section switches?

Only if you want output from those other timeseries diagnostics.

Rainbow1994 commented 3 years ago

Sorry, maybe I didn't make it clear. I ran geos.mp successfully, but I cannot read ND51 output using xbpch module. The error message shows: ValueError: conflicting sizes for dimension 'lon': length 145 on 'IJ-AVG-$_CH4' and length 576 on 'lon' image I wonder if longitude and latitude coordinate variables in Diag51_mod.f are unmatched with ND51 output variables.

yantosca commented 3 years ago

Question: what version of xarray are you using? You might have to go back to xarray 0.11 so that xbpch will work. I think updates to the xarray package broke backwards compatibility with xbpch.

Also, if you have solved the problem, please let us know and we can close out the issue.

yantosca commented 3 years ago

I am going to close out this issue as there has not been recent activity. Please feel free to open a new issue if you are still having problems.