RQL's Blog 菜鸟成长记

cesm 2016 tutorial课件

2018-03-22
renql

Lecture 1 Introduction to the Community Earth System Model

differential equations that describe fluid motion, radiative transfer, chemical composition, etc.

Sub-gridscale processes are parameterized.

大气的forings:greenhouse gases, manmade(人为的)aerosols, volcanic eruptions, solar variability, land-use change

在相同条件下模拟多次的结果都存在差别,其集合平均也和观测不同,存在内部的不确定性变化(P12有一张集合平均与观测比较的表面温度分布图)

此外介绍了CESM中包含的Carbon cycle,processes in land model, surface energy fluxes, hydrology, biogeochemical cycles.

是否初始化以及从哪一年开始初始化均会影响模拟结果。P23

Lecture 2 physics in the CAM

主要介绍了次网格的物理过程及参数化,包括clouds, radiation, boundary layers, surface fluxes and gravity waves, moist processes(deep convection, shallow convection, large-scale condensation)

saturation 饱和,microphysics 微观物理学,advection 平流,condensate 凝结,conditional instability 条件不稳定,inhibition 抑制,turbulent kinetic energy 湍流动能

云的模拟是很难的,因为它设计多尺度、相态多变、还于气溶胶成分数量有关,具有很多不确定性。
此外,云是与辐射相互作用的,而辐射过程也很难模拟,也很多不确定性,受很多因素影响,如气体成分、云量、凝结潜热

未来的参数化方案希望可以自动识别不同尺度物理现象并不受模式网格精度影响。

Lecture 3 Dynamics in CAM

undulations 起伏不定、波动,be borne in mind 牢记在心,terrain 地形,compressible 可压缩的

模式中的垂直坐标是混合坐标,即下层为sigma坐标,上层为气压坐标

还有一种垂直坐标:Lagrangian (floating) vertical coordinate,用这种坐标时垂直混合作用消失,变为’stacked shallow-water models’

Application 2 Interpreting Model Results

介绍了CESM的几种常用用途(以下均是Free-running coupled climate models):

  • 用于CMIP
  • Control simulations (1000+ years),固定radiative foring,在气候条件不变的情况下研究模式内部变率的影响
  • Historical simulations (generally 1850-2005),prescribed evolution of radiative forcing (GHG, aerosols, volcanoes, solar irradiance, stratospheric ozone)
  • Projections (present-2100),RCP2.5,RCP4.5,RCP8.5 radiative forcing scenarios

Constrained model simulations 常用于假设检验、物理机制解释

Practical 3 Intro Diagnostics and Output

介绍了netCDF自带的处理nc数据文件的命令,NCO(netCDF operators)
NCO 4.7.4-alpha04 User Guide

The NCO’s recognize missing data by the _FillValue attribute. (missing_value is ignored.

ncdump -h slp.nc                # view the	header of a netCDF file
ncdump –v slp slp.nc | less    # view	the contents of a variable

ncra file1.nc file2.nc avgfile.nc   # record averager,第三个文件是前两个文件的平均,前两个文件的时间不同
ncrcat file1.nc file2.nc out12.nc   # record concatenator,最后一个文件是将前面所有文件按时间顺序连接起来
ncea amip_r01.nc amip_r02.nc amip_r03.nc amip_ENS.nc   # ensemble averager,求前几个数据文件的集合平均
ncdiff amip_r01.nc amip_r02.nc diff.nc     #  differencer,求前几个数据文件之差

ncatted –a units,lat,c,c,”degrees_north” in.nc  # attribute editor
# Add a units attribute to the lat variable called degrees_north in file in.nc

ncrename –v TREFHT,TAS -a missing_value,_FillValue in.nc  # rename variables, dimensions, aeributes
# Rename the variable TREFHT to TAS, and rename all missing_value attributes to _FillValue in file in.nc

ncks –v TEMP,date,OMEGA f40_test.pop.h.1993-11.nc f40_test.TEMP.199311.nc   # Combines various netCDF utlites that allow one to cut and paste subsets of data into a new file.
# 此处将第一个nc文件中的TEMP,date,OMEGA变量及其相关的坐标变量写入第二个nc文件中

NCO 外,还提到了 CDO(Climate Data Operators)
Within the CDO library there are over 600 command line operators that do a variety of tasks including: detrending, EOF analysis, meta data modificaFon, staFsFcal analysis and similar calculaFons.

接着介绍了一些绘图和处理图片的小软件:

  • ncview:只需一句代码即可快速画图查看nc文件中的变量
  • ImageMagick:通过一句命令可以查看图片,也可以转换图片格式,也可以将几张图片连成动画,也可以比较两张图片的差异

此外,发现NCAR有一套诊断函数包,可以快速画出一系列图片以检查模式结果,
然而我无法下载该函数包,好像需要注册才可以下载,然而我找不到注册页面。so sad
http://www.cesm.ucar.edu/models/cesm1.1/model_diagnostics/

Practical 4 Intro Namelist and Code Modifications

  1. 介绍了何时可以修改namelist以及在哪里可以找到namelist的介绍

  2. 修改输出数据文件的频率以及设定输出的数据变量
    默认情况下,CESM输出月平均数据,并输出所有物理变量
    • nhtfrq:修改输出文件的频率,-24代表输出日平均
    • fincl:设定输出的物理变量,介绍物理变量名称网址, 变量后跟”:”以及一个字母以设定该物理变量是瞬时值I,平均值A,最大值X,最小值M,例如”PRECC:M”,一般每一个变量都要设定,但也可通过namelist avgflag_pertape设定所有变量的输出形式
    • mfilt:设定一个文件中可以有的最大时间样本
      最多可以输出6种不同频率、不同物理变量的数据文件,文件名带有h0,h1,h2,h3,h4,h5,对应fincl1,fincl2,fincl3,fincl4,fincl5,fincl6,频率设置nhtfrq(1:6),输出形式avgflag_pertape(1:6),
      其中h0默认输出月平均数据,包含AMWG诊断包所需的所有变量,最好不要修改
      注意:不同模块其设定输出频率、输出变量等的namelist是不同的
  3. 源代码修改
    build前修改,千万不要在CESM源目录下修改,可先把要修改的代码文件复制到自己case的SourceMods文件夹中,然后在这里修改,最好将自己修改的部分用注释符号框起来并命名,方便寻找
    在一堆数据文件中搜索关键字的方法 grep -ir PRECL

一些模式内部的函数介绍:

subroutine addfld (fname, units, numlev, avgflag, &
	long_name, decomp_type, [optional arguments])  
!fname 是需要输入的物理变量名称,units单位,numlev垂直层数,long_name物理变量的全称
!decomp_type 分解类型,有phys_decomp或者dyn_decomp

subroutine add_default (fname, tindex, avgflag)
!将物理变量fname加入默认输出的变量场中,tindex指history tape index

subroutine outfld (fname, field, idim, c)
!将变量输出的函数,field是存有物理变量数据的矩阵,idim指经度坐标pcols,c指纬度坐标lchnk

支持 支付宝鼓励 鸡腿鸡腿

喜欢此文!

Content