wrf-model / WRF

The official repository for the Weather Research and Forecasting (WRF) model
Other
1.22k stars 674 forks source link

WRFDA stops when using CV7 with cloud_cv_options=2 and use_cv_w not set #1770

Open thomasuhoh opened 1 year ago

thomasuhoh commented 1 year ago

Describe the bug When using CV7 and combing all matrices to be.dat using _combine_be_cv7ccv2.exe and run WRFDA with _cloud_cvoptions=2 and _use_cvw=false, be.dat is not read correctly by _var/da/da_setup_structures/da_setup_beregional.inc when starting da_wrfvar.exe. The code stops in line 2230 of da_setup_be_regional.inc with the message Expected ps but got w

To Reproduce Steps to reproduce the behavior:

  1. Use ifort compiler (dmpar) and version 4.4.1
  2. Use namelist options _'use_cv_w=false' , 'cv_options=7', 'cloud_cvoptions=2' in namelist.input
  3. Set varnames = 'U', 'V', 'T', 'RH','QCLOUD', 'QRAIN', 'QICE', 'QSNOW', 'QGRAUP',"W","PSFC" in namelist.gen_be_v3

Expected behavior be.dat is read in correctly when CV7 is used in combination with _cloudcv-options=2 and _use_cvw=false

Additional context When _combine_be_cv7ccv2.exe is used, all derived be_*.dat are combined into a single be.dat using u, v, t, rh, qcloud, qrain,qice, qsnow, qgraup, w, and ps. If _use_cvw=false (which is default), the code expects that "w" is not in be.dat. The variable _num_cv_3dextra is only increased by one to account for w if "use_cv_w=true". A fix could be that one probably either has to make _combine_be_cv7ccv2.exe dependent on this switch or add sth. similar like ".OR. cloud_cv_options >= 2" to selected if-statements on "use_cv_w" in _da_setup_beregional.inc

weiwangncar commented 1 year ago

@liujake In case you don't receive notification for this.