Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

duplicated subroutines in MPAS radiation RRTMG-SW

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

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
 
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.
 
Top