# GRIDDESC error when running twoway WRF-CMAQ

**URL:** <https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460>\
**Category:** Run Time Errors and Issues\
**Created:** [June 30, 2021, 3:26pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460 "2021-06-30T15:26:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![asmontgomery](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@asmontgomery](https://forum.cmascenter.org/u/asmontgomery)\
**Post date:** [June 30, 2021, 3:26pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/1 "2021-06-30T15:26:26Z")

</div>

Hello,

I’m trying to run a two-way WRF v3.8 -CMAQ v5.2 model at 4 km. When I run the model, I believe I am getting an error because the GRIDDESC file that is created is missing a space, or maybe has too many float points, but the GRIDDESC in the output file is this:

```auto
tail /projects/b1045/wrf-cmaq/output/CONUS4K/output_CONUS4K_d02_4km_sf_rrtmg_12_8_1_v3852/GRIDDESC

' '

'LAM_040N097W'

 2 33.000 45.000 -97.000 -97.000 40.000

' '

'CONUS4K_d02'

'LAM_040N097W' -2292000.000 -1584000.000 4000.000 4000.0001155 726 1

' '

```

So you can see that the 4000.001155 run into each other.

However, for the GRIDDESC in the input file which I created, I do not have this issue:

```auto
/projects/b1045/cmaq/cmaq_v5.2/PREP/mcip/scripts/data/mcip/CONUS4K_d02/GRIDDESC

' '

'LAM_40N97W'

  2 33.000 45.000 -97.000 -97.000 40.000

' '

'CONUS4K_d02'

'LAM_40N97W' -2292000.000 -1584000.000 4000.000 4000.000 1155 726 1

' '

```

Here is the original log file where I decided the error was this GRIDDESC run-on issue

```auto
d01 2015-12-23_00:01:36 call HALO_RK_SCALAR

d01 2015-12-23_00:01:36 calling inc/HALO_EM_SCALAR_E_5_inline.inc

d01 2015-12-23_00:01:36 call end of solve_em

     Value for CTM_RUNLEN: 240000

     Value for GRID_NAME: 'CONUS4K_d02'

     File "GRIDDESC" opened for input on unit: 99

     /projects/b1045/wrf-cmaq/output/CONUS4K/output_CONUS4K_d02_4km_sf_rrtmg_12_8_1_v3852/GRIDDESC

     >>--->> WARNING in subroutine DSCGRID

     Error 64 reading grid descriptions at line 6

     >>--->> WARNING in subroutine HGRD_INIT on PE 000

     Failure retrieving horizontal grid parameters

     >>--->> WARNING in subroutine GRID_INIT

     *** Failure defining horizontal domain

     *** ERROR ABORT in subroutine DRIVER on PE 000          

     *** Failure defining domain configuration

     Date&time specified as 0

```

Is there a way to fix this error? I’m not sure why this is happening, if perhaps theres a greater error on hand.

Thanks,  
Anastasia

---

<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:** [June 30, 2021, 4:37pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/2 "2021-06-30T16:37:04Z")

</div>

This would seem to be a programming error in WRF-CMAQ.

A workaround to get a good _GRIDDESC_ file from WRF output for use in, e.g., SMOKE, would be to use M3Tools program _ **wrfgriddesc** _ – see [https://cjcoats.github.io/ioapi/WRFGRIDDESC.html](https://cjcoats.github.io/ioapi/WRFGRIDDESC.html)

This does not work, of course, for the times WRF-CMAQ itself needs to access _GRIDDESC_…

---

<div class="post-metadata">

**Author:** ![asmontgomery](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@asmontgomery](https://forum.cmascenter.org/u/asmontgomery)\
**Post date:** [June 30, 2021, 4:58pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/3 "2021-06-30T16:58:41Z")

</div>

Hmm, yes, weirdly I did manage to get the GRIDDESC to work for SMOKE and I managed to create the 4km emissions for this model run. @jschnell provided me with this guidance:

The error occurs in line 113-114 of /projects/b1045/wrf-cmaq/WRFV38\_BIGBOY/cmaq/twoway\_util\_module.F90

And to change the line to include a space, ie:  
write (10, 16) buffer, ioapi\_header%xorig, ioapi\_header%yorig, ioapi\_header%xcell, ioapi\_header%ycell, “ “, &  
g\_ncols, g\_nrows, ioapi\_header%nthik

Then recompiling the directory.

I haven’t tried this solution yet, but if there are no other explanations then I’ll try this.

---

<div class="post-metadata">

**Author:** ![asmontgomery](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@asmontgomery](https://forum.cmascenter.org/u/asmontgomery)\
**Post date:** [June 30, 2021, 5:40pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/4 "2021-06-30T17:40:30Z")

</div>

I guess also if this is unclear, this GRIDDESC error occurs when I am running the two-way WRF-CMAQ model. I do have a successful GRIDDESC from mcip.

---

<div class="post-metadata">

**Author:** ![tlspero](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@tlspero](https://forum.cmascenter.org/u/tlspero)\
**Post date:** [June 30, 2021, 6:11pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/5 "2021-06-30T18:11:39Z")

</div>

@asmontgomery –

It appears that a space is missing in the GRIDDESC between the DELTA-Y and NCOLS (where “4000.0001155” should be “4000.000 1155”). There appears to be an error in the CCTM subroutine setup\_griddesc\_file within the file twoway\_util\_module.F90. Normally this would not be tripped, but your dimension in NCOLS has 4 digits (which is more than most users typically have), which prevents a space from being written.

To correct this problem, please change the format label 16 from:  
(a14, 4f14.3, 3i4)

to:  
(a, 4f14.3, 3(1x, i4))

I’ll work with the development team to correct this in a future release.

–Tanya

---

<div class="post-metadata">

**Author:** ![wong.david-c](https://avatars.discourse-cdn.com/v4/letter/w/bcef8e/32.png) [@wong.david-c](https://forum.cmascenter.org/u/wong.david-c)\
**Post date:** [June 30, 2021, 6:56pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/6 "2021-06-30T18:56:01Z")

</div>

Hi Anastasia,

```
It was my mistake that I did not anticipate ncols or nrows > 999. Anyway either you can follow Tanya's suggestion or change (a14, 4f14.3, 3i4) to (a14, 4f14.3, 3i6). I don't think ncols or nrows > 99999 is needed.

```

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![asmontgomery](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@asmontgomery](https://forum.cmascenter.org/u/asmontgomery)\
**Post date:** [June 30, 2021, 6:57pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/7 "2021-06-30T18:57:17Z")

</div>

No problem, thank you all for your help, I have implemented that fix and I’m on to the next round of de-bugging 🙂

---

<div class="post-metadata">

**Author:** ![wong.david-c](https://avatars.discourse-cdn.com/v4/letter/w/bcef8e/32.png) [@wong.david-c](https://forum.cmascenter.org/u/wong.david-c)\
**Post date:** [July 1, 2021, 2:30pm UTC](https://forum.cmascenter.org/t/griddesc-error-when-running-twoway-wrf-cmaq/2460/8 "2021-07-01T14:30:51Z")

</div>

Hi Anastasia,

```
Just let you know that the following fix (a14, 4f14.3, 3i4) to (a14, 4f14.3, 3i6) has been implemented and will be available in the next release (Fall 2021).

```

Cheers,  
David
