# An error occurred while running megan31 fert models:stop 'bio\_emiss abort'

**URL:** <https://forum.cmascenter.org/t/an-error-occurred-while-running-megan31-fert-models-stop-bio-emiss-abort/1767>\
**Category:** MEGAN\
**Created:** [September 11, 2020, 6:37am UTC](https://forum.cmascenter.org/t/an-error-occurred-while-running-megan31-fert-models-stop-bio-emiss-abort/1767 "2020-09-11T06:37:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenos\_an](https://avatars.discourse-cdn.com/v4/letter/x/e9bcb4/32.png) [@xenos\_an](https://forum.cmascenter.org/u/xenos_an)\
**Post date:** [September 11, 2020, 6:37am UTC](https://forum.cmascenter.org/t/an-error-occurred-while-running-megan31-fert-models-stop-bio-emiss-abort/1767/1 "2020-09-11T06:37:15Z")

</div>

Hi all,  
I am learning and testing megan31 and have completed three modules: Lai / ecotype / grwform.  
When I try to run prepmegan4cmaq\_ fert. x, I got the error message: stop bio\_emiss abort.  
I checked it out fert.log But I don’t know what the problem is. I hope I can get some hints.

```
 wrf_file: MAP_PROJ is not polar stereographic
 wrf_file: CEN_LON = 110.817413
 wrf_file: CEN_LAT = 37.7843323
 wrf_file: STAND_LON = 112.330002
 wrf_file: TRUELAT1 = 25.0000000
 wrf_file: TRUELAT2 = 47.0000000
 wrf_file: DX = 3000.00000

 proj_init: projection = 1
 proj_init: proj%hemi = 1.00000000
 proj_init: proj%rebydx = 2123.33325
 proj_init: proj%polei,j = 114.499680 2906.11963
 proj_init: west-east,south-north = 141 240

 wrf domain corners
 --- ------ -------
 sw corner @ ( 108.54730 , 34.448158 )
 se corner @ ( 113.21362 , 34.505753 )
 ne corner @ ( 113.29285 , 41.069546 )
 nw corner @ ( 108.20862 , 41.007008 )

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 wrf_file: grid dimensions
 wrf_file: ids,ide,jds,jde
     1 141 1 240
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 Reading megan2 bio emiss file soil_fert_001.nc
 megan2_bioemiss: nlon_megan, nlat_megan = 720 360
 megan2_bioemiss: data_dx,dx,has_area_map = 55588.7344 3000.00000 F
 megan2_bioemiss: file soil_fert_001.nc has a new grid

 megan2_bioemiss: model lon limits = 108.2086181640625 113.2928466796875
 megan2_bioemiss: model lat limits = 34.44815826416016 41.07315826416016

 megan2_bioemiss: megan lon limits = -179.7500000000000 179.7500000000000
 megan2_bioemiss: megan lat limits = -89.75000000000000 89.75000000000000

 megan2_bioemiss: count of points <,> data min,max lat = 0
 xndx_megan = 576 588
 megan2_bioemiss: count of points < data min lat = 0
 megan2_bioemiss: count of points > data max lat = 0
 yndx_megan = 249 263
```

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [September 11, 2020, 11:31am UTC](https://forum.cmascenter.org/t/an-error-occurred-while-running-megan31-fert-models-stop-bio-emiss-abort/1767/2 "2020-09-11T11:31:41Z")

</div>

Are you modeling teh area around Hothot, Baotou, Dongsheng, and Yuin in China, rather a bit to the west of Beijing? That’s where your latitude-bounds put you… for which there seems to be no data in your input-data.

---

<div class="post-metadata">

**Author:** ![xenos\_an](https://avatars.discourse-cdn.com/v4/letter/x/e9bcb4/32.png) [@xenos\_an](https://forum.cmascenter.org/u/xenos_an)\
**Post date:** [September 11, 2020, 1:07pm UTC](https://forum.cmascenter.org/t/an-error-occurred-while-running-megan31-fert-models-stop-bio-emiss-abort/1767/3 "2020-09-11T13:07:27Z")

</div>

Thank you for your reply, but the data I tested is the worldwide soil nitrogen emission module inputs downloaded by UCI BAI.  
[https://bai.ess.uci.edu/megan/data-and-code#h.p\_MkLqw8QBi\_F-](https://bai.ess.uci.edu/megan/data-and-code#h.p_MkLqw8QBi_F-)

---

<div class="post-metadata">

**Author:** ![amirdudu](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@amirdudu](https://forum.cmascenter.org/u/amirdudu)\
**Post date:** [January 17, 2022, 2:19pm UTC](https://forum.cmascenter.org/t/an-error-occurred-while-running-megan31-fert-models-stop-bio-emiss-abort/1767/4 "2022-01-17T14:19:07Z")

</div>

Dear @xenos_an,  
I am facing the same issue and I was wondering if you found a way to make it work.  
I run the program in debug mode and this is what it says:

```auto
           1 12 ./input/wrfout_d02_2020-12-24_00:00:00 /home/amir/megan32/MEGAN32_Prep_Code_Jan_2022                                                                                                                                                                                                                                                               
          13 94 238 190
 wrf_file: MAP_PROJ is not polar stereographic
 wrf_file: CEN_LON = 53.8499985    
 wrf_file: CEN_LAT = 31.8499832    
 wrf_file: STAND_LON = 53.9319992    
 wrf_file: TRUELAT1 = 32.2280006    
 wrf_file: TRUELAT2 = 0.00000000    
 wrf_file: DX = 12000.0000    
  
 proj_init: projection = 3
 proj_init: proj%hemi = 1.00000000    
 proj_init: proj%rebydx = 530.833313    
 proj_init: proj%polei,j = 0.00000000 0.00000000    
 proj_init: west-east,south-north = 237 189
  
 wrf domain corners
 --- ------ -------
 sw corner @ ( 38.793961 , 21.139252 )
 se corner @ ( 68.906036 , 21.139252 )
 ne corner @ ( 68.906036 , 41.448868 )
 nw corner @ ( 38.793961 , 41.448868 )
  
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 wrf_file: grid dimensions
 wrf_file: ids,ide,jds,jde
     1 237 1 189
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 month= 1
  
 Reading megan2 bio emiss file soil_nitrogen_mon01.nc
 megan2_bioemiss: nlon_megan, nlat_megan = 288 192
 megan2_bioemiss: data_dx,dx,has_area_map = 104774.289 12000.0000 F
 megan2_bioemiss: file soil_nitrogen_mon01.nc has a new grid
  
 megan2_bioemiss: model lon limits = 38.79396057128906 68.90603637695312    
 megan2_bioemiss: model lat limits = 21.13925170898438 41.44886779785156    
  
 megan2_bioemiss: megan lon limits = -180.0000000000000 178.7500000000000    
 megan2_bioemiss: megan lat limits = -90.00000000000000 90.00000000000000    
  
 megan2_bioemiss: count of points <,> data min,max lat = 0
 xndx_megan = 176 201
 megan2_bioemiss: count of points < data min lat = 0
 megan2_bioemiss: count of points > data max lat = 0
 yndx_megan = 118 141
  
 megan2_bioemiss: bilinear interp diagnostics
 megan2_bioemiss: ix
         176 177
 megan2_bioemiss: ax
   3.51684578E-02 0.964831531    
 megan2_bioemiss: megan lons
   38.7500000 40.0000000    
 megan2_bioemiss: wrf lon = 38.7939606    
 megan2_bioemiss: jy
         118 119
 megan2_bioemiss: by
  0.931094110 6.89058900E-02
 megan2_bioemiss: megan lats
   20.2617798 21.2041893    
 megan2_bioemiss: wrf lat = 21.1392517    
  
STOP diagnostics

```

---

<div class="post-metadata">

**Author:** ![amirdudu](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@amirdudu](https://forum.cmascenter.org/u/amirdudu)\
**Post date:** [January 19, 2022, 10:37pm UTC](https://forum.cmascenter.org/t/an-error-occurred-while-running-megan31-fert-models-stop-bio-emiss-abort/1767/5 "2022-01-19T22:37:03Z")

</div>

I have found the solution to this error so I am posting it here just in case someone needs it.  
The problem is with grid resolution of some of MEGAN input files (like soil\_nitrogen\_\* and soil\_fert\_\*). In order to solve the issue you need to regrid the input files to a finer grid using any means that you are familiar with. I used the following cdo commands:

**cdo -f nc -sellonlatbox,lon1,lon2,lat1,lat2 -random,r7200x3600 template.nc**

where lat1,2 and lon1,2 are the bounds of your modeling area. This creates a template nc file with 0.01 degree resolution. Next regrid your files using the following command:

**cdo -remapcon,**  **template.nc**  **input.nc**  **output.nc**
