diff --git a/CMakeLists.txt b/CMakeLists.txt index 60ff5eadc..04e81e7cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,7 +151,7 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel") string(REPLACE "-xCORE-AVX2" "-xCORE-AVX-I" CMAKE_Fortran_FLAGS_LOPT1 "${CMAKE_Fortran_FLAGS_LOPT1}") - string(REPLACE "-axSSE4.2,AVX,CORE-AVX2" "-axSSE4.2,AVX,CORE-AVX-I" + string(REPLACE "-axSSE4.2,AVX,CORE-AVX2,CORE-AVX512" "-axSSE4.2,AVX,CORE-AVX-I" CMAKE_Fortran_FLAGS_LOPT1 "${CMAKE_Fortran_FLAGS_LOPT1}") SET_SOURCE_FILES_PROPERTIES(./physics/radiation_aerosols.f diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 43dd6460c..dce271a31 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -250,13 +250,13 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs do k=1,levs do i=1,im dt3dt(i,k) = dt3dt(i,k) + (gt0(i,k)-save_t(i,k)) * frain - dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k)-save_qv(i,k)) * frain +! dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k)-save_qv(i,k)) * frain du3dt(i,k) = du3dt(i,k) + (gu0(i,k)-save_u(i,k)) * frain dv3dt(i,k) = dv3dt(i,k) + (gv0(i,k)-save_v(i,k)) * frain - upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain) - dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain) - det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain) +! upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain) +! dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain) +! det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain) enddo enddo endif ! if (ldiag3d) @@ -264,17 +264,17 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs endif ! if (lssav) !update dqdt_v to include moisture tendency due to deep convection - if (lgocart) then - do k=1,levs - do i=1,im - dqdti (i,k) = (gq0_water_vapor(i,k) - save_qv(i,k)) * frain - upd_mfi(i,k) = upd_mfi(i,k) + ud_mf(i,k) * frain - dwn_mfi(i,k) = dwn_mfi(i,k) + dd_mf(i,k) * frain - det_mfi(i,k) = det_mfi(i,k) + dt_mf(i,k) * frain - cnvqci (i,k) = cnvqci (i,k) + (clw_ice(i,k)+clw_liquid(i,k))*frain - enddo - enddo - endif ! if (lgocart) +! if (lgocart) then +! do k=1,levs +! do i=1,im +! dqdti (i,k) = (gq0_water_vapor(i,k) - save_qv(i,k)) * frain +! upd_mfi(i,k) = upd_mfi(i,k) + ud_mf(i,k) * frain +! dwn_mfi(i,k) = dwn_mfi(i,k) + dd_mf(i,k) * frain +! det_mfi(i,k) = det_mfi(i,k) + dt_mf(i,k) * frain +! cnvqci (i,k) = cnvqci (i,k) + (clw_ice(i,k)+clw_liquid(i,k))*frain +! enddo +! enddo +! endif ! if (lgocart) if (isppt_deep) then tconvtend = gt0 - save_t diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 6a594d7da..f01ffd8b3 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -334,7 +334,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt do k=1,levs do i=1,im dt3dt(i,k) = dt3dt(i,k) + (gt0(i,k)-save_t(i,k)) * frain - dq3dt(i,k) = dq3dt(i,k) + (gq0(i,k,1)-save_qv(i,k)) * frain +! dq3dt(i,k) = dq3dt(i,k) + (gq0(i,k,1)-save_qv(i,k)) * frain enddo enddo endif diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 15ed9b76f..c4cc4bc41 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -399,19 +399,19 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, ! enddo ! enddo ! endif - do k=1,levs - do i=1,im - tem = dqdt(i,k,ntqv) * dtf - dq3dt(i,k) = dq3dt(i,k) + tem - enddo - enddo - if (ntoz > 0) then - do k=1,levs - do i=1,im - dq3dt_ozone(i,k) = dq3dt_ozone(i,k) + dqdt(i,k,ntoz) * dtf - enddo - enddo - endif +! do k=1,levs +! do i=1,im +! tem = dqdt(i,k,ntqv) * dtf +! dq3dt(i,k) = dq3dt(i,k) + tem +! enddo +! enddo +! if (ntoz > 0) then +! do k=1,levs +! do i=1,im +! dq3dt_ozone(i,k) = dq3dt_ozone(i,k) + dqdt(i,k,ntoz) * dtf +! enddo +! enddo +! endif endif endif ! end if_lssav diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 9a6076671..5cb2fc798 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -53,13 +53,13 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, lgocart, gt0, gq0_water_ enddo enddo endif - if (ldiag3d .or. lgocart) then - do k=1,levs - do i=1,im - save_qv(i,k) = gq0_water_vapor(i,k) - enddo - enddo - endif +! if (ldiag3d .or. lgocart) then +! do k=1,levs +! do i=1,im +! save_qv(i,k) = gq0_water_vapor(i,k) +! enddo +! enddo +! endif end subroutine GFS_SCNV_generic_pre_run @@ -139,7 +139,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, lgocart, fra do k=1,levs do i=1,im dt3dt(i,k) = dt3dt(i,k) + (gt0(i,k) - save_t(i,k)) * frain - dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k) - save_qv(i,k)) * frain +! dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k) - save_qv(i,k)) * frain enddo enddo endif diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 5606ed1f1..3d9c00ac9 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -199,57 +199,57 @@ subroutine GFS_suite_interstitial_2_finalize() end subroutine GFS_suite_interstitial_2_finalize #if 0 !> \section arg_table_GFS_suite_interstitial_2_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 | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | shal_cnv | flag_for_shallow_convection | flag for calling shallow convection | flag | 0 | logical | | in | F | -!! | old_monin | flag_for_old_PBL_scheme | flag for using old PBL schemes | flag | 0 | logical | | in | F | -!! | mstrat | flag_for_moorthi_stratus | flag for moorthi approach for stratus | flag | 0 | logical | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | imfshalcnv | flag_for_mass_flux_shallow_convection_scheme | flag for mass-flux shallow convection scheme | flag | 0 | integer | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | in | F | -!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_cice | surface upwelling longwave flux for cice | W m-2 | 1 | real | kind_phys | in | F | -!! | lwhd | tendency_of_air_temperature_due_to_longwave_heating_for_idea | idea sky lw heating rates | K s-1 | 3 | real | kind_phys | in | F | -!! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 1 | real | kind_phys | in | F | -!! | ctei_rm | critical_cloud_top_entrainment_instability_criteria | critical cloud top entrainment instability criteria | none | 1 | real | kind_phys | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | qgrs_water_vapor | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_cloud_water | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | -!! | suntim | duration_of_sunshine | sunshine duration time | s | 1 | real | kind_phys | inout | F | -!! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | inout | F | -!! | dlwsfc | cumulative_surface_downwelling_longwave_flux_multiplied_by_timestep | cumulative surface downwelling LW flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | ulwsfc | cumulative_surface_upwelling_longwave_flux_multiplied_by_timestep | cumulative surface upwelling LW flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | psmean | cumulative_surface_pressure_multiplied_by_timestep | cumulative surface pressure multiplied by timestep | Pa s | 1 | real | kind_phys | inout | F | -!! | dt3dt_lw | cumulative_change_in_temperature_due_to_longwave_radiation | cumulative change in temperature due to longwave radiation | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_sw | cumulative_change_in_temperature_due_to_shortwave_radiation_and_orographic_gravity_wave_drag | cumulative change in temperature due to SW rad and oro. GWD | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_pbl | cumulative_change_in_temperature_due_to_PBL | cumulative change in temperature due to PBL | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_dcnv | cumulative_change_in_temperature_due_to_deep_convection | cumulative change in temperature due to deep conv. | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_scnv | cumulative_change_in_temperature_due_to_shal_convection | cumulative change in temperature due to shal conv. | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_mp | cumulative_change_in_temperature_due_to_microphysics | cumulative change in temperature due to microphysics | K | 2 | real | kind_phys | inout | F | -!! | ctei_rml | grid_sensitive_critical_cloud_top_entrainment_instability_criteria | grid sensitive critical cloud top entrainment instability criteria | none | 1 | real | kind_phys | inout | F | -!! | ctei_r | cloud_top_entrainment_instability_value | cloud top entrainment instability value | none | 1 | real | kind_phys | inout | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | inout | 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 | +!! |------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | +!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | +!! | shal_cnv | flag_for_shallow_convection | flag for calling shallow convection | flag | 0 | logical | | in | F | +!! | old_monin | flag_for_old_PBL_scheme | flag for using old PBL schemes | flag | 0 | logical | | in | F | +!! | mstrat | flag_for_moorthi_stratus | flag for moorthi approach for stratus | flag | 0 | logical | | in | F | +!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | +!! | imfshalcnv | flag_for_mass_flux_shallow_convection_scheme | flag for mass-flux shallow convection scheme | flag | 0 | integer | | in | F | +!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | +!! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | in | F | +!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_cice | surface upwelling longwave flux for cice | W m-2 | 1 | real | kind_phys | in | F | +!! | lwhd | tendency_of_air_temperature_due_to_longwave_heating_for_idea | idea sky lw heating rates | K s-1 | 3 | real | kind_phys | in | F | +!! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 1 | real | kind_phys | in | F | +!! | ctei_rm | critical_cloud_top_entrainment_instability_criteria | critical cloud top entrainment instability criteria | none | 1 | real | kind_phys | in | F | +!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | +!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | qgrs_water_vapor | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | +!! | qgrs_cloud_water | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | in | F | +!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | +!! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | +!! | suntim | duration_of_sunshine | sunshine duration time | s | 1 | real | kind_phys | inout | F | +!! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | inout | F | +!! | dlwsfc | cumulative_surface_downwelling_longwave_flux_multiplied_by_timestep | cumulative surface downwelling LW flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | ulwsfc | cumulative_surface_upwelling_longwave_flux_multiplied_by_timestep | cumulative surface upwelling LW flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | psmean | cumulative_surface_pressure_multiplied_by_timestep | cumulative surface pressure multiplied by timestep | Pa s | 1 | real | kind_phys | inout | F | +!! | dt3dt_lw | cumulative_change_in_temperature_due_to_longwave_radiation | cumulative change in temperature due to longwave radiation | K | 2 | real | kind_phys | inout | F | +!! | dt3dt_sw | cumulative_change_in_temperature_due_to_shortwave_radiation | cumulative change in temperature due to shortwave radiation | K | 2 | real | kind_phys | inout | F | +!! | dt3dt_pbl | cumulative_change_in_temperature_due_to_PBL | cumulative change in temperature due to PBL | K | 2 | real | kind_phys | inout | F | +!! | dt3dt_dcnv | cumulative_change_in_temperature_due_to_deep_convection | cumulative change in temperature due to deep conv. | K | 2 | real | kind_phys | inout | F | +!! | dt3dt_scnv | cumulative_change_in_temperature_due_to_shal_convection | cumulative change in temperature due to shal conv. | K | 2 | real | kind_phys | inout | F | +!! | dt3dt_mp | cumulative_change_in_temperature_due_to_microphysics | cumulative change in temperature due to microphysics | K | 2 | real | kind_phys | inout | F | +!! | ctei_rml | grid_sensitive_critical_cloud_top_entrainment_instability_criteria | grid sensitive critical cloud top entrainment instability criteria | none | 1 | real | kind_phys | inout | F | +!! | ctei_r | cloud_top_entrainment_instability_value | cloud top entrainment instability value | none | 1 | real | kind_phys | inout | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | inout | 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 | !! #endif subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplflx, flag_cice, shal_cnv, old_monin, mstrat, & diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 044b57de4..31736d6b9 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -160,6 +160,8 @@ end subroutine gfdl_cloud_microphys_finalize !! | phys_hydrostatic | flag_for_hydrostatic_heating_from_physics | flag indicating hydrostatic heating from physics | flag | 0 | logical | | in | F | !! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | !! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | inout | F | +!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | +!! | nsteps_per_reset | number_of_time_steps_per_maximum_hourly_time_interval | number_of_time_steps_per_maximum_hourly_time_interval | count | 0 | integer | | in | F | !! | effr_in | flag_for_cloud_effective_radii | flag for cloud effective radii calculations in microphysics | | 0 | logical | | in | F | !! | rew | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | inout | F | !! | rei | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | inout | F | @@ -175,7 +177,7 @@ subroutine gfdl_cloud_microphys_run( & gt0, gu0, gv0, vvl, prsl, phii, del, & rain0, ice0, snow0, graupel0, prcp0, sr, & dtp, hydrostatic, phys_hydrostatic, lradar, refl_10cm, & - effr_in, rew, rei, rer, res, reg, errmsg, errflg) + kdt, nsteps_per_reset, effr_in, rew, rei, rer, res, reg, errmsg, errflg) use machine, only: kind_phys @@ -212,6 +214,7 @@ subroutine gfdl_cloud_microphys_run( & logical, intent (in) :: lradar real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: refl_10cm + integer, intent (in) :: kdt, nsteps_per_reset logical, intent (in) :: effr_in real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: rew, rei, rer, res, reg @@ -288,7 +291,7 @@ subroutine gfdl_cloud_microphys_run( & 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, & garea, dtp, frland, rain0, snow0, ice0, graupel0, hydrostatic, & - phys_hydrostatic, p123, lradar, refl) + phys_hydrostatic, p123, lradar, refl, kdt, nsteps_per_reset) tem = dtp*con_p001/con_day ! fix negative values diff --git a/physics/gwdps.f b/physics/gwdps.f index 7cc33e735..ebbc6e8f7 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -17,6 +17,7 @@ end subroutine gwdps_pre_init !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal dimension | count | 0 | integer | | in | F | +!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | !! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of statistical measures of subgrid orography | count | 0 | integer | | in | F | !! | mntvar | statistical_measures_of_subgrid_orography | array of statistical measures of subgrid orography | various | 2 | real | kind_phys | in | F | !! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | out | F | @@ -27,6 +28,11 @@ end subroutine gwdps_pre_init !! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | out | F | !! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | out | F | !! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | out | F | +!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | +!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | F | +!! | dtf | time_step_for_dynamics | dynamics 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 | !! @@ -34,23 +40,31 @@ end subroutine gwdps_pre_init !! \section detailed Detailed Algorithm !! @{ subroutine gwdps_pre_run( & - & im, nmtvr, mntvar, & + & im, levs, nmtvr, mntvar, & & hprime, oc, oa4, clx, theta, & - & sigma, gamma, elvmax, errmsg, errflg) + & sigma, gamma, elvmax, lssav, ldiag3d, & + & dtdt, dt3dt, dtf, errmsg, errflg) use machine, only : kind_phys implicit none - integer, intent(in) :: im, nmtvr + integer, intent(in) :: im, levs, nmtvr real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr) real(kind=kind_phys), intent(out) :: & & hprime(im), oc(im), oa4(im,4), clx(im,4), & & theta(im), sigma(im), gamma(im), elvmax(im) & + logical, intent(in) :: lssav, ldiag3d + real(kind=kind_phys), intent(in) :: dtdt(im,levs) + real(kind=kind_phys), intent(inout) :: dt3dt(im,levs) + real(kind=kind_phys), intent(in) :: dtf + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + integer :: i, k + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -103,6 +117,16 @@ subroutine gwdps_pre_run( & elvmax = 0 endif ! end if_nmtvr + if (lssav) then + if (ldiag3d) then + do k=1,levs + do i=1,im + dt3dt(i,k) = dt3dt(i,k) - dtdt(i,k)*dtf + enddo + enddo + endif + endif + end subroutine gwdps_pre_run !> @} @@ -1471,23 +1495,23 @@ subroutine gwdps_post_init() end subroutine gwdps_post_init !! \section arg_table_gwdps_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | lssav | flag_diagnostics | flag for calculating diagnostic fields | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | in | F | -!! | dugwd | time_integral_of_x_stress_due_to_gravity_wave_drag | integral over time of zonal stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | dvgwd | time_integral_of_y_stress_due_to_gravity_wave_drag | integral over time of meridional stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | du3dt | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in zonal wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in meridional wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_shortwave_radiation_and_orographic_gravity_wave_drag | cumulative change in temperature due to SW rad and oro. GWD | K | 2 | real | kind_phys | inout | 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 | +!! |----------------|----------------------------------------------------------------------|--------------------------------------------------------------------------|-------|------|-----------|-----------|--------|----------| +!! | lssav | flag_diagnostics | flag for calculating diagnostic fields | flag | 0 | logical | | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | +!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | +!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | +!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | +!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | in | F | +!! | dugwd | time_integral_of_x_stress_due_to_gravity_wave_drag | integral over time of zonal stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | +!! | dvgwd | time_integral_of_y_stress_due_to_gravity_wave_drag | integral over time of meridional stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | +!! | du3dt | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in zonal wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | dv3dt | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in meridional wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | 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 gwdps_post_run( & & lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, & diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 new file mode 100644 index 000000000..13ba6e0c9 --- /dev/null +++ b/physics/maximum_hourly_diagnostics.F90 @@ -0,0 +1,251 @@ +module maximum_hourly_diagnostics + + use machine, only: kind_phys + + implicit none + + private + + public maximum_hourly_diagnostics_init, maximum_hourly_diagnostics_run, maximum_hourly_diagnostics_finalize + + ! DH* TODO - THIS CAME FROM PHYSCONS.F90 BUT IS IT BETTER PLACED IN HERE? + real(kind=kind_phys), parameter ::PQ0=379.90516E0, A2A=17.2693882, A3=273.16, A4=35.86, RHmin=1.0E-6 + ! *DH + +contains + + subroutine maximum_hourly_diagnostics_init() + end subroutine maximum_hourly_diagnostics_init + + subroutine maximum_hourly_diagnostics_finalize() + end subroutine maximum_hourly_diagnostics_finalize + +#if 0 +!> \section arg_table_maximum_hourly_diagnostics_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 | +!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | +!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | +!! | nsteps_per_reset | number_of_time_steps_per_maximum_hourly_time_interval | number_of_time_steps_per_maximum_hourly_time_interval | count | 0 | integer | | in | F | +!! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | +!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | +!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | +!! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | in | F | +!! | refdmax | maximum_reflectivity_at_1km_agl_over_maximum_hourly_time_interval | maximum reflectivity at 1km agl over maximum hourly time interval | dBZ | 1 | real | kind_phys | inout | F | +!! | refdmax263k | maximum_reflectivity_at_minus10c_over_maximum_hourly_time_interval | maximum reflectivity at minus10c over maximum hourly time interval | dBZ | 1 | real | kind_phys | inout | F | +!! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | in | F | +!! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | in | F | +!! | u10max | maximum_u_wind_at_10m_over_maximum_hourly_time_interval | maximum u wind at 10m over maximum hourly time interval | m s-1 | 1 | real | kind_phys | inout | F | +!! | v10max | maximum_v_wind_at_10m_over_maximum_hourly_time_interval | maximum v wind at 10m over maximum hourly time interval | m s-1 | 1 | real | kind_phys | inout | F | +!! | spd10max | maximum_wind_at_10m_over_maximum_hourly_time_interval | maximum wind at 10m over maximum hourly time interval | m s-1 | 1 | real | kind_phys | inout | F | +!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | t2m | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | in | F | +!! | q2m | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | +!! | t02max | maximum_temperature_at_2m_over_maximum_hourly_time_interval | maximum temperature at 2m over maximum hourly time interval | K | 1 | real | kind_phys | inout | F | +!! | t02min | minimum_temperature_at_2m_over_maximum_hourly_time_interval | minumum temperature at 2m over maximum hourly time interval | K | 1 | real | kind_phys | inout | F | +!! | rh02max | maximum_relative_humidity_at_2m_over_maximum_hourly_time_interval | maximum relative humidity at 2m over maximum hourly time interval | % | 1 | real | kind_phys | inout | F | +!! | rh02min | minimum_relative_humidity_at_2m_over_maximum_hourly_time_interval | minumum relative humidity at 2m over maximum hourly time interval | % | 1 | real | kind_phys | inout | 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 | +!! +#endif + subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lradar, imp_physics, & + imp_physics_gfdl, imp_physics_thompson, con_g, phil, & + gt0, refl_10cm, refdmax, refdmax263k, u10m, v10m, & + u10max, v10max, spd10max, pgr, t2m, q2m, t02max, & + t02min, rh02max, rh02min, errmsg, errflg) + + ! Interface variables + integer, intent(in) :: im, levs, kdt, nsteps_per_reset + logical, intent(in) :: lradar + integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson + real(kind_phys), intent(in ) :: con_g + real(kind_phys), intent(in ) :: phil(im,levs) + real(kind_phys), intent(in ) :: gt0(im,levs) + real(kind_phys), intent(in ) :: refl_10cm(im,levs) + real(kind_phys), intent(inout) :: refdmax(im) + real(kind_phys), intent(inout) :: refdmax263k(im) + real(kind_phys), intent(in ) :: u10m(im) + real(kind_phys), intent(in ) :: v10m(im) + real(kind_phys), intent(inout) :: u10max(im) + real(kind_phys), intent(inout) :: v10max(im) + real(kind_phys), intent(inout) :: spd10max(im) + real(kind_phys), intent(in ) :: pgr(im) + real(kind_phys), intent(in ) :: t2m(im) + real(kind_phys), intent(in ) :: q2m(im) + real(kind_phys), intent(inout) :: t02max(im) + real(kind_phys), intent(inout) :: t02min(im) + real(kind_phys), intent(inout) :: rh02max(im) + real(kind_phys), intent(inout) :: rh02min(im) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + real(kind_phys), dimension(:), allocatable :: refd, refd263k + real(kind_phys) :: tem, pshltr, QCQ, rh02 + integer :: kdtminus1, i + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + kdtminus1 = kdt-1 + +!Calculate hourly max 1-km agl and -10C reflectivity + if (lradar .and. (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson)) then + allocate(refd(im)) + allocate(refd263k(im)) + call max_fields(phil,refl_10cm,con_g,im,levs,refd,gt0,refd263k) + if(mod(kdtminus1,nsteps_per_reset)==0)then + do i=1,im + refdmax(i) = -35. + refdmax263k(i) = -35. + enddo + endif + do i=1,im + !if(mod(kdtminus1,nsteps_per_reset)==0)then + ! refdmax(I) = -35. + ! refdmax263k(I) = -35. + !endif + refdmax(i) = max(refdmax(i),refd(i)) + refdmax263k(i) = max(refdmax263k(i),refd263k(i)) + enddo + deallocate (refd) + deallocate (refd263k) + endif +! + if(mod(kdtminus1,nsteps_per_reset)==0)then + do i=1,im + spd10max(i) = -999. + u10max(i) = -999. + v10max(i) = -999. + t02max(i) = -999. + t02min(i) = 999. + rh02max(i) = -999. + rh02min(i) = 999. + enddo + endif + do i=1,im +! find max hourly wind speed then decompose + tem = sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) + !if(mod(kdtminus1,nsteps_per_reset)==0)then + ! spd10max(i) = -999. + ! u10max(i) = -999. + ! v10max(i) = -999. + ! t02max(i) = -999. + ! t02min(i) = 999. + ! rh02max(i) = -999. + ! rh02min(i) = 999. + !endif + if (tem > spd10max(i)) then + spd10max(i) = tem + u10max(i) = u10m(i) + v10max(i) = v10m(i) + endif + pshltr=pgr(i)*exp(-0.068283/gt0(i,1)) + QCQ=PQ0/pshltr*EXP(A2A*(t2m(i)-A3)/(t2m(i)-A4)) + rh02=q2m(i)/QCQ + IF (rh02.GT.1.0) THEN + rh02=1.0 + ENDIF + IF (rh02.LT.RHmin) THEN !use smaller RH limit for stratosphere + rh02=RHmin + ENDIF + rh02max(i)=max(rh02max(i),rh02) + rh02min(i)=min(rh02min(i),rh02) + t02max(i)=max(t02max(i),t2m(i)) !<--- hourly max 2m t + t02min(i)=min(t02min(i),t2m(i)) !<--- hourly min 2m t + enddo + + end subroutine maximum_hourly_diagnostics_run + + subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k) + integer, intent(in) :: im,levs + real (kind=kind_phys), intent(in) :: grav + real (kind=kind_phys), intent(in),dimension(im,levs) :: phil,ref3D,tk + integer :: i,k,ll,ipt,kpt + real :: dbz1avg,zmidp1,zmidloc,refl,fact + real, dimension(im,levs) :: z + real, dimension(im) :: zintsfc + real, dimension(im), intent(inout) :: refd,refd263k + REAL :: dbz1(2),dbzk,dbzk1 + logical :: counter + do i=1,im + do k=1,levs + z(i,k)=phil(i,k)/grav + enddo + enddo + do i=1,im + refd(I) = -35. + vloop: do k=1,levs-1 + if ( (z(i,k+1)) .ge. 1000. & + .and.(z(i,k)) .le. 1000.) then + zmidp1=z(i,k+1) + zmidLOC=z(i,k) + dbz1(1)=ref3d(i,k+1) !- dBZ (not Z) values + dbz1(2)=ref3d(i,k) !- dBZ values + exit vloop + endif + enddo vloop + +!!! Initial curefl value without reduction above freezing level +! +! curefl=0. +! if (cprate(i,j)>0.) then +! cuprate=rdtphs*cprate(i,j) +! curefl=cu_a*cuprate**cu_b +! endif + do ll=1,2 + refl=0. + if (dbz1(ll)>-35.) refl=10.**(0.1*dbz1(ll)) +! dbz1(l)=curefl+refl !- in Z units + dbz1(ll)=refl + enddo +!-- Vertical interpolation of Z (units of mm**6/m**3) + fact=(1000.-zmidloc)/(zmidloc-zmidp1) + dbz1avg=dbz1(2)+(dbz1(2)-dbz1(1))*fact +!-- Convert to dBZ (10*logZ) as the last step + if (dbz1avg>0.01) then + dbz1avg=10.*alog10(dbz1avg) + else + dbz1avg=-35. + endif + refd(I)=max(refd(I),dbz1avg) + enddo + +!-- refl at -10C + do i=1,im + dbz1(1) = -35. + dbz1(2) = -35. + vloopm10: do k=1,levs-1 + if (tk(i,k+1) .le. 263.15 .and. tk(i,k) .ge. 263.15) then + dbz1(1)=ref3d(i,k+1) !- dBZ (not Z) values + dbz1(2)=ref3d(i,k) !- dBZ values + exit vloopm10 + endif + enddo vloopm10 + + do ll=1,2 + refl=0. + if (dbz1(ll)>-35.) refl=10.**(0.1*dbz1(ll)) +! dbz1(l)=curefl+refl !- in Z units + dbz1(ll)=refl + enddo +!-- Take max of bounding reflectivity values + dbz1avg=maxval(dbz1) +!-- Convert to dBZ (10*logZ) as the last step + if (dbz1avg>0.01) then + dbz1avg=10.*alog10(dbz1avg) + else + dbz1avg=-35. + endif + refd263K(I)=dbz1avg + enddo + end subroutine max_fields + +end module maximum_hourly_diagnostics \ No newline at end of file diff --git a/physics/module_gfdl_cloud_microphys.F90 b/physics/module_gfdl_cloud_microphys.F90 index c3ab6acad..009a50f39 100644 --- a/physics/module_gfdl_cloud_microphys.F90 +++ b/physics/module_gfdl_cloud_microphys.F90 @@ -324,7 +324,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, pt_dt, pt, w, & uin, vin, udt, vdt, dz, delp, area, dt_in, land, & rain, snow, ice, graupel, hydrostatic, phys_hydrostatic, & - p, lradar, refl_10cm) + p, lradar, refl_10cm, kdt, nsteps_per_reset) implicit none @@ -354,8 +354,11 @@ subroutine gfdl_cloud_microphys_mod_driver ( real, intent (in), dimension (iis:iie, jjs:jje, kks:kke) :: p logical, intent (in) :: lradar real, intent (out), dimension (iis:iie, jjs:jje, kks:kke) :: refl_10cm + integer, intent (in) :: kdt, nsteps_per_reset ! Local variables + logical :: melti = .false. + real :: mpdt, rdt, dts, convt, tot_prec integer :: i, j, k @@ -588,6 +591,12 @@ subroutine gfdl_cloud_microphys_mod_driver ( ! call mpp_clock_end (gfdl_mp_clock) if(lradar) then + ! Only set melti to true at the output times + if(mod(kdt,nsteps_per_reset)==0)then + melti=.true. + else + melti=.false. + endif do j = js, je do i = is, ie do k = ktop,kbot @@ -600,7 +609,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( qg1d(k) = qg(i,j,kflip) enddo call refl10cm_gfdl (qv1d, qr1d, qs1d, qg1d, & - t1d, p1d, dBZ, ktop, kbot, i,j) + t1d, p1d, dBZ, ktop, kbot, i, j, melti) do k = ktop,kbot kflip = kbot-ktop+1-k+1 refl_10cm(i,j,kflip) = MAX(-35., dBZ(k)) @@ -4735,7 +4744,8 @@ subroutine cloud_diagnosis (is, ie, js, je, den, qw, qi, qr, qs, qg, t, & real :: alphar = 0.8, alphas = 0.25, alphag = 0.5 real :: gammar = 17.837789, gammas = 8.2850630, gammag = 11.631769 ! real :: qmin = 1.0e-5, ccn = 1.0e8, beta = 1.22 - real :: qmin = 5.0e-6, ccn = 1.0e8, beta = 1.22 +! real :: qmin = 5.0e-6, ccn = 1.0e8, beta = 1.22 + real :: qmin = 9.0e-6, ccn = 1.0e8, beta = 1.22 ! real :: qmin = 1.0e-6, ccn = 1.0e8, beta = 1.22 ! real :: qmin = 1.0e-8, ccn = 1.0e8, beta = 1.22 ! real :: qmin = 1.0e-12, ccn = 1.0e8, beta = 1.22 @@ -4841,7 +4851,7 @@ end subroutine cloud_diagnosis !+---+-----------------------------------------------------------------+ subroutine refl10cm_gfdl (qv1d, qr1d, qs1d, qg1d, & - t1d, p1d, dBZ, kts, kte, ii,jj) + t1d, p1d, dBZ, kts, kte, ii, jj, melti) IMPLICIT NONE @@ -4865,8 +4875,7 @@ subroutine refl10cm_gfdl (qv1d, qr1d, qs1d, qg1d, & DOUBLE PRECISION:: fmelt_s, fmelt_g INTEGER:: i, k, k_0, kbot, n - LOGICAL:: melti - + LOGICAL, INTENT(IN):: melti DOUBLE PRECISION:: cback, x, eta, f_d !+---+ @@ -4921,17 +4930,14 @@ subroutine refl10cm_gfdl (qv1d, qr1d, qs1d, qg1d, & !+---+-----------------------------------------------------------------+ !..Locate K-level of start of melting (k_0 is level above). !+---+-----------------------------------------------------------------+ - melti = .false. k_0 = kts - do k = kte-1, kts, -1 - if ( (temp(k).gt.273.15) .and. L_qr(k) & - .and. (L_qs(k+1).or.L_qg(k+1)) ) then + K_LOOP:do k = kte-1, kts, -1 + if ( melti .and. (temp(k).gt.273.15) .and. L_qr(k) & + .and. (L_qs(k+1).or.L_qg(k+1)) ) then k_0 = MAX(k+1, k_0) - melti=.true. - goto 195 + EXIT K_LOOP endif - enddo - 195 continue + enddo K_LOOP !+---+-----------------------------------------------------------------+ !..Assume Rayleigh approximation at 10 cm wavelength. Rain (all temps) !.. and non-water-coated snow and graupel when below freezing are diff --git a/physics/ozphys.f b/physics/ozphys.f index 29ad2d0cf..eea3d5731 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -69,9 +69,10 @@ subroutine ozphys_run ( & ! Interface variables integer, intent(in) :: im, ix, levs, ko3, oz_coeff, me real(kind=kind_phys), intent(inout) :: & - & oz(ix,levs), & - & ozp1(ix,levs), ozp2(ix,levs), ozp3(ix,levs), & - & ozp4(ix,levs) + & oz(ix,levs) + ! These arrays may not be allocated and need assumed array sizes + real(kind=kind_phys), intent(inout) :: & + & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) real(kind=kind_phys), intent(in) :: & & dt, po3(ko3), prdout(ix,ko3,oz_coeff), & & prsl(ix,levs), tin(ix,levs), delp(ix,levs), & @@ -162,12 +163,12 @@ subroutine ozphys_run ( & oz(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt) enddo ! - if (ldiag3d) then ! ozone change diagnostics - do i=1,im - ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt - ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - enddo - endif + !if (ldiag3d) then ! ozone change diagnostics + ! do i=1,im + ! ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt + ! ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) + ! enddo + !endif endif !> - Calculate the 4 terms of prognostic ozone change during time \a dt: !! - ozp1(:,:) - Ozone production from production/loss ratio @@ -183,14 +184,14 @@ subroutine ozphys_run ( & ! &,' ozib=',ozib(i),' l=',l,' tin=',tin(i,l),'colo3=',colo3(i,l+1) oz(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt) enddo - if (ldiag3d) then ! ozone change diagnostics - do i=1,im - ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt - ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - ozp3(i,l) = ozp3(i,l) + prod(i,3)*tin(i,l)*dt - ozp4(i,l) = ozp4(i,l) + prod(i,4)*colo3(i,l+1)*dt - enddo - endif + !if (ldiag3d) then ! ozone change diagnostics + ! do i=1,im + ! ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt + ! ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) + ! ozp3(i,l) = ozp3(i,l) + prod(i,3)*tin(i,l)*dt + ! ozp4(i,l) = ozp4(i,l) + prod(i,4)*colo3(i,l+1)*dt + ! enddo + !endif endif enddo ! vertical loop diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index c0f63f794..8e165a484 100755 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -77,8 +77,9 @@ subroutine ozphys_2015_run ( & & prsl(ix,levs), tin(ix,levs), & & delp(ix,levs), & & prdout(ix,ko3,pl_coeff), dt - real(kind=kind_phys), intent(inout) :: ozp1(ix,levs), & - & ozp2(ix,levs), ozp3(ix,levs),ozp4(ix,levs) + ! These arrays may not be allocated and need assumed array sizes + real(kind=kind_phys), intent(inout) :: & + & ozp1(:,:), ozp2(:,:), ozp3(:,:),ozp4(:,:) real(kind=kind_phys), intent(inout) :: oz(ix,levs) @@ -169,16 +170,16 @@ subroutine ozphys_2015_run ( & !ccpp ozo(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) oz(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) enddo - if (ldiag3d) then ! ozone change diagnostics - do i=1,im - ozp1(i,l) = ozp1(i,l) + (prod(i,1)-prod(i,2)*prod(i,6))*dt -!ccpp ozp(i,l,2) = ozp(i,l,2) + (ozo(i,l) - ozib(i)) - ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - ozp3(i,l) = ozp3(i,l) + prod(i,3)*(tin(i,l)-prod(i,5))*dt - ozp4(i,l) = ozp4(i,l) + prod(i,4) - & * (colo3(i,l)-coloz(i,l))*dt - enddo - endif +! if (ldiag3d) then ! ozone change diagnostics +! do i=1,im +! ozp1(i,l) = ozp1(i,l) + (prod(i,1)-prod(i,2)*prod(i,6))*dt +!!ccpp ozp(i,l,2) = ozp(i,l,2) + (ozo(i,l) - ozib(i)) +! ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) +! ozp3(i,l) = ozp3(i,l) + prod(i,3)*(tin(i,l)-prod(i,5))*dt +! ozp4(i,l) = ozp4(i,l) + prod(i,4) +! & * (colo3(i,l)-coloz(i,l))*dt +! enddo +! endif enddo ! vertical loop ! return diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index bc171cdf3..c77160c50 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -322,7 +322,7 @@ subroutine sfc_sice_run & !> - Set flag for sea-ice. do i = 1, im - flag(i) = (islimsk(i) >= 2) .and. flag_iter(i) + flag(i) = (islimsk(i) == 2) .and. flag_iter(i) if (flag_iter(i) .and. islimsk(i) < 2) then hice(i) = 0.0 fice(i) = 0.0