From 3a122a22e957a68843d0a51a418982990dbdf579 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 18 Sep 2024 13:10:18 -0600 Subject: [PATCH 1/3] Add physics/NRL_parse_tracers.F90 as a replacement for GFDL_parse_tracers for NEPTUNE --- physics/NRL_parse_tracers.F90 | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 physics/NRL_parse_tracers.F90 diff --git a/physics/NRL_parse_tracers.F90 b/physics/NRL_parse_tracers.F90 new file mode 100644 index 000000000..2809f875e --- /dev/null +++ b/physics/NRL_parse_tracers.F90 @@ -0,0 +1,76 @@ +! This module is the NRL replacement for the parse_tracers module +! in GFDL_parse_tracers.F90. It translates the tracer names used +! in GFS_typedefs (stemming from the FV3 dycore at GFDL) into +! the correct names used at NRL so that all tracer indices defined +! in GFS_typedefs either retain the original value from NRL (if +! in use) or are correctly set to NO_TRACER (if not in use). +module parse_tracers + + integer, parameter :: NO_TRACER = -99 + + public get_tracer_index, NO_TRACER + +CONTAINS + + function get_tracer_index (tracer_names, gfdl_name, me, master, debug) + + character(len=32), intent(in) :: tracer_names(:) + character(len=*), intent(in) :: gfdl_name + integer, intent(in) :: me + integer, intent(in) :: master + logical, intent(in) :: debug + !--- local variables + character(len=32) :: name + integer :: get_tracer_index + integer :: i + + get_tracer_index = NO_TRACER + + do i=1, size(tracer_names) + select case(trim(gfdl_name)) + ! Should not make it to here, since ntqv is hardcoded to 1 + !case '???' + ! name = 'water_vapor_mixing_ratio' + case ('o3mr') + name = 'ozone_mixing_ratio' + case ('liq_wat') + name = 'cloud_water_mixing_ratio' + case ('ice_wat') + name = 'cloud_ice_mixing_ratio' + case ('rainwat') + name = 'rain_mixing_ratio' + case ('snowwat') + name = 'snow_mixing_ratio' + case ('graupel') + name = 'graupel_mixing_ratio' + case ('ice_nc') + name = 'number_concentration_of_cloud_ic' + case ('rain_nc') + name = 'number_concentration_of_rain' + case ('sgs_tke') + name = 'turbulent_kinetic_energy' + case default + name = trim(gfdl_name) + if (debug .and. (me == master)) then + print *,' PE ',me,' no translation found for tracer with GFDL name '//trim(gfdl_name)//' - use as is' + endif + end select + if (trim(name) == trim(tracer_names(i))) then + get_tracer_index = i + exit + endif + enddo + + if (debug .and. (me == master)) then + if (get_tracer_index == NO_TRACER) then + print *,' PE ',me,' tracer with name '//trim(gfdl_name)//'='//trim(name)//' not found' + else + print *,' PE ',me,' tracer FOUND: '//trim(gfdl_name)//'='//trim(name) + endif + endif + + return + + end function get_tracer_index + +end module parse_tracers From edaa6498e757cd0c1e369d4211bb5cde08f9f912 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 18 Sep 2024 17:20:52 -0600 Subject: [PATCH 2/3] Add missing tracers from NEPTUNE to physics/NRL_parse_tracers.F90 --- physics/NRL_parse_tracers.F90 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/physics/NRL_parse_tracers.F90 b/physics/NRL_parse_tracers.F90 index 2809f875e..9c7a0ba36 100644 --- a/physics/NRL_parse_tracers.F90 +++ b/physics/NRL_parse_tracers.F90 @@ -43,12 +43,26 @@ function get_tracer_index (tracer_names, gfdl_name, me, master, debug) name = 'snow_mixing_ratio' case ('graupel') name = 'graupel_mixing_ratio' + case ('cld_amt') + name = 'cloud_fraction_updated_by_physics' + case ('water_nc') + name = 'number_concentration_of_cloud_droplets' case ('ice_nc') name = 'number_concentration_of_cloud_ic' case ('rain_nc') name = 'number_concentration_of_rain' + case ('snow_nc') + name = 'number_concentration_of_snow' + case ('graupel_nc') + name = 'number_concentration_of_graupel' case ('sgs_tke') name = 'turbulent_kinetic_energy' + case ('liq_aero') + name = 'number_concentration_of_water_friendly_aerosols' + case ('ice_aero') + name = 'number_concentration_of_ice_friendly_aerosols' + case ('q_rimef') + name = 'mass_weighted_rime_factor' case default name = trim(gfdl_name) if (debug .and. (me == master)) then From faee4edcc3c3dd6965321d69530ac500769ff9a6 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 25 Sep 2024 17:19:47 -0600 Subject: [PATCH 3/3] Remove physics/NRL_parse_tracers.F90, physics/MP/GFDL/GFDL_parse_tracers.F90; update CODEOWNERS physics/docs/ccpp_doxyfile --- CODEOWNERS | 1 - physics/MP/GFDL/GFDL_parse_tracers.F90 | 45 ------------- physics/NRL_parse_tracers.F90 | 90 -------------------------- physics/docs/ccpp_doxyfile | 1 - 4 files changed, 137 deletions(-) delete mode 100644 physics/MP/GFDL/GFDL_parse_tracers.F90 delete mode 100644 physics/NRL_parse_tracers.F90 diff --git a/CODEOWNERS b/CODEOWNERS index 99d6697f2..d80e25b09 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -36,7 +36,6 @@ physics/GWD/ugwpv1_gsldrag_post.* @md physics/GWD/unified_ugwp* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales physics/MP/Ferrier_Aligo/module_MP_FER_HIRES.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales physics/MP/Ferrier_Aligo/mp_fer_hires.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/MP/GFDL/GFDL_parse_tracers.F90 @grantfirl @Qingfu-Liu @dustinswales physics/MP/GFDL/gfdl_cloud_microphys.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales physics/MP/GFDL/module_gfdl_cloud_microphys.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales physics/MP/GFDL/fv_sat_adj.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales diff --git a/physics/MP/GFDL/GFDL_parse_tracers.F90 b/physics/MP/GFDL/GFDL_parse_tracers.F90 deleted file mode 100644 index 670c292ee..000000000 --- a/physics/MP/GFDL/GFDL_parse_tracers.F90 +++ /dev/null @@ -1,45 +0,0 @@ -!>\file GFDL_parse_tracers.F90 -!! - -!> This module contains code to parse tracers in GFDL MP -module parse_tracers - - integer, parameter :: NO_TRACER = -99 - - public get_tracer_index, NO_TRACER - -CONTAINS - - function get_tracer_index (tracer_names, name, me, master, debug) - - character(len=32), intent(in) :: tracer_names(:) - character(len=*), intent(in) :: name - integer, intent(in) :: me - integer, intent(in) :: master - logical, intent(in) :: debug - !--- local variables - integer :: get_tracer_index - integer :: i - - get_tracer_index = NO_TRACER - - do i=1, size(tracer_names) - if (trim(name) == trim(tracer_names(i))) then - get_tracer_index = i - exit - endif - enddo - - if (debug .and. (me == master)) then - if (get_tracer_index == NO_TRACER) then - print *,' PE ',me,' tracer with name '//trim(name)//' not found' - else - print *,' PE ',me,' tracer FOUND:',trim(name) - endif - endif - - return - - end function get_tracer_index - -end module parse_tracers diff --git a/physics/NRL_parse_tracers.F90 b/physics/NRL_parse_tracers.F90 deleted file mode 100644 index 9c7a0ba36..000000000 --- a/physics/NRL_parse_tracers.F90 +++ /dev/null @@ -1,90 +0,0 @@ -! This module is the NRL replacement for the parse_tracers module -! in GFDL_parse_tracers.F90. It translates the tracer names used -! in GFS_typedefs (stemming from the FV3 dycore at GFDL) into -! the correct names used at NRL so that all tracer indices defined -! in GFS_typedefs either retain the original value from NRL (if -! in use) or are correctly set to NO_TRACER (if not in use). -module parse_tracers - - integer, parameter :: NO_TRACER = -99 - - public get_tracer_index, NO_TRACER - -CONTAINS - - function get_tracer_index (tracer_names, gfdl_name, me, master, debug) - - character(len=32), intent(in) :: tracer_names(:) - character(len=*), intent(in) :: gfdl_name - integer, intent(in) :: me - integer, intent(in) :: master - logical, intent(in) :: debug - !--- local variables - character(len=32) :: name - integer :: get_tracer_index - integer :: i - - get_tracer_index = NO_TRACER - - do i=1, size(tracer_names) - select case(trim(gfdl_name)) - ! Should not make it to here, since ntqv is hardcoded to 1 - !case '???' - ! name = 'water_vapor_mixing_ratio' - case ('o3mr') - name = 'ozone_mixing_ratio' - case ('liq_wat') - name = 'cloud_water_mixing_ratio' - case ('ice_wat') - name = 'cloud_ice_mixing_ratio' - case ('rainwat') - name = 'rain_mixing_ratio' - case ('snowwat') - name = 'snow_mixing_ratio' - case ('graupel') - name = 'graupel_mixing_ratio' - case ('cld_amt') - name = 'cloud_fraction_updated_by_physics' - case ('water_nc') - name = 'number_concentration_of_cloud_droplets' - case ('ice_nc') - name = 'number_concentration_of_cloud_ic' - case ('rain_nc') - name = 'number_concentration_of_rain' - case ('snow_nc') - name = 'number_concentration_of_snow' - case ('graupel_nc') - name = 'number_concentration_of_graupel' - case ('sgs_tke') - name = 'turbulent_kinetic_energy' - case ('liq_aero') - name = 'number_concentration_of_water_friendly_aerosols' - case ('ice_aero') - name = 'number_concentration_of_ice_friendly_aerosols' - case ('q_rimef') - name = 'mass_weighted_rime_factor' - case default - name = trim(gfdl_name) - if (debug .and. (me == master)) then - print *,' PE ',me,' no translation found for tracer with GFDL name '//trim(gfdl_name)//' - use as is' - endif - end select - if (trim(name) == trim(tracer_names(i))) then - get_tracer_index = i - exit - endif - enddo - - if (debug .and. (me == master)) then - if (get_tracer_index == NO_TRACER) then - print *,' PE ',me,' tracer with name '//trim(gfdl_name)//'='//trim(name)//' not found' - else - print *,' PE ',me,' tracer FOUND: '//trim(gfdl_name)//'='//trim(name) - endif - endif - - return - - end function get_tracer_index - -end module parse_tracers diff --git a/physics/docs/ccpp_doxyfile b/physics/docs/ccpp_doxyfile index 7e40361ae..4f62402e6 100644 --- a/physics/docs/ccpp_doxyfile +++ b/physics/docs/ccpp_doxyfile @@ -1066,7 +1066,6 @@ EXCLUDE = ../Radiation/RRTMGP/rte-rrtmgp \ ../MP/Ferrier_Aligo \ ../MP/Zhao_Carr \ ../PBL/MYJ \ - ../MP/GFDL/GFDL_parse_tracers.F90 \ ../PBL/HEDMF \ ../PBL/SHOC \ ../PBL/saYSU \