读入的流程

模式在运行时会从run.def中读入运行参数。参数的定义绝大部分存在于LMDZ.COMMON/libf/dyn3d_common/control_mod.F90 之中。而读取参数的程序为。 LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F90

添加读入参数的流程

  1. 在control_mod.F90中加入参数的定义。

    integer,save :: diag_ecin ! added by YZ 22/10/28 for output ecin
    
  2. 在conf_gcm.F90中加入参数的读取,以及相应的默认值,说明和输出

    ! YZ 22/10/28
    !Config  Key  = diag_ecin
    !Config  Desc = output kinetic energy
    !Config  Def  = 0
    !Config  Help = output kinetic energy ecin.nc every diag_ecin dynamical steps
    
      diag_ecin = 0
      CALL getin('diag_ecin',diag_ecin)
    
    !......
    
    write(lunout,*)' diag_ecin = ', diag_ecin !YZ 22/10/28
    
  3. 在想要使用参数的程序中,加入USE control_mod, only: 变量名。如果已经有,那么只需在其后补充即可。

  4. 重新编译。如果报错(提示mod file not generated by any version of the compiler)之类,则需要删除特定mod文件再编译,或者干脆全部删除重新编译。

  5. 运行前在run.def中补充相关参数。

    # output kinetic energy every diag_ecin dynamical steps YZ 22/10/28
      diag_ecin = 240