FAQ: How do you add new variables, both to the CCPP and SCM-"dycore"?

Submitted by grantf on Thu, 09/03/2020 - 08:57

How do you add new variables, both to the CCPP and SCM-”dycore”?

An instructional video exists to answer this question. Please visit this Youtube link: https://youtu.be/58vpLYRpWhw

In addition, see section 6.4 in the SCM User and Technical Guide.

Hi, Grant,

 

These are excellent instructional materials to help adding new variables to CCPP and SCM-"Dycore".

I got one more question, especially about my case to add 5 new physics variables (4 albedo components and 1 emissivity) which are used in the NoahMP LSM and the radiation schemes. My question is how to pass these new variables between the CCPP and SCM-“Dycore”. In other words, how to pass these new variables between the main drivers (*cap* files) and the physics schemes?

What I did is as follows.  I added 5 new variables to *.F90 and *.meta files in the CCPP (gmtb-scm/ccpp/physics/physics/).  Also I added these new variables to “GFS_typedefs.F90” and “GFS_typedefs.meta” in SCM-“Dycore” (gmtb-scm/scm/src/).  For example, “albdvis” was added to “GFS_typedefs.F90”:

real (kind=kind_phys), pointer :: albdvis (:)  => null()  !<

allocate (Sfcprop%albdvis    (IM))

Sfcprop%albdvis    = clear_val

 

And to “GFS_typedefs.meta”:

[albdvis]

  standard_name = surface_albedo_direct_visible

  long_name = direct surface albedo visible band

  units = frac

  dimensions = (horizontal_loop_extent)

  type = real

  kind = kind_phys

  active = (flag_for_land_surface_scheme == flag_for_noahmp_land_surface_scheme)

 

However, after I did ccpp_prebuild (cmake ../src), I got the errors as follows:

ERROR: Variable surface_albedo_dif_nir requested by MODULE_rrtmg_sw_pre SCHEME_rrtmg_sw_pre SUBROUTINE_rrtmg_sw_pre_run & MODULE_noahmpdrv SCHEME_noahmpdrv SUBROUTINE_noahmpdrv_run & MODULE_GFS_rrtmgp_sw_pre SCHEME_GFS_rrtmgp_sw_pre SUBROUTINE_GFS_rrtmgp_sw_pre_run not provided by the model

I checked the main drivers (*cap* files such as the physics driver and the radiation driver) which do not pass these new variables into the physics schemes.  For example, the radiation driver “ccpp_SCM_GFS_v15p2_noahmp_radiation_cap.F90" does not pass new variable “albdvis” into subroutine “rrtmg_sw_run” :

In “ccpp_SCM_GFS_v15p2_noahmp_radiation_cap.F90",

      Call rrtmg_sw_run(plyr=physics%Interstitial%plyr,…, …)

NO “albdvis” appears when it calls.

But in subroutine “rrtmg_sw_pre_run”, “albdvis” is required:

       subroutine rrtmg_sw_pre_run (im, …, albdvis,…)

 

Therefore, the problem is how to modify the SCM-“Dycore” (host model) so that the main drivers (*cap* files, automatically generated) can pass new variables into the physics schemes.

Thank you very much!

 

Weizhong Zheng, NOAA/NCEP/EMC

Permalink

In reply to by Weizhong.Zheng

Sorry, need correction as follows:

For example, the radiation driver “ccpp_SCM_GFS_v15p2_noahmp_radiation_cap.F90" does not pass new variable “albdvis” into subroutine “rrtmg_sw_pre_run” :

In “ccpp_SCM_GFS_v15p2_noahmp_radiation_cap.F90",

       call rrtmg_sw_pre_run (im=physics%Model%blksz(cdata%blk_no), ..., ...)

NO “albdvis” appears when it calls.

But in subroutine “rrtmg_sw_pre_run”, “albdvis” is required:

       subroutine rrtmg_sw_pre_run (im, …, albdvis,…)

 

Weizhong Zheng, NOAA/NCEP/EMC