diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.F90 similarity index 99% rename from physics/GFS_DCNV_generic.f90 rename to physics/GFS_DCNV_generic.F90 index 318d6e9d4..c9d292dcd 100644 --- a/physics/GFS_DCNV_generic.f90 +++ b/physics/GFS_DCNV_generic.F90 @@ -1,4 +1,4 @@ -!> \file GFS_DCNV_generic.f90 +!> \file GFS_DCNV_generic.F90 !! Contains code related to deep convective schemes to be used within the GFS physics suite. module GFS_DCNV_generic_pre diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 6ab355826..a671f97f7 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -111,7 +111,7 @@ end subroutine GFS_MP_generic_post_init !! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | !! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | in | F | -!! | rain1 | lwe_thickness_of_stratiform_precipitation_amount | stratiform rainfall amount on physics timestep | m | 1 | real | kind_phys | in | F | +!! | rain1 | lwe_thickness_of_explicit_precipitation_amount | explicit rainfall amount on physics timestep | m | 1 | real | kind_phys | in | F | !! | rann | random_number_array | random number array (0-1) | none | 2 | real | kind_phys | in | F | !! | xlat | latitude | latitude | radians | 1 | real | kind_phys | in | F | !! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | @@ -122,14 +122,14 @@ end subroutine GFS_MP_generic_post_init !! | prsi | air_pressure_at_interface | pressure at layer interface | Pa | 2 | real | kind_phys | in | F | !! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | !! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | ice | lwe_thickness_of_ice_amount_on_dynamics_timestep | ice fall at this time step | m | 1 | real | kind_phys | in | F | -!! | snow | lwe_thickness_of_snow_amount_on_dynamics_timestep | snow fall at this time step | m | 1 | real | kind_phys | in | F | -!! | graupel | lwe_thickness_of_graupel_amount_on_dynamics_timestep | graupel fall at this time step | m | 1 | real | kind_phys | in | F | +!! | ice | lwe_thickness_of_ice_amount_on_dynamics_timestep | ice fall at this time step | m | 1 | real | kind_phys | inout | F | +!! | snow | lwe_thickness_of_snow_amount_on_dynamics_timestep | snow fall at this time step | m | 1 | real | kind_phys | inout | F | +!! | graupel | lwe_thickness_of_graupel_amount_on_dynamics_timestep | graupel fall at this time step | m | 1 | real | kind_phys | inout | F | !! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | !! | save_qv | water_vapor_specific_humidity_save | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | ice0 | lwe_thickness_of_ice_amount_per_day | ice fall over 24h period | mm | 1 | real | kind_phys | in | F | -!! | snow0 | lwe_thickness_of_snow_amount_per_day | snow fall over 24h period | mm | 1 | real | kind_phys | in | F | -!! | graupel0 | lwe_thickness_of_graupel_amount_per_day | graupel fall over 24h period | mm | 1 | real | kind_phys | in | F | +!! | ice0 | lwe_thickness_of_ice_amount | ice fall on physics timestep | m | 1 | real | kind_phys | in | F | +!! | snow0 | lwe_thickness_of_snow_amount | snow fall on physics timestep | m | 1 | real | kind_phys | in | F | +!! | graupel0 | lwe_thickness_of_graupel_amount | graupel fall on physics timestep | m | 1 | real | kind_phys | in | F | !! | del | air_pressure_difference_between_midlayers | air pressure difference between midlayers | Pa | 2 | real | kind_phys | in | F | !! | rain | lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total rain at this time step | m | 1 | real | kind_phys | inout | F | !! | domr_diag | dominant_rain_type | dominant rain type | none | 1 | real | kind_phys | inout | F | @@ -168,13 +168,14 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt integer, intent(in) :: im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl logical, intent(in) :: cal_pre, lssav, ldiag3d, cplflx, cplchm - real(kind=kind_phys), intent(in) :: dtf, frain, con_g - real(kind=kind_phys), dimension(im), intent(in) :: rainc, rain1, xlat, xlon, tsfc, ice, snow, graupel, & - ice0, snow0, graupel0 - real(kind=kind_phys), dimension(ix,nrcm), intent(in) :: rann - real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, gq0_water_vapor, prsl, save_t, save_qv, del - real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii - real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 + real(kind=kind_phys), intent(in) :: dtf, frain, con_g + real(kind=kind_phys), dimension(im), intent(in) :: rainc, rain1, xlat, xlon, tsfc + real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel + real(kind=kind_phys), dimension(im), intent(in) :: ice0, snow0, graupel0 + real(kind=kind_phys), dimension(ix,nrcm), intent(in) :: rann + real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, gq0_water_vapor, prsl, save_t, save_qv, del + real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii + real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & @@ -200,6 +201,21 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt rain(i) = rainc(i) + frain * rain1(i) enddo + ! DH* TODO - Fix wrong code in non-CCPP build (GFS_physics_driver) + ! and use commented lines here (keep wrong version for bit-for-bit): + ! put ice, snow, graupel on dynamics timestep. The way the code in + ! GFS_physics_driver is written, Diag%{graupel,ice,snow} are on the + ! physics timestep, while Diag%{rain,rainc} and all totprecip etc + ! are on the dynamics timestep. Totally confusing and wrong. *DH + if (imp_physics == imp_physics_gfdl) then + !graupel = frain*graupel0 + !ice = frain*ice0 + !snow = frain*snow0 + graupel = graupel0 + ice = ice0 + snow = snow0 + end if + if (cal_pre) then ! hchuang: add dominant precipitation type algorithm ! call calpreciptype (kdt, nrcm, im, ix, levs, levs+1, & diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.F90 similarity index 99% rename from physics/GFS_PBL_generic.f90 rename to physics/GFS_PBL_generic.F90 index 3c8a79b67..198c4c843 100644 --- a/physics/GFS_PBL_generic.f90 +++ b/physics/GFS_PBL_generic.F90 @@ -1,4 +1,4 @@ -!> \file GFS_PBL_generic.f90 +!> \file GFS_PBL_generic.F90 !! Contains code related to PBL schemes to be used within the GFS physics suite. module GFS_PBL_generic_pre diff --git a/physics/GFS_SCNV_generic.f90 b/physics/GFS_SCNV_generic.F90 similarity index 99% rename from physics/GFS_SCNV_generic.f90 rename to physics/GFS_SCNV_generic.F90 index cb03a09d1..9a6076671 100644 --- a/physics/GFS_SCNV_generic.f90 +++ b/physics/GFS_SCNV_generic.F90 @@ -1,4 +1,4 @@ -!> \file GFS_SCNV_generic.f90 +!> \file GFS_SCNV_generic.F90 !! Contains code related to shallow convective schemes to be used within the GFS physics suite. module GFS_SCNV_generic_pre diff --git a/physics/GFS_phys_time_vary.fv3.f90 b/physics/GFS_phys_time_vary.fv3.F90 similarity index 99% rename from physics/GFS_phys_time_vary.fv3.f90 rename to physics/GFS_phys_time_vary.fv3.F90 index aa38ed4ef..f2153a1e0 100644 --- a/physics/GFS_phys_time_vary.fv3.f90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -1,4 +1,4 @@ -!> \file GFS_phys_time_vary.f90 +!> \file GFS_phys_time_vary.F90 !! Contains code related to GFS physics suite setup (physics part of time_vary_step) module GFS_phys_time_vary diff --git a/physics/GFS_phys_time_vary.scm.f90 b/physics/GFS_phys_time_vary.scm.F90 similarity index 99% rename from physics/GFS_phys_time_vary.scm.f90 rename to physics/GFS_phys_time_vary.scm.F90 index 22d85096b..303054911 100644 --- a/physics/GFS_phys_time_vary.scm.f90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -1,4 +1,4 @@ -!> \file GFS_phys_time_vary.f90 +!> \file GFS_phys_time_vary.F90 !! Contains code related to GFS physics suite setup (physics part of time_vary_step) module GFS_phys_time_vary diff --git a/physics/GFS_rad_time_vary.fv3.f90 b/physics/GFS_rad_time_vary.fv3.F90 similarity index 99% rename from physics/GFS_rad_time_vary.fv3.f90 rename to physics/GFS_rad_time_vary.fv3.F90 index 0c3d42c22..e13585434 100644 --- a/physics/GFS_rad_time_vary.fv3.f90 +++ b/physics/GFS_rad_time_vary.fv3.F90 @@ -1,4 +1,4 @@ -!>\file GFS_rad_time_vary.f90 +!>\file GFS_rad_time_vary.F90 !! Contains code related to GFS physics suite setup (radiation part of time_vary_step) module GFS_rad_time_vary diff --git a/physics/GFS_rad_time_vary.scm.f90 b/physics/GFS_rad_time_vary.scm.F90 similarity index 99% rename from physics/GFS_rad_time_vary.scm.f90 rename to physics/GFS_rad_time_vary.scm.F90 index 7a23a9ad3..c22969b21 100644 --- a/physics/GFS_rad_time_vary.scm.f90 +++ b/physics/GFS_rad_time_vary.scm.F90 @@ -1,4 +1,4 @@ -!>\file GFS_rad_time_vary.f90 +!>\file GFS_rad_time_vary.F90 !! Contains code related to GFS physics suite setup (radiation part of time_vary_step) module GFS_rad_time_vary diff --git a/physics/GFS_surface_generic.f90 b/physics/GFS_surface_generic.F90 similarity index 99% rename from physics/GFS_surface_generic.f90 rename to physics/GFS_surface_generic.F90 index 89722a2a2..f57c9bd39 100644 --- a/physics/GFS_surface_generic.f90 +++ b/physics/GFS_surface_generic.F90 @@ -1,4 +1,4 @@ -!> \file GFS_surface_generic.f90 +!> \file GFS_surface_generic.F90 !! Contains code related to all GFS surface schemes. module GFS_surface_generic_pre diff --git a/physics/GFS_time_vary_pre.fv3.f90 b/physics/GFS_time_vary_pre.fv3.F90 similarity index 99% rename from physics/GFS_time_vary_pre.fv3.f90 rename to physics/GFS_time_vary_pre.fv3.F90 index d0c604879..2f9c00ab1 100644 --- a/physics/GFS_time_vary_pre.fv3.f90 +++ b/physics/GFS_time_vary_pre.fv3.F90 @@ -1,4 +1,4 @@ -!> \file GFS_time_vary_pre.f90 +!> \file GFS_time_vary_pre.F90 !! Contains code related to GFS physics suite setup (generic part of time_vary_step) module GFS_time_vary_pre diff --git a/physics/GFS_time_vary_pre.scm.f90 b/physics/GFS_time_vary_pre.scm.F90 similarity index 99% rename from physics/GFS_time_vary_pre.scm.f90 rename to physics/GFS_time_vary_pre.scm.F90 index 0dd025b7c..992cde0af 100644 --- a/physics/GFS_time_vary_pre.scm.f90 +++ b/physics/GFS_time_vary_pre.scm.F90 @@ -1,4 +1,4 @@ -!> \file GFS_time_vary_pre.f90 +!> \file GFS_time_vary_pre.F90 !! Contains code related to GFS physics suite setup (generic part of time_vary_step) module GFS_time_vary_pre diff --git a/physics/get_prs_fv3.f90 b/physics/get_prs_fv3.F90 similarity index 100% rename from physics/get_prs_fv3.f90 rename to physics/get_prs_fv3.F90 diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 9061604c9..7ca7a1bfc 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -46,8 +46,6 @@ module gfdl_cloud_microphys public gfdl_cloud_microphys_run, gfdl_cloud_microphys_init, gfdl_cloud_microphys_finalize - logical :: is_initialized = .false. - real :: missing_value = - 1.e10 character (len = 17) :: mod_name = 'gfdl_cloud_microphys' @@ -368,8 +366,6 @@ subroutine gfdl_cloud_microphys_init (me, master, nlunit, input_nml_file, loguni errmsg = '' errflg = 0 - if (is_initialized) return - if (imp_physics/=imp_physics_gfdl) then write(errmsg,'(*(a))') 'Namelist option for microphysics does not match choice in suite definition file' errflg = 1 @@ -412,8 +408,6 @@ subroutine gfdl_cloud_microphys_init (me, master, nlunit, input_nml_file, loguni tice0 = tice - 0.01 t_wfr = tice - 40.0 ! supercooled water can exist down to - 48 c, which is the "absolute" - is_initialized = .true. - end subroutine gfdl_cloud_microphys_init ! ======================================================================= @@ -439,8 +433,6 @@ subroutine gfdl_cloud_microphys_finalize(errmsg, errflg) errmsg = '' errflg = 0 - if (.not.is_initialized) return - if (allocated(table)) deallocate (table) if (allocated(table2)) deallocate (table2) if (allocated(table3)) deallocate (table3) @@ -450,50 +442,50 @@ subroutine gfdl_cloud_microphys_finalize(errmsg, errflg) if (allocated(des3)) deallocate (des3) if (allocated(desw)) deallocate (desw) - is_initialized = .false. - end subroutine gfdl_cloud_microphys_finalize !>@brief The subroutine 'gfdl_cloud_microphys_run' executes the full GFDL cloud microphysics. !! \section arg_table_gfdl_cloud_microphys_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent| optional | -!! |------------------|------------------------------------------------------------|--------------------------------------------------------|------------|------|-----------|-----------|-------|----------| -!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | frland | land_area_fraction | land area fraction | frac | 1 | real | kind_phys | in | F | -!! | garea | cell_area | area of grid cell | m2 | 1 | real | kind_phys | in | F | -!! | gq0 | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntcw | cloud_condensed_water_mixing_ratio_updated_by_physics | cloud condensed water mixing ratio updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntrw | rain_water_mixing_ratio_updated_by_physics | moist mixing ratio of rain updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntiw | ice_water_mixing_ratio_updated_by_physics | moist mixing ratio of cloud ice updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntsw | snow_water_mixing_ratio_updated_by_physics | moist mixing ratio of snow updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntgl | graupel_mixing_ratio_updated_by_physics | moist mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntclamt | cloud_fraction_updated_by_physics | cloud fraction updated by physics | frac | 2 | real | kind_phys | inout | F | -!! | gt0 | air_temperature_updated_by_physics | air temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | vvl | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | air pressure difference between mid-layers | Pa | 2 | real | kind_phys | in | F | -!! | rain0 | lwe_thickness_of_stratiform_precipitation_amount_per_day | stratiform rain over 24h period | mm | 1 | real | kind_phys | inout | F | -!! | ice0 | lwe_thickness_of_ice_amount_per_day | ice fall over 24h period | mm | 1 | real | kind_phys | inout | F | -!! | snow0 | lwe_thickness_of_snow_amount_per_day | snow fall over 24h period | mm | 1 | real | kind_phys | inout | F | -!! | graupel0 | lwe_thickness_of_graupel_amount_per_day | graupel fall over 24h period | mm | 1 | real | kind_phys | inout | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | hydrostatic | flag_for_hydrostatic_solver | flag indicating hydrostatic solver | flag | 0 | logical | | in | F | -!! | phys_hydrostatic | flag_for_hydrostatic_heating_from_physics | flag indicating hydrostatic heating from physics | flag | 0 | logical | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! | local_name | standard_name | long_name | units | rank | type | kind | intent| optional | +!! |------------------|------------------------------------------------------------|-----------------------------------------------------------------------|------------|------|-----------|-----------|-------|----------| +!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | frland | land_area_fraction | land area fraction | frac | 1 | real | kind_phys | in | F | +!! | garea | cell_area | area of grid cell | m2 | 1 | real | kind_phys | in | F | +!! | gq0 | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ntcw | cloud_condensed_water_mixing_ratio_updated_by_physics | cloud condensed water mixing ratio updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ntrw | rain_water_mixing_ratio_updated_by_physics | moist mixing ratio of rain updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ntiw | ice_water_mixing_ratio_updated_by_physics | moist mixing ratio of cloud ice updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ntsw | snow_water_mixing_ratio_updated_by_physics | moist mixing ratio of snow updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ntgl | graupel_mixing_ratio_updated_by_physics | moist mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ntclamt | cloud_fraction_updated_by_physics | cloud fraction updated by physics | frac | 2 | real | kind_phys | inout | F | +!! | gt0 | air_temperature_updated_by_physics | air temperature updated by physics | K | 2 | real | kind_phys | inout | F | +!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | +!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | +!! | vvl | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | air pressure difference between mid-layers | Pa | 2 | real | kind_phys | in | F | +!! | rain0 | lwe_thickness_of_explicit_rain_amount | explicit rain on physics timestep | m | 1 | real | kind_phys | out | F | +!! | ice0 | lwe_thickness_of_ice_amount | ice fall on physics timestep | m | 1 | real | kind_phys | out | F | +!! | snow0 | lwe_thickness_of_snow_amount | snow fall on physics timestep | m | 1 | real | kind_phys | out | F | +!! | graupel0 | lwe_thickness_of_graupel_amount | graupel fall on physics timestep | m | 1 | real | kind_phys | out | F | +!! | prcp0 | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel) on physics timestep | m | 1 | real | kind_phys | out | F | +!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | out | F | +!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | +!! | hydrostatic | flag_for_hydrostatic_solver | flag indicating hydrostatic solver | flag | 0 | logical | | in | F | +!! | phys_hydrostatic | flag_for_hydrostatic_heating_from_physics | flag indicating hydrostatic heating from physics | flag | 0 | logical | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! subroutine gfdl_cloud_microphys_run( & levs, im, con_g, con_fvirt, con_rd, frland, garea, & gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, gq0_ntsw, gq0_ntgl, gq0_ntclamt, & gt0, gu0, gv0, vvl, prsl, phii, del, & - rain0, ice0, snow0, graupel0, & + rain0, ice0, snow0, graupel0, prcp0, sr, & dtp, hydrostatic, phys_hydrostatic, errmsg, errflg) implicit none @@ -508,11 +500,13 @@ subroutine gfdl_cloud_microphys_run( & real(kind=kind_phys), intent(in ), dimension(1:im,1:levs) :: vvl, prsl, del real(kind=kind_phys), intent(in ), dimension(1:im,1:levs+1) :: phii - ! rain/snow/graupel fall amounts and fraction of frozen precip - real(kind_phys), intent(inout), dimension(1:im) :: rain0 - real(kind_phys), intent(inout), dimension(1:im) :: snow0 - real(kind_phys), intent(inout), dimension(1:im) :: ice0 - real(kind_phys), intent(inout), dimension(1:im) :: graupel0 + ! rain/snow/ice/graupel/precip amounts, fraction of frozen precip + real(kind_phys), intent(out ), dimension(1:im) :: rain0 + real(kind_phys), intent(out ), dimension(1:im) :: snow0 + real(kind_phys), intent(out ), dimension(1:im) :: ice0 + real(kind_phys), intent(out ), dimension(1:im) :: graupel0 + real(kind_phys), intent(out ), dimension(1:im) :: prcp0 + real(kind_phys), intent(out ), dimension(1:im) :: sr real(kind_phys), intent(in) :: dtp !< physics time step logical, intent (in) :: hydrostatic, phys_hydrostatic @@ -523,7 +517,6 @@ subroutine gfdl_cloud_microphys_run( & ! local variables integer :: iis, iie, jjs, jje, kks, kke, kbot, ktop integer :: i, k, kk - !real(kind=kind_phys), dimension(1:im) :: rain0, snow0, ice0, graupel0 real(kind=kind_phys), dimension(1:im,1:levs) :: delp, dz, uin, vin, pt, qv1, ql1, qr1, qg1, qa1, qn1, qi1, & qs1, pt_dt, qa_dt, u_dt, v_dt, w, qv_dt, ql_dt, qr_dt, qi_dt, & qs_dt, qg_dt @@ -534,13 +527,6 @@ subroutine gfdl_cloud_microphys_run( & errmsg = '' errflg = 0 - ! Check initialization state - if (.not.is_initialized) then - write(errmsg, fmt='((a))') 'gfdl_cloud_microphys_run called before gfdl_cloud_microphys_init' - errflg = 1 - return - end if - iis = 1 iie = im jjs = 1 @@ -585,6 +571,12 @@ subroutine gfdl_cloud_microphys_run( & enddo enddo + ! reset precipitation amounts to zero + rain0 = 0 + ice0 = 0 + snow0 = 0 + graupel0 = 0 + call gfdl_cloud_microphys_work(iis, iie, jjs, jje, kks, kke, ktop, kbot, & qv1, ql1, qr1, qi1, qs1, qg1, qa1, qn1, qv_dt, ql_dt, qr_dt, qi_dt, & qs_dt, qg_dt, qa_dt, pt_dt, pt, w, uin, vin, u_dt, v_dt, dz, delp, & @@ -613,6 +605,24 @@ subroutine gfdl_cloud_microphys_run( & endif enddo + ! calculate fraction of frozen precipitation using unscaled + ! values of rain0, ice0, snow0, graupel0 (for bit-for-bit) + do i=1,im + prcp0(i) = (rain0(i)+snow0(i)+ice0(i)+graupel0(i)) * tem + if ( prcp0(i) > rainmin ) then + sr(i) = (snow0(i) + ice0(i) + graupel0(i)) & + / (rain0(i) + snow0(i) + ice0(i) + graupel0(i)) + else + sr(i) = 0.0 + endif + enddo + + ! convert rain0, ice0, snow0, graupel0 from mm per day to m per physics timestep + rain0 = rain0*tem + ice0 = ice0*tem + snow0 = snow0*tem + graupel0 = graupel0*tem + ! flip vertical coordinate back do k = 1, levs kk = levs-k+1 @@ -3793,7 +3803,7 @@ subroutine qsmith_setup integer :: i - if (.not. is_initialized) then + if (.not.allocated(table)) then ! master = (mpp_pe () .eq. mpp_root_pe ()) ! if (master) print *, ' gfdl mp: initializing qs tables' diff --git a/physics/gfdl_cloud_microphys_pre_post.F90 b/physics/gfdl_cloud_microphys_pre_post.F90 deleted file mode 100644 index 2a5a1f4b0..000000000 --- a/physics/gfdl_cloud_microphys_pre_post.F90 +++ /dev/null @@ -1,140 +0,0 @@ -module gfdl_cloud_microphys_pre - - use machine, only : kind_phys - - implicit none - - private - - public gfdl_cloud_microphys_pre_run, gfdl_cloud_microphys_pre_init, gfdl_cloud_microphys_pre_finalize - -contains - - subroutine gfdl_cloud_microphys_pre_init() - end subroutine gfdl_cloud_microphys_pre_init - - subroutine gfdl_cloud_microphys_pre_finalize() - end subroutine gfdl_cloud_microphys_pre_finalize - -!! \section arg_table_gfdl_cloud_microphys_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent| optional | -!! |------------------|------------------------------------------------------------|--------------------------------------------------------|------------|------|-----------|-----------|-------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | rain0 | lwe_thickness_of_stratiform_precipitation_amount_per_day | stratiform rain over 24h period | mm | 1 | real | kind_phys | out | F | -!! | ice0 | lwe_thickness_of_ice_amount_per_day | ice fall over 24h period | mm | 1 | real | kind_phys | out | F | -!! | snow0 | lwe_thickness_of_snow_amount_per_day | snow fall over 24h period | mm | 1 | real | kind_phys | out | F | -!! | graupel0 | lwe_thickness_of_graupel_amount_per_day | graupel fall over 24h period | mm | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine gfdl_cloud_microphys_pre_run(im, rain0, ice0, snow0, graupel0, errmsg, errflg) - - implicit none - - integer, intent(in) :: im - real(kind_phys), dimension(1:im), intent(out) :: rain0 - real(kind_phys), dimension(1:im), intent(out) :: ice0 - real(kind_phys), dimension(1:im), intent(out) :: snow0 - real(kind_phys), dimension(1:im), intent(out) :: graupel0 - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize the CCPP error handling variables - errmsg = '' - errflg = 0 - - rain0 = 0 - ice0 = 0 - snow0 = 0 - graupel0 = 0 - - end subroutine gfdl_cloud_microphys_pre_run - -end module gfdl_cloud_microphys_pre - - -module gfdl_cloud_microphys_post - - use machine, only : kind_phys - - implicit none - - private - - public gfdl_cloud_microphys_post_run, gfdl_cloud_microphys_post_init, gfdl_cloud_microphys_post_finalize - - ! DH* TODO: CLEANUP, all of these should be coming in through the argument list - real(kind=kind_phys), parameter :: con_p001= 0.001d0 - real(kind=kind_phys), parameter :: con_day = 86400.d0 - real(kind=kind_phys), parameter :: rainmin = 1.0e-13 - -contains - - subroutine gfdl_cloud_microphys_post_init() - end subroutine gfdl_cloud_microphys_post_init - - subroutine gfdl_cloud_microphys_post_finalize() - end subroutine gfdl_cloud_microphys_post_finalize - -!! \section arg_table_gfdl_cloud_microphys_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent| optional | -!! |------------------|-----------------------------------------------------------------------|--------------------------------------------------------|------------|------|-----------|-----------|-------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | rain0 | lwe_thickness_of_stratiform_precipitation_amount_per_day | stratiform rain over 24h period | mm | 1 | real | kind_phys | in | F | -!! | ice0 | lwe_thickness_of_ice_amount_per_day | ice fall over 24h period | mm | 1 | real | kind_phys | in | F | -!! | snow0 | lwe_thickness_of_snow_amount_per_day | snow fall over 24h period | mm | 1 | real | kind_phys | in | F | -!! | graupel0 | lwe_thickness_of_graupel_amount_per_day | graupel fall over 24h period | mm | 1 | real | kind_phys | in | F | -!! | rain1 | lwe_thickness_of_precipitation_amount_on_dynamics_timestep | rainfall at this timestep | m | 1 | real | kind_phys | out | F | -!! | ice1 | lwe_thickness_of_ice_amount_on_dynamics_timestep | ice fall at this time step | m | 1 | real | kind_phys | out | F | -!! | snow1 | lwe_thickness_of_snow_amount_on_dynamics_timestep | snow fall at this time step | m | 1 | real | kind_phys | out | F | -!! | graupel1 | lwe_thickness_of_graupel_amount_on_dynamics_timestep | graupel fall at this time step | m | 1 | real | kind_phys | out | F | -!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | out | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine gfdl_cloud_microphys_post_run(im, rain0, ice0, snow0, graupel0, & - rain1, ice1, snow1, graupel1, & - sr, dtp, errmsg, errflg) - - implicit none - - integer, intent(in) :: im - real(kind_phys), dimension(1:im), intent(in) :: rain0 - real(kind_phys), dimension(1:im), intent(in) :: ice0 - real(kind_phys), dimension(1:im), intent(in) :: snow0 - real(kind_phys), dimension(1:im), intent(in) :: graupel0 - real(kind_phys), dimension(1:im), intent(out) :: rain1 - real(kind_phys), dimension(1:im), intent(out) :: ice1 - real(kind_phys), dimension(1:im), intent(out) :: snow1 - real(kind_phys), dimension(1:im), intent(out) :: graupel1 - real(kind_phys), dimension(1:im), intent(out) :: sr - real(kind_phys), intent(in) :: dtp - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - real(kind=kind_phys) :: tem - integer :: i - - ! Initialize the CCPP error handling variables - errmsg = '' - errflg = 0 - - tem = dtp*con_p001/con_day - - do i=1,im - rain1(i) = (rain0(i)+snow0(i)+ice0(i)+graupel0(i)) * tem - ice1(i) = ice0 (i) * tem - snow1(i) = snow0 (i) * tem - graupel1(i) = graupel0(i) * tem - if ( rain1(i) > rainmin ) then - sr(i) = (snow0(i) + ice0(i) + graupel0(i)) & - / (rain0(i) + snow0(i) + ice0(i) + graupel0(i)) - else - sr(i) = 0.0 - endif - enddo - - end subroutine gfdl_cloud_microphys_post_run - -end module gfdl_cloud_microphys_post diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index b50c32802..eec0507a7 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -105,8 +105,6 @@ module fv_sat_adj real :: lv00 !< the same as lv0, except that cp_vap can be cp_vap or cv_vap real, allocatable :: table (:), table2 (:), tablew (:), des2 (:), desw (:) - logical :: is_initialized = .false. - contains !>@brief The subroutine 'fv_sat_adj_init' initializes lookup tables for the saturation mixing ratio. @@ -134,7 +132,7 @@ subroutine fv_sat_adj_init(kmp, errmsg, errflg) errmsg = '' errflg = 0 - if (is_initialized) return + if (allocated(table)) return ! generate es table (dt = 0.1 deg c) @@ -155,8 +153,6 @@ subroutine fv_sat_adj_init(kmp, errmsg, errflg) des2 (length) = des2 (length - 1) desw (length) = desw (length - 1) - is_initialized = .true. - end subroutine fv_sat_adj_init !>@brief The subroutine 'fv_sat_adj_finalize' deallocates lookup tables for the saturation mixing ratio. @@ -177,16 +173,12 @@ subroutine fv_sat_adj_finalize (errmsg, errflg) errmsg = '' errflg = 0 - if (.not.is_initialized) return - if (allocated(table )) deallocate(table ) if (allocated(table2)) deallocate(table2) if (allocated(tablew)) deallocate(tablew) if (allocated(des2 )) deallocate(des2 ) if (allocated(desw )) deallocate(desw ) - is_initialized = .false. - end subroutine fv_sat_adj_finalize !>@brief The subroutine 'fv_sat_adj' performs the fast processes in the GFDL microphysics. @@ -313,13 +305,6 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, errmsg = '' errflg = 0 - ! Check initialization state - if (.not.is_initialized) then - write(errmsg, fmt='((a))') 'fv_sat_adj_run called before fv_sat_adj_init' - errflg = 1 - return - end if - #ifndef FV3 ! Open parallel region if not already opened by host model !$OMP parallel num_threads(nthreads) default(none) & diff --git a/physics/gmtb_scm_sfc_flux_spec.f90 b/physics/gmtb_scm_sfc_flux_spec.F90 similarity index 99% rename from physics/gmtb_scm_sfc_flux_spec.f90 rename to physics/gmtb_scm_sfc_flux_spec.F90 index 11596a6c4..1ce2f95a0 100644 --- a/physics/gmtb_scm_sfc_flux_spec.f90 +++ b/physics/gmtb_scm_sfc_flux_spec.F90 @@ -1,4 +1,4 @@ -!> \file gmtb_scm_sfc_flux_spec.f90 +!> \file gmtb_scm_sfc_flux_spec.F90 !! Contains code to calculate parameters needed by the rest of the GFS physics suite given specified surface fluxes. module gmtb_scm_sfc_flux_spec diff --git a/physics/precpd.f b/physics/precpd.f index 8e3ea5c86..7d0fef5dd 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -29,7 +29,7 @@ end subroutine zhaocarr_precpd_init !! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | !! | cwm | cloud_condensed_water_mixing_ratio_updated_by_physics | moist cloud condensed water mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | !! | t | air_temperature_updated_by_physics | layer mean air temperature | K | 2 | real | kind_phys | inout | F | -!! | rn | lwe_thickness_of_stratiform_precipitation_amount | stratiform rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | +!! | rn | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation amount on physics timestep | m | 1 | real | kind_phys | out | F | !! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | !! | rainp | tendency_of_rain_water_mixing_ratio_due_to_microphysics | tendency of rain water mixing ratio due to microphysics | kg kg-1 s-1 | 2 | real | kind_phys | out | F | !! | u00k | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index 66d13019e..9787f8fff 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -143,8 +143,6 @@ module lsm_noah public :: lsm_noah_init, lsm_noah_run, lsm_noah_finalize - logical :: is_initialized = .false. - contains !! \section arg_table_lsm_noah_init Argument Table @@ -170,13 +168,9 @@ subroutine lsm_noah_init(me, isot, ivegsrc, nlunit, errmsg = '' errflg = 0 - if (is_initialized) return - !--- initialize soil vegetation call set_soilveg(me, isot, ivegsrc, nlunit) - is_initialized = .true. - end subroutine lsm_noah_init @@ -197,10 +191,6 @@ subroutine lsm_noah_finalize(errmsg, errflg) errmsg = '' errflg = 0 - if (.not. is_initialized) return - - is_initialized = .false. - end subroutine lsm_noah_finalize @@ -497,18 +487,11 @@ subroutine lsm_noah_run & !===> ... begin here ! - ! Initialize CCPP error handling variables +!> - Initialize CCPP error handling variables + errmsg = '' errflg = 0 - ! Check initialization status - if (.not. is_initialized) then - write(errmsg,'(*(a))') - & "Logic error: lsm_noah_run called before lsm_noah_init" - errflg = 1 - return - end if - !> - Set flag for land points. do i = 1, im