爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6723|回复: 3

混合同化中,三维变分如何与etkf连接起来呢?

[复制链接]
发表于 2022-6-6 17:49:56 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
最近正在学习集合同化、混合同化相关内容,想请教一下做同化的各位前辈。按照用户手册当中,三维集合变分是使用集合平均作为背景场,如果要继续做循环同化的话,应该怎么更新集合呢?
参考了一些文献,看起来是和ETKF有关的,应该怎么把二者结合起来呢?
谢谢

密码修改失败请联系微信:mofangbao
发表于 2022-11-21 18:54:00 | 显示全部楼层
同问RANDOMCV怎么生成集合
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-1-10 19:23:36 | 显示全部楼层
jiangzaihua 发表于 2022-11-21 18:54
同问RANDOMCV怎么生成集合

我印象中直接设置随机噪音数量,就可以生成集合了呀
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2025-1-8 20:56:03 | 显示全部楼层
请教楼主有没有解决呀,我是直接按照用户手册的下一章节ETKF那部分做的,只处理d01代码片段如下,但是过滤观测数据的那一步总是出问题(./gen_be_etkf.exe计算出的特征值有负值,导致膨胀因子和最终的扰动是空值),如果楼主或小伙伴有运行成功的经验,万望赐教!感谢!
cp -r ${WORK_DIR}/${totaltimen}/${domainn}/wrfvar_output ${DAT_DIR}/updatemeanmebs/${totaltimen}/wrfinput_${domainn}_hybrid.nc
############# 4f. 如果处理d01,则进行wrfbdy_d01资料同化 #############
if [ "$domain" = "d01" ]; then
  for n in $(seq 1 ${mebnum})
  do
    formatted_n=$(printf "%03d" $n)
    ln -fs ${WRFDA_DIR}/var/build/da_update_bc.exe .
    cp -r ${DEST_DIR}/${totaltimen}/wrfbdy_d01.e${formatted_n} ./wrfbdy_d01
    cp -r ${WORK_DIR}/${totaltimen}/${domainn}/wrfvar_output wrfinput_${domainn}
    cp -r ${DAT_DIR}/nl/${totaltimen}/parame.in ./parame.in
    ulimit -s unlimited
    ## 20240603modify
    #yhrun -N $SLURM_NNODES -n $SLURM_NTASKS
    ./da_update_bc.exe >&step5_da_update_bc_${domainn}.log
    if tail -n 1 "${WORK_DIR}/${totaltimen}/${domainn}/step5_da_update_bc_${domainn}.log" | grep -q "successfully"; then
      echo "line 157 - Place2 - There is a 'successfully' in rsl file, continuing..."
      echo "${totaltimen}${domainn}"
    else
      echo "line 160 - Place2 - My error: There is no 'successfully' exist in rsl_${domainn} file!"
      echo "${totaltimen}${domainn}"
      exit 1  # 或者处理错误的其他方式
    fi
    ############# 4g. 修改的wrfbdy_d01和mean拷贝 #########################
    cp -r ${WORK_DIR}/${totaltimen}/${domainn}/wrfbdy_d01 ${DAT_DIR}/updatemeanmebs/${totaltimen}/wrfbdy_d01.e${formatted_n}
  done
fi
############# [Step Two. ETKF通过扰动和新mean更新集合成员] ############
############# 1. Running ETKF System ################################
mkdir -p ${WORK_DIR}/${totaltimen}/${domainn}/obs_filter
cd ${WORK_DIR}/${totaltimen}/${domainn}/obs_filter
# 20241222 RM added for be.vertloc error
cp -r ${WORK_DIR}/${totaltimen}/${domainn}/be.vertloc.dat ${WORK_DIR}/${totaltimen}/${domainn}/obs_filter
## 20240603modify2 取消了#
# cp -r ${WORK_DIR}/${totaltimen}/${domainn}/ep ${WORK_DIR}/${totaltimen}/${domainn}/obs_filter/ep
# rm -rf ./fg
## 20240721这里就是用first guess 修正观测!
cp -r ${WORK_DIR}/${totaltimen}/${domainn}/wrfout_${domainn}_2021-05-14_${hourtimen}:00:00.mean ./fg
ln -fs ${WRFDA_DIR}/run/LANDUSE.TBL .
ln -fs ${DAT_DIR}/ob/${totaltimen}/ob.ascii ./ob.ascii
ln -fs ${DAT_DIR}/ob/${totaltimen}/ob.radar ./ob.radar
ln -fs ${DAT_DIR}/be/be_${domainn}_monthly.dat ./be.dat
ln -fs ${WRFDA_DIR}/var/build/da_wrfvar.exe .
cp ${DAT_DIR}/ETKF/${totaltimen}/${domainn}/namelist_QC-OBS.input ./namelist.input
# 20241222 RM added for be.vertloc error
cp -r ${WORK_DIR}/${totaltimen}/${domainn}/be.vertloc.dat ${WORK_DIR}/${totaltimen}/${domainn}/obs_filter
cp -r ${WORK_DIR}/${totaltimen}/${domainn}/ep/ ${WORK_DIR}/${totaltimen}/${domainn}/obs_filter/
## 20240603modify
# yhrun -N $SLURM_NNODES -n $SLURM_NTASKS
ulimit -s unlimited
./da_wrfvar.exe  >&step6_ETKF_da_wrfvar_${domainn}.log
# 检查最后一行是否包含"successfully"
if tail -n 1 "${WORK_DIR}/${totaltimen}/${domainn}/obs_filter/rsl.error.0000" | grep -q "successfully"; then
    echo "line 185 - Place3 - There is a 'successfully' in rsl file, continuing..."
    echo "line 186 - ${totaltimen}${domainn}"
    # 在这里添加继续执行的代码
else
    echo "line 189 - Place3 - My error: There is no 'successfully' exist in rsl_d01 file!!!!!!"
    echo "line 190 - ${totaltimen}${domainn}"
    exit 1  # 或者处理错误的其他方式
fi
# 检查输出文件:一个包含过滤的观测结果的 filtered_obs_01 文件。
############# 2. Prepare omb files for ETKF ##########################
for n in $(seq 1 ${mebnum})
do
  cd ${WORK_DIR}/${totaltimen}/${domainn}/
  formatted_n=$(printf "%03d" $n)
  formatted_n_2=$(printf "%02d" $n)
  mkdir -p omb/working.e${formatted_n}
  cd omb/working.e${formatted_n}
  rm -rf ./fg
  ## 20240714 改成用Hybrid出来的接口(?为什么要分集合?)
  cp -r ${DAT_DIR}/fc/${totaltimen}/wrfout_${domainn}_2021-05-14_${hourtimen}:00:00.e${formatted_n} ./wrfout_${domainn}_2021-05-14_${hourtimen}:00:00.e${formatted_n}
  source /home/RumoWang/miniconda3/etc/profile.d/conda.sh
  conda activate py39
  cp -r ${DAT_DIR}/pyLU/changeMMINLUinwrfout.py ${WORK_DIR}/${totaltimen}/${domainn}/omb/working.e${formatted_n}/
  # 定义要修改的文件路径
  file_path="${WORK_DIR}/${totaltimen}/${domainn}/omb/working.e${formatted_n}/changeMMINLUinwrfout.py"
  # 使用sed命令替换文件中的第9行
  replacestr="filename = \"./wrfout_${domainn}_2021-05-14_${hourtimen}:00:00.e${formatted_n}\""
  sed -i "9s|.*|$replacestr|" "$file_path"
  echo "Complete Place4 ${replacestr} replacing"
  python ${WORK_DIR}/${totaltimen}/${domainn}/omb/working.e${formatted_n}/changeMMINLUinwrfout.py
  echo "wrfout wrfinput wrfbdy files have been moved and renamed and Python-modified."      
  cp -r ./wrfout_${domainn}_2021-05-14_${hourtimen}:00:00.e${formatted_n} ./fg
  ln -fs ${WRFDA_DIR}/run/LANDUSE.TBL .
  # 20240722 change for copy ob.ascii 把后面的./ob.ascii改成
  # cp -r ${WORK_DIR}/${totaltimen}/${domainn}/obs_filter/filtered_obs_01 ./ob.ascii
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表