GRIDDESC error when running twoway WRF-CMAQ

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:

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:

/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

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

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

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

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.

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.

@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

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

1 Like

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

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

2 Likes