duplicated subroutines in MPAS radiation RRTMG-SW

Questions about modifying the MPAS-Atmosphere code, and general discussion of MPAS code structure and development
Post Reply
bruceyoung01
Posts: 56
Joined: Mon Sep 10, 2018 6:06 pm

duplicated subroutines in MPAS radiation RRTMG-SW

Post by bruceyoung01 » Wed Nov 21, 2018 2:58 am

I noticed that there are several subroutines duplicated in src/core_atmosphere/physics/mpas_atmphys_rrtmg_swinit.F and src/core_atmosphere/physics/physics_wrf/module_ra_rrtmg_sw.F, such as
sw_kgb16
sw_kgb17
sw_kgb18
sw_kgb19
sw_kgb20
sw_kgb21
sw_kgb22
sw_kgb23
sw_kgb24
sw_kgb25
sw_kgb26
sw_kgb27
sw_kgb28
sw_kgb29

For example,
call sw_kgb16(rrtmg_unit,dminfo)
call sw_kgb17(rrtmg_unit,dminfo)
call sw_kgb18(rrtmg_unit,dminfo)
call sw_kgb19(rrtmg_unit,dminfo)
call sw_kgb20(rrtmg_unit,dminfo)
call sw_kgb21(rrtmg_unit,dminfo)
call sw_kgb22(rrtmg_unit,dminfo)
call sw_kgb23(rrtmg_unit,dminfo)
call sw_kgb24(rrtmg_unit,dminfo)
call sw_kgb25(rrtmg_unit,dminfo)
call sw_kgb26(rrtmg_unit,dminfo)
call sw_kgb27(rrtmg_unit,dminfo)
call sw_kgb28(rrtmg_unit,dminfo)
call sw_kgb29(rrtmg_unit,dminfo)
in mpas_atmphys_rrtmg_swinit.F from line 108 to 121.

Since you wrote this code, do you know why?

Thank you

mgduda
Posts: 458
Joined: Mon Feb 26, 2018 7:35 pm

Re: duplicated subroutines in MPAS radiation RRTMG-SW

Post by mgduda » Wed Nov 21, 2018 5:32 pm

Although I'm a little less familiar with the model physics code, it looks like the reason for duplicating these routines may due to the way that the reading and broadcasting of values to all MPI tasks was handled. The routines (e,g., sw_kgb29) in module_ra_rrtmg_sw.F use routines that are fairly specific to the WRF model for determining which MPI task will read from files and for broadcasting values to all other MPI tasks. As such, we needed to duplicate these routines to implement the distributed-memory aspects in a way that works with MPAS's "mpas_dmpar" module.

There is ongoing effort to unify some physics (including the RRTMG long- and short-wave schemes) between WRF and MPAS, so we can add this to the list of areas to be handled in a more general way that works for both models.
NCAR/MMM

Post Reply

Return to “Code development”