From ac4b938eb502c5061b773f1c077025a22be5683b Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 6 Aug 2018 13:05:21 -0600 Subject: [PATCH 1/2] udpated GFS_surface_generic_pre and changed some standard names in other files --- physics/GFS_surface_generic.f90 | 134 ++++++++++++++--------------- physics/gmtb_scm_sfc_flux_spec.f90 | 2 +- physics/moninedmf.f | 2 +- physics/sfc_diff.f | 82 +++++++++--------- physics/sfc_drv.f | 26 +++--- physics/sfc_nst.f | 10 +-- physics/sfc_sice.f | 30 +++---- 7 files changed, 141 insertions(+), 145 deletions(-) diff --git a/physics/GFS_surface_generic.f90 b/physics/GFS_surface_generic.f90 index e39f7ef20..38a6ecaed 100644 --- a/physics/GFS_surface_generic.f90 +++ b/physics/GFS_surface_generic.f90 @@ -12,85 +12,87 @@ subroutine GFS_surface_generic_pre_finalize() end subroutine GFS_surface_generic_pre_finalize !> \section arg_table_GFS_surface_generic_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------------|------------|------|-----------------------|-----------|--------|----------| -!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Sfcprop | FV3-GFS_Sfcprop_type | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_sfcprop_type | | in | F | -!! | Radtend | FV3-GFS_Radtend_type | Fortran DDT containing FV3-GFS radiation tendencies needed in physics | DDT | 0 | GFS_radtend_type | | in | F | -!! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_statein_type | | in | F | -!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_diag_type | | inout | F | -!! | sigmaf | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | inout | F | -!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | inout | F | -!! | soiltyp | cell_soil_type | soil type at each grid cell | index | 1 | integer | | inout | F | -!! | vegtype | cell_vegetation_type | vegetation type at each grid cell | index | 1 | integer | | inout | F | -!! | slopetyp | surface_slope_classification | class of sfc slope | index | 1 | integer | | inout | F | -!! | work3 | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | inout | F | -!! | gabsbdlw | surface_downwelling_longwave_flux_absorbed_by_ground | total sky surface downward longwave flux absorbed by the ground | W m-2 | 1 | real | kind_phys | inout | F | -!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | -!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | inout | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | inout | F | -!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 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 | +!! | 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 | +!! | vfrac | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | +!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | +!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | +!! | stype | soil_type_classification_real | soil type for lsm | index | 1 | real | kind_phys | in | F | +!! | vtype | vegetation_type_classification_real | vegetation type for lsm | index | 1 | real | kind_phys | in | F | +!! | slope | surface_slope_classification_real | sfc slope type for lsm | index | 1 | real | kind_phys | in | F | +!! | prsik_1 | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at lowest model interface | none | 1 | real | kind_phys | in | F | +!! | prslk_1 | dimensionless_exner_function_at_lowest_model_layer | dimensionless Exner function at lowest model layer | none | 1 | real | kind_phys | in | F | +!! | semis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 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 | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom | frac | 1 | real | kind_phys | inout | F | +!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | inout | F | +!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | inout | F | +!! | slopetyp | surface_slope_classification | surface slope type at each grid cell | index | 1 | integer | | inout | F | +!! | work3 | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | inout | F | +!! | gabsbdlw | surface_downwelling_longwave_flux_absorbed_by_ground | total sky surface downward longwave flux absorbed by the ground | W m-2 | 1 | real | kind_phys | inout | F | +!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | +!! | zlvl | height_above_ground_at_lowest_model_layer | layer 1 height above ground (not MSL) | m | 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 | !! - subroutine GFS_surface_generic_pre_run (Model, Grid, Sfcprop, Radtend, Statein, adjsfcdlw, Diag, sigmaf, islmsk, & - soiltyp, vegtype, slopetyp, work3, gabsbdlw, tsurf, flag_guess, flag_iter, ep1d, errmsg, errflg) + subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, stype, vtype, slope, & + prsik_1, prslk_1, semis, adjsfcdlw, tsfc, phil, con_g, sigmaf, soiltyp, vegtype, slopetyp, work3, gabsbdlw, & + tsurf, zlvl, errmsg, errflg) use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type, GFS_grid_type, GFS_sfcprop_type, & - GFS_diag_type, GFS_radtend_type, GFS_statein_type - use physcons, only: con_g implicit none - type(GFS_grid_type), intent(in) :: Grid - type(GFS_control_type), intent(in) :: Model - type(GFS_sfcprop_type), intent(in) :: Sfcprop - type(GFS_radtend_type), intent(in) :: Radtend - type(GFS_statein_type), intent(in) :: Statein - type(GFS_diag_type), intent(inout) :: Diag + integer, intent(in) :: im, levs, isot, ivegsrc + integer, dimension(im), intent(in) :: islmsk + integer, dimension(im), intent(inout) :: soiltyp, vegtype, slopetyp - integer, dimension(size(Grid%xlon,1)), intent(inout) :: islmsk, soiltyp, vegtype, slopetyp + real(kind=kind_phys), intent(in) :: con_g + real(kind=kind_phys), dimension(im), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1, & + semis, adjsfcdlw, tsfc + real(kind=kind_phys), dimension(im,levs), intent(in) :: phil - logical, dimension(size(Grid%xlon,1)), intent(inout) :: flag_guess, flag_iter - - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: adjsfcdlw - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(inout) :: sigmaf, work3, gabsbdlw, tsurf, ep1d + real(kind=kind_phys), dimension(im), intent(inout) :: sigmaf, work3, gabsbdlw, tsurf, zlvl character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg integer :: i - real(kind=kind_phys), parameter :: onebg = 1.0/con_g + real(kind=kind_phys) :: onebg + + onebg = 1.0/con_g ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - do i = 1, size(Grid%xlon,1) - sigmaf(i) = max( Sfcprop%vfrac(i),0.01 ) - - if (islmsk(i) == 2) then - if (Model%isot == 1) then - soiltyp(i) = 16 - else - soiltyp(i) = 9 - endif - if (Model%ivegsrc == 1) then - vegtype(i) = 15 - elseif(Model%ivegsrc == 2) then - vegtype(i) = 13 - endif - slopetyp(i) = 9 + do i=1,im + sigmaf(i) = max(vfrac(i),0.01 ) + if (islmsk(i) == 2) then + if (isot == 1) then + soiltyp(i) = 16 else - soiltyp(i) = int( Sfcprop%stype(i)+0.5 ) - vegtype(i) = int( Sfcprop%vtype(i)+0.5 ) - slopetyp(i) = int( Sfcprop%slope(i)+0.5 ) !! clu: slope -> slopetyp + soiltyp(i) = 9 endif - - work3(i) = Statein%prsik(i,1) / Statein%prslk(i,1) + if (ivegsrc == 1) then + vegtype(i) = 15 + elseif(ivegsrc == 2) then + vegtype(i) = 13 + endif + slopetyp(i) = 9 + else + soiltyp(i) = int( stype(i)+0.5 ) + vegtype(i) = int( vtype(i)+0.5 ) + slopetyp(i) = int( slope(i)+0.5 ) !! clu: slope -> slopetyp + endif + + work3(i) = prsik_1(i) / prslk_1(i) end do ! --- convert lw fluxes for land/ocean/sea-ice models @@ -110,16 +112,12 @@ subroutine GFS_surface_generic_pre_run (Model, Grid, Sfcprop, Radtend, Statein, ! net = up - down = sfcemis * (sigma*T**4 - adjsfcdlw) ! --- ... define the downward lw flux absorbed by ground + gabsbdlw(:) = semis(:) * adjsfcdlw(:) - gabsbdlw(:) = Radtend%semis(:) * adjsfcdlw(:) - - tsurf(:) = Sfcprop%tsfc(:) - flag_guess(:) = .false. - flag_iter(:) = .true. - - ep1d(:) = 0.0 - - Diag%zlvl(:) = Statein%phil(:,1) * onebg + do i=1,im + tsurf(i) = tsfc(i) + zlvl(i) = phil(i,1) * onebg + end do end subroutine GFS_surface_generic_pre_run diff --git a/physics/gmtb_scm_sfc_flux_spec.f90 b/physics/gmtb_scm_sfc_flux_spec.f90 index ff2d79ead..49d9f3209 100644 --- a/physics/gmtb_scm_sfc_flux_spec.f90 +++ b/physics/gmtb_scm_sfc_flux_spec.f90 @@ -37,7 +37,7 @@ end subroutine gmtb_scm_sfc_flux_spec_finalize !! | spec_sh_flux | specified_kinematic_surface_upward_sensible_heat_flux | specified kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | spec_lh_flux | specified_kinematic_surface_upward_latent_heat_flux | specified kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | !! | exner_inverse | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | T_surf | surface_skin_temperature | ocean surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | T_surf | surface_skin_temperature | surface skin temperature | K | 1 | 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 | !! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | !! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of vaporization of water at 0C | J kg-1 | 0 | real | kind_phys | in | F | diff --git a/physics/moninedmf.f b/physics/moninedmf.f index a9fff73a4..3f7a1d255 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -88,7 +88,7 @@ end subroutine hedmf_finalize !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | !! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | !! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | +!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | !! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 1fdc86173..e25506a09 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -1,6 +1,6 @@ !> \file sfc_diff.f -!! This file contains the surface roughness length formulation based on -!! the surface sublayer scheme in \cite zeng_and_dickinson_1998. +!! This file contains the surface roughness length formulation based on +!! the surface sublayer scheme in \cite zeng_and_dickinson_1998. module sfc_ex_coef contains @@ -17,48 +17,48 @@ end subroutine sfc_ex_coef_finalize !! This subroutine includes the surface roughness length formulation !! based on the surface sublayer scheme in \cite zeng_and_dickinson_1998. !> \section arg_table_sfc_ex_coef_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 | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | x component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | specific_humidity_at_lowest_model_layer | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | z1 | height_above_ground_at_lowest_model_layer | height above ground at 1st model layer | m | 1 | real | kind_phys | in | F | -!! | snwdph | surface_snow_thickness_water_equivalent | water equivalent surface snow thickness | mm | 1 | real | kind_phys | in | F | -!! | tskin | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | z0rl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | -!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | Model layer 1 mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | islimsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | -!! | ustar | surface_friction_velocity | surface friction velocity | m s-1 | 1 | real | kind_phys | inout | F | -!! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | -!! | sigmaf | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | vegtype | cell_vegetation_type | vegetation type at each grid cell | index | 1 | integer | | in | F | -!! | shdmax | maximum_vegetation_area_fraction | max fractnl cover of green veg | frac | 1 | real | kind_phys | in | F | -!! | ivegsrc | vegetation_type | vegetation type data source umd or igbp | index | 0 | integer | | in | F | -!! | z0pert | perturbation_of_momentum_roughness_length | perturbation of momentum roughness length | frac | 1 | real | kind_phys | in | F | -!! | ztpert | perturbation_of_heat_to_momentum_roughness_length_ratio | perturbation of heat to momentum roughness length ratio | frac | 1 | real | kind_phys | in | F | -!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | redrag | flag_for_reduced_drag_coefficient_over_sea | flag for reduced drag coefficient over sea | 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 | +!! |----------------|------------------------------------------------------------------------------|------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | u1 | x_wind_at_lowest_model_layer | x component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | +!! | v1 | y_wind_at_lowest_model_layer | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | +!! | t1 | air_temperature_at_lowest_model_layer | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | +!! | q1 | specific_humidity_at_lowest_model_layer | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | +!! | z1 | height_above_ground_at_lowest_model_layer | height above ground at 1st model layer | m | 1 | real | kind_phys | in | F | +!! | snwdph | surface_snow_thickness_water_equivalent | water equivalent surface snow thickness | mm | 1 | real | kind_phys | in | F | +!! | tskin | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | z0rl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F | +!! | cm | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | +!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | +!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | +!! | prsl1 | air_pressure_at_lowest_model_layer | Model layer 1 mean pressure | Pa | 1 | real | kind_phys | in | F | +!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | +!! | islimsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | +!! | ustar | surface_friction_velocity | surface friction velocity | m s-1 | 1 | real | kind_phys | inout | F | +!! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | +!! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | +!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | +!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | +!! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom | frac | 1 | real | kind_phys | in | F | +!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | +!! | shdmax | maximum_vegetation_area_fraction | max fractnl cover of green veg | frac | 1 | real | kind_phys | in | F | +!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | +!! | z0pert | perturbation_of_momentum_roughness_length | perturbation of momentum roughness length | frac | 1 | real | kind_phys | in | F | +!! | ztpert | perturbation_of_heat_to_momentum_roughness_length_ratio | perturbation of heat to momentum roughness length ratio | frac | 1 | real | kind_phys | in | F | +!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | in | F | +!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | +!! | redrag | flag_for_reduced_drag_coefficient_over_sea | flag for reduced drag coefficient over sea | 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 | !! !> \section general_diff GFS Surface Layer Scheme General Algorithm !! @{ !! -# Calculate the thermal roughness length formulation over the ocean (see eq. (25) and (26) -!! in \cite zeng_et_al_1998). +!! in \cite zeng_et_al_1998). !! -# Calculate Zeng's momentum roughness length formulation over land and sea ice. !! -# Calculate the new vegetation-dependent formulation of thermal roughness length (\cite zheng_et_al_2009). !! \cite zheng_et_al_2009 proposed a new formulation on @@ -388,7 +388,7 @@ subroutine sfc_ex_coef_run & ! ! finish the exchange coefficient computation to provide fm and fh ! -! - Finish the exchange coefficient computation to provide cm, ch, stress as input of other +! - Finish the exchange coefficient computation to provide cm, ch, stress as input of other ! \a sfc schemes. fm(i) = fm(i) - pm fh(i) = fh(i) - ph diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index c4f5fe27f..513aae26e 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -249,12 +249,12 @@ end subroutine lsm_noah_finalize !----------------------------------- ! subroutine sfc_drv & -! \defgroup Noah_Main GFS Noah Land Surface Model +! \defgroup Noah_Main GFS Noah Land Surface Model !> \defgroup Noah_drv GFS Noah LSM Driver -!! \brief This is Noah LSM driver module, with the functionality of +!! \brief This is Noah LSM driver module, with the functionality of !! preparing variables to run Noah LSM gfssflx(), calling Noah LSM and post-processing -!! variables for return to the parent model suite including unit conversion, as well -!! as diagnotics calculation. +!! variables for return to the parent model suite including unit conversion, as well +!! as diagnotics calculation. !! \section arg_table_lsm_noah_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| @@ -265,9 +265,9 @@ end subroutine lsm_noah_finalize !! | v1 | y_wind_at_lowest_model_layer | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | !! | t1 | air_temperature_at_lowest_model_layer | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | !! | q1 | specific_humidity_at_lowest_model_layer | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | soiltyp | cell_soil_type | soil type at each grid cell | index | 1 | integer | | in | F | -!! | vegtype | cell_vegetation_type | vegetation type at each grid cell | index | 1 | integer | | in | F | -!! | sigmaf | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | +!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | in | F | +!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | +!! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom| frac | 1 | real | kind_phys | in | F | !! | sfcemis | surface_longwave_emissivity | surface longwave emissivity | frac | 1 | real | kind_phys | in | F | !! | dlwflx | surface_downwelling_longwave_flux_absorbed_by_ground | total sky surface downward longwave flux absorbed by the ground | W m-2 | 1 | real | kind_phys | in | F | !! | dswsfc | surface_downwelling_shortwave_flux | total sky surface downward shortwave flux | W m-2 | 1 | real | kind_phys | in | F | @@ -281,15 +281,15 @@ end subroutine lsm_noah_finalize !! | zf | height_above_ground_at_lowest_model_layer | height above ground at 1st model layer | m | 1 | real | kind_phys | in | F | !! | islimsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | slopetyp | surface_slope_classification | class of sfc slope | index | 1 | integer | | in | F | +!! | slopetyp | surface_slope_classification | surface slope type at each grid cell | index | 1 | integer | | in | F | !! | shdmin | minimum_vegetation_area_fraction | min fractional coverage of green veg | frac | 1 | real | kind_phys | in | F | !! | shdmax | maximum_vegetation_area_fraction | max fractnl cover of green veg (not used) | frac | 1 | real | kind_phys | in | F | !! | snoalb | upper_bound_on_max_albedo_over_deep_snow | upper bound on max albedo over deep snow | frac | 1 | real | kind_phys | in | F | !! | sfalb | surface_diffused_shortwave_albedo | mean surface diffused shortwave albedo | frac | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | !! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | in | F | -!! | isot | soil_type | soil type (not used) | index | 0 | integer | | in | F | -!! | ivegsrc | vegetation_type | vegetation type data source umd or igbp | index | 0 | integer | | in | F | +!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | +!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | !! | bexppert | perturbation_of_soil_type_b_parameter | perturbation of soil type "b" parameter | frac | 1 | real | kind_phys | in | F | !! | xlaipert | perturbation_of_leaf_area_index | perturbation of leaf area index | frac | 1 | real | kind_phys | in | F | !! | vegfpert | perturbation_of_vegetation_fraction | perturbation of vegetation fraction | frac | 1 | real | kind_phys | in | F | @@ -512,7 +512,7 @@ subroutine lsm_noah_run & do i = 1, im if (flag_iter(i) .and. flag(i)) then -!> - Prepare variables to run Noah LSM: +!> - Prepare variables to run Noah LSM: !! - 1. configuration information (c): !!\n ---------------------------------------- !!\n \a couple - couple-uncouple flag (=1: coupled, =0: uncoupled) @@ -653,7 +653,7 @@ subroutine lsm_noah_run & bexpp = bexppert(i) ! sfc perts, mgehne xlaip = xlaipert(i) ! sfc perts, mgehne -!> - Call Noah LSM gfssflx(). +!> - Call Noah LSM gfssflx(). ! call sflx & call gfssflx & ! ccppdox: these is sflx in mpbl @@ -774,7 +774,7 @@ subroutine lsm_noah_run & enddo !> - Compute surface upward sensible heat flux (\a hflx) and evaporation -!! flux (\a evap). +!! flux (\a evap). do i = 1, im if (flag_iter(i) .and. flag(i)) then tem = 1.0 / rho(i) diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 8cd46ab0e..d4f86e1f4 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -391,7 +391,7 @@ subroutine sfc_nst_run & zsea2 = 0.001*real(nstf_name5) !> - Call module_nst_water_prop::density() to compute sea water density. -!> - Call module_nst_water_prop::rhocoef() to compute thermal expansion +!> - Call module_nst_water_prop::rhocoef() to compute thermal expansion !! coefficient (\a alpha) and saline contraction coefficient (\a beta). do i = 1, im if ( flag(i) ) then @@ -435,7 +435,7 @@ subroutine sfc_nst_run & rf_ts = (1000.*rain(i)/rho_w)*alfac*cp_w*(1.0+rch(i)*hl_ts) q_ts = rnl_ts + hs_ts + hl_ts + omg_sh*rf_ts ! -!> - Call cool_skin(), which is the sub-layer cooling parameterization +!> - Call cool_skin(), which is the sub-layer cooling parameterization !! (\cite fairall_et_al_1996). ! & calculate c_0, c_d ! @@ -531,7 +531,7 @@ subroutine sfc_nst_run & call sw_ps_9b(delz,fw) q_warm = fw*nswsfc(i)-f_nsol !total heat absorbed in warm layer -!> - Call cal_ttop() to calculate the diurnal warming amount at the top layer with +!> - Call cal_ttop() to calculate the diurnal warming amount at the top layer with !! thickness of \a dz. if ( q_warm > 0.0 ) then call cal_ttop(kdt,timestep,q_warm,rho_w,dz, @@ -721,7 +721,7 @@ end subroutine sfc_nst_pre_finalize !! | islimsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | !! | oro | orography | orography | m | 1 | real | kind_phys | in | F | !! | oro_uf | orography_unfiltered | unfiltered orographyo | m | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | ocean surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | tsurf | surface_skin_temperature_after_iteration | ocean surface skin temperature for guess run | K | 1 | real | kind_phys | inout | F | !! | tskin | surface_skin_temperature_for_nsst | ocean surface skin temperature | K | 1 | real | kind_phys | out | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | @@ -821,7 +821,7 @@ end subroutine sfc_nst_post_finalize !! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | !! | tsurf | surface_skin_temperature_after_iteration | ocean surface skin temperature for guess run | K | 1 | real | kind_phys | inout | F | !! | dtzm | mean_change_over_depth_in_sea_water_temperature | mean of dT(z) (zsea1 to zsea2) | K | 1 | real | kind_phys | out | F | -!! | tsfc | surface_skin_temperature | ocean surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 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 | !! diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index d22b79a83..34424b5a0 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -190,7 +190,7 @@ end subroutine sfc_sice_finalize !! | fice | sea_ice_concentration_for_physics | sea-ice concentration [0,1] | frac | 1 | real | kind_phys | inout | F | !! | tice | sea_ice_temperature_for_physics | sea-ice surface temperature | K | 1 | real | kind_phys | inout | F | !! | weasd | water_equivalent_accumulated_snow_depth | water equivalent accumulated snow depth | mm | 1 | real | kind_phys | inout | F | -!! | tskin | surface_skin_temperature | ground surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tskin | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | !! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | nonnegative precipitation amount in one dynamics time step | m | 1 | real | kind_phys | inout | F | !! | stc | soil_temperature | soil temp | K | 2 | real | kind_phys | inout | F | !! | ep | surface_upward_potential_latent_heat_flux | potential evaporation | W m-2 | 1 | real | kind_phys | inout | F | @@ -216,15 +216,15 @@ end subroutine sfc_sice_finalize !! \image html GFS_sice_wonton2000_fig1.png "Fig.1 Schematic representation of the three-layer model" width=5cm !! \image latex GFS_sice_wonton2000_fig1.eps "Schematic representation of the three-layer model" width=5cm !! The ice model main program ice3lay() performs two functions: -!! - \b Calculation \b of \b ice \b temperature +!! - \b Calculation \b of \b ice \b temperature !!\n The surface temperature is determined from the diagnostic balance between -!! the upward conduction of heat through snow and/or ice and upward flux of heat -!! from the surface. +!! the upward conduction of heat through snow and/or ice and upward flux of heat +!! from the surface. !! - \b Calculation \b of \b ice \b and \b snow \b changes !!\n In addition to calculating ice temperature changes, the ice model must !! also readjust the sizes of the snow and ice layers 1) to accommodate !! mass fluxes at the upper and lower surfaces, 2) to convert snow below -!! the water line to ice, and 3) to equalize the thickness of the two +!! the water line to ice, and 3) to equalize the thickness of the two !! ice layers. !> \section detailed_sice_run GFS Sea Ice Driver Detailed Algorithm !! @{ @@ -508,7 +508,7 @@ subroutine sfc_sice_run & hfi(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapi(i) & & + rch(i)*(tice(i) - theta1(i)) -!> - Calculate heat flux derivative at surface \a hfd. +!> - Calculate heat flux derivative at surface \a hfd. hfd(i) = 4.0*sfcemis(i)*sbc*tice(i)*t12 & & + (1.0 + elocp*eps*hvap*qs1/(rd*t12)) * rch(i) @@ -622,16 +622,16 @@ subroutine sfc_sice_run & !----------------------------------- -!> This subroutine is the entity of three-layer sea ice vertical thermodynamics +!> This subroutine is the entity of three-layer sea ice vertical thermodynamics !! based on \cite winton_2000 . !! @{ !!\ingroup gfs_sice_main !\param[in] im integer, horizontal dimension -!\param[in] kmi integer, number of ice layers (2) +!\param[in] kmi integer, number of ice layers (2) !\param[in] fice real, sea-ice concentration !\param[in] flag logical, ice mask flag !\param[in] hfi real, net non-solar and heat flux at surface (\f$W/m^2\f$) -!\param[in] hfd real, heat flux derivative at surface +!\param[in] hfd real, heat flux derivative at surface !\param[in] sneti real, net solar incoming at top (\f$W/m^2\f$) !\param[in] focn real, heat flux from ocean (\f$W/m^2\f$) !\param[in] delt real, time step(\f$sec\f$) @@ -795,12 +795,12 @@ subroutine ice3lay bi = hfd(i) ai = hfi(i) - sneti(i) + ip - tice(i)*bi ! +v sol input here -!> - Calculate the effective conductive coupling of the snow-ice layer +!> - Calculate the effective conductive coupling of the snow-ice layer !! between the surface and the upper layer ice temperature \f$h_i/4\f$ !! beneath the snow-ice interface (see \a eq.(5) in \cite winton_2000). k12 = ki4*ks / (ks*hice(i) + ki4*snowd(i)) -!> - Calculate the conductive coupling between the two ice temperature +!> - Calculate the conductive coupling between the two ice temperature !! points (see \a eq.(10) in \cite winton_2000). k32 = (ki+ki) / hice(i) @@ -816,14 +816,14 @@ subroutine ice3lay c1 = dili * tfi * dt2i * hice(i) !> - Calculate the new upper ice temperature following \a eq.(21) -!! in \cite winton_2000. +!! in \cite winton_2000. stsice(i,1) = -(sqrt(b1*b1 - 4.0*a1*c1) + b1)/(a1+a1) tice(i) = (k12*stsice(i,1) - ai) / (k12 + bi) !> - If the surface temperature is greater than the freezing temperature !! of snow (when there is snow over) or sea ice (when there is none), the !! surface temperature is fixed at the melting temperature of snow or sea -!! ice, respectively, and the upper ice temperature is recomputed from +!! ice, respectively, and the upper ice temperature is recomputed from !! \a eq.(21) using the coefficients given by \a eqs. (19),(20), and (18). An energy flux !! \a eq.(22) is applied toward surface melting thereby balancing the surface !! energy budget. @@ -844,7 +844,7 @@ subroutine ice3lay !> - Calculate the energy for bottom melting (or freezing, if negative) !! following \a eq.(23), which serves to balance the difference between -!! the oceanic heat flux to the ice bottom and the conductive flux of +!! the oceanic heat flux to the ice bottom and the conductive flux of !! heat upward from the bottom. bmelt = (focn(i) + ki4*(stsice(i,2) - tfw)/hice(i)) * delt @@ -939,5 +939,3 @@ end subroutine sfc_sice_run !! @} !! @} end module sfc_sice - - From 2c9e262d2c26cbb42ab6d36a8a19c968d11d604a Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 7 Aug 2018 10:15:29 -0600 Subject: [PATCH 2/2] update to GFS_surface_generic_post --- physics/GFS_surface_generic.f90 | 264 ++++++++++++++++++++++++++------ 1 file changed, 221 insertions(+), 43 deletions(-) diff --git a/physics/GFS_surface_generic.f90 b/physics/GFS_surface_generic.f90 index 38a6ecaed..4de1f57f2 100644 --- a/physics/GFS_surface_generic.f90 +++ b/physics/GFS_surface_generic.f90 @@ -132,65 +132,243 @@ end subroutine GFS_surface_generic_post_init subroutine GFS_surface_generic_post_finalize() end subroutine GFS_surface_generic_post_finalize - +#if 0 !> \section arg_table_GFS_surface_generic_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------|----------------------------------------------------------------------|------------|------|-----------------------|-----------|--------|----------| -!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx | upward_heat_flux_in_soil | upward soil heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | in | F | -!! | snowc | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | in | F | -!! | snohf | snow_freezing_rain_upward_latent_heat_flux | latent heat flux due to snow and frz rain | W m-2 | 1 | real | kind_phys | in | F | -!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_diag_type | | inout | F | -!! | Sfcprop | FV3-GFS_Sfcprop_type | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_sfcprop_type | | 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 | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | +!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | +!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | in | F | +!! | gflx | upward_heat_flux_in_soil | upward soil heat flux | W m-2 | 1 | real | kind_phys | in | F | +!! | tgrs_1 | air_temperature_at_lowest_model_layer | mean temperature at lowest model layer | K | 1 | real | kind_phys | in | F | +!! | qgrs_1 | specific_humidity_at_lowest_model_layer | specific humidity at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | +!! | ugrs_1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | +!! | vgrs_1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 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 | +!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjnirbmd | surface_downwelling_direct_near_infrared_shortwave_flux | surface downwelling beam near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjnirdfd | surface_downwelling_diffuse_near_infrared_shortwave_flux | surface downwelling diffuse near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjvisbmd | surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux | surface downwelling beam ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjvisdfd | surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux | surface downwelling diffuse ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjnirbmu | surface_upwelling_direct_near_infrared_shortwave_flux | surface upwelling beam near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjnirdfu | surface_upwelling_diffuse_near_infrared_shortwave_flux | surface upwelling diffuse near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjvisbmu | surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux | surface upwelling beam ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjvisdfu | surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux | surface upwelling diffuse ultraviolet plus visible shortwave flux at current time | W m-2 | 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 | +!! | 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 | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | 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 | +!! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | +!! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | +!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | in | F | +!! | snowc | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | in | F | +!! | snohf | snow_freezing_rain_upward_latent_heat_flux | latent heat flux due to snow and frz rain | W m-2 | 1 | real | kind_phys | in | F | +!! | con_eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | +!! | con_epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | +!! | epi | instantaneous_surface_potential_evaporation | instantaneous sfc potential evaporation | W m-2 | 1 | real | kind_phys | inout | F | +!! | gfluxi | instantaneous_surface_ground_heat_flux | instantaneous sfc ground heat flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | t1 | air_temperature_at_lowest_model_layer_for_diag | layer 1 temperature for diag | K | 1 | real | kind_phys | inout | F | +!! | q1 | specific_humidity_at_lowest_model_layer_for_diag | layer 1 specific humidity for diag | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | u1 | x_wind_at_lowest_model_layer_for_diag | layer 1 x wind for diag | m s-1 | 1 | real | kind_phys | inout | F | +!! | v1 | y_wind_at_lowest_model_layer_for_diag | layer 1 y wind for diag | m s-1 | 1 | real | kind_phys | inout | F | +!! | dlwsfci_cpl | instantaneous_surface_downwelling_longwave_flux_for_coupling | instantaneous sfc downward lw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | dswsfci_cpl | instantaneous_surface_downwelling_shortwave_flux_for_coupling | instantaneous sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | dlwsfc_cpl | cumulative_surface_downwelling_longwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc downward lw flux mulitplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | dswsfc_cpl | cumulative_surface_downwelling_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | dnirbmi_cpl | instantaneous_surface_downwelling_direct_near_infrared_shortwave_flux_for_coupling | instantaneous sfc nir beam downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | dnirdfi_cpl | instantaneous_surface_downwelling_diffuse_near_infrared_shortwave_flux_for_coupling | instantaneous sfc nir diff downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | dvisbmi_cpl | instantaneous_surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous sfc uv+vis beam downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | dvisdfi_cpl | instantaneous_surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous sfc uv+vis diff downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | dnirbm_cpl | cumulative_surface_downwelling_direct_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc nir beam downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | dnirdf_cpl | cumulative_surface_downwelling_diffuse_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc nir diff downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | dvisbm_cpl | cumulative_surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc uv+vis beam dnwd sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | dvisdf_cpl | cumulative_surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc uv+vis diff dnwd sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | nlwsfci_cpl | instantaneous_surface_net_downward_longwave_flux_for_coupling | instantaneous net sfc downward lw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | nlwsfc_cpl | cumulative_surface_net_downward_longwave_flux_for_coupling_multiplied_by_timestep | cumulative net downward lw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | t2mi_cpl | instantaneous_temperature_at_2m_for_coupling | instantaneous T2m | K | 1 | real | kind_phys | inout | F | +!! | q2mi_cpl | instantaneous_specific_humidity_at_2m_for_coupling | instantaneous Q2m | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | u10mi_cpl | instantaneous_x_wind_at_10m_for_coupling | instantaneous U10m | m s-1 | 1 | real | kind_phys | inout | F | +!! | v10mi_cpl | instantaneous_y_wind_at_10m_for_coupling | instantaneous V10m | m s-1 | 1 | real | kind_phys | inout | F | +!! | tsfci_cpl | instantaneous_surface_skin_temperature_for_coupling | instantaneous sfc temperature | K | 1 | real | kind_phys | inout | F | +!! | psurfi_cpl | instantaneous_surface_air_pressure_for_coupling | instantaneous sfc pressure | Pa | 1 | real | kind_phys | inout | F | +!! | nnirbmi_cpl | instantaneous_surface_net_downward_direct_near_infrared_shortwave_flux_for_coupling | instantaneous net nir beam sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | nnirdfi_cpl | instantaneous_surface_net_downward_diffuse_near_infrared_shortwave_flux_for_coupling | instantaneous net nir diff sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | nvisbmi_cpl | instantaneous_surface_net_downward_direct_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous net uv+vis beam downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | nvisdfi_cpl | instantaneous_surface_net_downward_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous net uv+vis diff downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | nswsfci_cpl | instantaneous_surface_net_downward_shortwave_flux_for_coupling | instantaneous net sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | nswsfc_cpl | cumulative_surface_net_downward_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | nnirbm_cpl | cumulative_surface_net_downward_direct_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net nir beam downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | nnirdf_cpl | cumulative_surface_net_downward_diffuse_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net nir diff downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | nvisbm_cpl | cumulative_surface_net_downward_direct_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net uv+vis beam downward sw rad flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | nvisdf_cpl | cumulative_surface_net_downward_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net uv+vis diff downward sw rad flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | gflux | cumulative_surface_ground_heat_flux_multiplied_by_timestep | cumulative groud conductive heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | evbsa | cumulative_soil_upward_latent_heat_flux_multiplied_by_timestep | cumulative soil upward latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | evcwa | cumulative_canopy_upward_latent_heat_flu_multiplied_by_timestep | cumulative canopy upward latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | transa | cumulative_transpiration_flux_multiplied_by_timestep | cumulative total plant transpiration rate multiplied by timestep | kg m-2 | 1 | real | kind_phys | inout | F | +!! | sbsnoa | cumulative_snow_deposition_sublimation_upward_latent_heat_flux_multiplied_by_timestep | cumulative latent heat flux from snow depo/subl multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | snowca | cumulative_surface_snow_area_fraction_multiplied_by_timestep | cumulative surface snow area fraction multiplied by timestep | s | 1 | real | kind_phys | inout | F | +!! | snohfa | cumulative_snow_freezing_rain_upward_latent_heat_flux_multiplied_by_timestep | cumulative latent heat flux due to snow and frz rain multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | ep | cumulative_surface_upward_potential_latent_heat_flux_multiplied_by_timestep | cumulative surface upward potential latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | +!! | tmpmin | minimum_temperature_at_2m | min temperature at 2m height | K | 1 | real | kind_phys | inout | F | +!! | tmpmax | maximum_temperature_at_2m | max temperature at 2m height | K | 1 | real | kind_phys | inout | F | +!! | spfhmin | minimum_specific_humidity_at_2m | minimum specific humidity at 2m height | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | spfhmax | maximum_specific_humidity_at_2m | maximum specific humidity at 2m height | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | wind10mmax | maximum_wind_at_10m | maximum wind speed at 10 m | m s-1 | 1 | real | kind_phys | inout | F | +!! | u10mmax | maximum_x_wind_at_10m | maximum x wind at 10 m | m s-1 | 1 | real | kind_phys | inout | F | +!! | v10mmax | maximum_y_wind_at_10m | maximum y wind at 10 m | m s-1 | 1 | real | kind_phys | inout | F | +!! | dpt2m | dewpoint_temperature_at_2m | 2 meter dewpoint temperature | K | 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 | !! - subroutine GFS_surface_generic_post_run (Model, Grid, ep1d, gflx, evbs, evcw, trans, sbsno, snowc, snohf, Diag, & - Sfcprop, errmsg, errflg) +#endif + subroutine GFS_surface_generic_post_run (im, cplflx, lssav, islmsk, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & + adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & + t2m, q2m, u10m, v10m, tsfc, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, con_eps, con_epsm1, & + epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & + dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, & + v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, & + nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, ep, tmpmin, tmpmax, spfhmin, & + spfhmax, wind10mmax, u10mmax, v10mmax, dpt2m, errmsg, errflg) use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type, GFS_grid_type, GFS_sfcprop_type, GFS_diag_type implicit none - type(GFS_control_type), intent(in) :: Model - type(GFS_grid_type), intent(in) :: Grid - type(GFS_sfcprop_type), intent(inout) :: Sfcprop - type(GFS_diag_type), intent(inout) :: Diag + integer, intent(in) :: im + logical, intent(in) :: cplflx, lssav + integer, dimension(im), intent(in) :: islmsk - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: ep1d, gflx, evbs, evcw, trans, sbsno, snowc, snohf + real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg + real(kind=kind_phys), dimension(im), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & + adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & + t2m, q2m, u10m, v10m, tsfc, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf + + real(kind=kind_phys), dimension(im), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & + dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & + nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & + nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & + evcwa, transa, sbsnoa, snowca, snohfa, ep, tmpmin, tmpmax, spfhmin, spfhmax, wind10mmax, u10mmax, v10mmax, dpt2m + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + real(kind=kind_phys), parameter :: albdf = 0.06 + + integer :: i + real(kind=kind_phys) :: tem, xcosz_loc, ocalnirdf_cpl, ocalnirbm_cpl, ocalvisdf_cpl, ocalvisbm_cpl ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - Diag%epi(:) = ep1d(:) - Diag%gfluxi(:) = gflx(:) - - if (Model%lssav) then - Diag%gflux(:) = Diag%gflux(:) + gflx(:) * Model%dtf - Diag%evbsa(:) = Diag%evbsa(:) + evbs(:) * Model%dtf - Diag%evcwa(:) = Diag%evcwa(:) + evcw(:) * Model%dtf - Diag%transa(:) = Diag%transa(:) + trans(:) * Model%dtf - Diag%sbsnoa(:) = Diag%sbsnoa(:) + sbsno(:) * Model%dtf - Diag%snowca(:) = Diag%snowca(:) + snowc(:) * Model%dtf - Diag%snohfa(:) = Diag%snohfa(:) + snohf(:) * Model%dtf - Diag%ep(:) = Diag%ep(:) + ep1d(:) * Model%dtf + do i=1,im + epi(i) = ep1d(i) + gfluxi(i) = gflx(i) + t1(i) = tgrs_1(i) + q1(i) = qgrs_1(i) + u1(i) = ugrs_1(i) + v1(i) = vgrs_1(i) + enddo + + if (cplflx) then + do i=1,im + dlwsfci_cpl (i) = adjsfcdlw(i) + dswsfci_cpl (i) = adjsfcdsw(i) + dlwsfc_cpl (i) = dlwsfc_cpl(i) + adjsfcdlw(i)*dtf + dswsfc_cpl (i) = dswsfc_cpl(i) + adjsfcdsw(i)*dtf + dnirbmi_cpl (i) = adjnirbmd(i) + dnirdfi_cpl (i) = adjnirdfd(i) + dvisbmi_cpl (i) = adjvisbmd(i) + dvisdfi_cpl (i) = adjvisdfd(i) + dnirbm_cpl (i) = dnirbm_cpl(i) + adjnirbmd(i)*dtf + dnirdf_cpl (i) = dnirdf_cpl(i) + adjnirdfd(i)*dtf + dvisbm_cpl (i) = dvisbm_cpl(i) + adjvisbmd(i)*dtf + dvisdf_cpl (i) = dvisdf_cpl(i) + adjvisdfd(i)*dtf + nlwsfci_cpl (i) = adjsfcdlw(i) - adjsfculw(i) + nlwsfc_cpl (i) = nlwsfc_cpl(i) + nlwsfci_cpl(i)*dtf + t2mi_cpl (i) = t2m(i) + q2mi_cpl (i) = q2m(i) + u10mi_cpl (i) = u10m(i) + v10mi_cpl (i) = v10m(i) + tsfci_cpl (i) = tsfc(i) + psurfi_cpl (i) = pgr(i) + enddo + + ! --- estimate mean albedo for ocean point without ice cover and apply + ! them to net SW heat fluxes + + do i=1,im + if (islmsk(i) /= 1) then ! not a land point + ! --- compute open water albedo + xcosz_loc = max( 0.0, min( 1.0, xcosz(i) )) + ocalnirdf_cpl = 0.06 + ocalnirbm_cpl = max(albdf, 0.026/(xcosz_loc**1.7+0.065) & + & + 0.15 * (xcosz_loc-0.1) * (xcosz_loc-0.5) & + & * (xcosz_loc-1.0)) + ocalvisdf_cpl = 0.06 + ocalvisbm_cpl = ocalnirbm_cpl + + nnirbmi_cpl(i) = adjnirbmd(i)-adjnirbmd(i)*ocalnirbm_cpl + nnirdfi_cpl(i) = adjnirdfd(i)-adjnirdfd(i)*ocalnirdf_cpl + nvisbmi_cpl(i) = adjvisbmd(i)-adjvisbmd(i)*ocalvisbm_cpl + nvisdfi_cpl(i) = adjvisdfd(i)-adjvisdfd(i)*ocalvisdf_cpl + else + nnirbmi_cpl(i) = adjnirbmd(i) - adjnirbmu(i) + nnirdfi_cpl(i) = adjnirdfd(i) - adjnirdfu(i) + nvisbmi_cpl(i) = adjvisbmd(i) - adjvisbmu(i) + nvisdfi_cpl(i) = adjvisdfd(i) - adjvisdfu(i) + endif + nswsfci_cpl(i) = nnirbmi_cpl(i) + nnirdfi_cpl(i) & + + nvisbmi_cpl(i) + nvisdfi_cpl(i) + nswsfc_cpl(i) = nswsfc_cpl(i) + nswsfci_cpl(i)*dtf + nnirbm_cpl(i) = nnirbm_cpl(i) + nnirbmi_cpl(i)*dtf + nnirdf_cpl(i) = nnirdf_cpl(i) + nnirdfi_cpl(i)*dtf + nvisbm_cpl(i) = nvisbm_cpl(i) + nvisbmi_cpl(i)*dtf + nvisdf_cpl(i) = nvisdf_cpl(i) + nvisdfi_cpl(i)*dtf + enddo + endif - Diag%tmpmax(:) = max(Diag%tmpmax(:),Sfcprop%t2m(:)) - Diag%tmpmin(:) = min(Diag%tmpmin(:),Sfcprop%t2m(:)) + if (lssav) then + do i=1,im + gflux(i) = gflux(i) + gflx(i) * dtf + evbsa(i) = evbsa(i) + evbs(i) * dtf + evcwa(i) = evcwa(i) + evcw(i) * dtf + transa(i) = transa(i) + trans(i) * dtf + sbsnoa(i) = sbsnoa(i) + sbsno(i) * dtf + snowca(i) = snowca(i) + snowc(i) * dtf + snohfa(i) = snohfa(i) + snohf(i) * dtf + ep(i) = ep(i) + ep1d(i) * dtf + + tmpmax(i) = max(tmpmax(i),t2m(i)) + tmpmin(i) = min(tmpmin(i),t2m(i)) + + spfhmax(i) = max(spfhmax(i),q2m(i)) + spfhmin(i) = min(spfhmin(i),q2m(i)) + enddo + + do i=1, im + ! find max wind speed then decompose + tem = sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) + if (tem > wind10mmax(i)) then + wind10mmax(i) = tem + u10mmax(i) = u10m(i) + v10mmax(i) = v10m(i) + endif + + ! Compute dew point, first using vapor pressure + tem = max(pgr(i) * q2m(i) / ( con_eps - con_epsm1 *q2m(i)), 1.e-8) + dpt2m(i) = 243.5 / ( ( 17.67 / log(tem/611.2) ) - 1.) + 273.14 + enddo - Diag%spfhmax(:) = max(Diag%spfhmax(:),Sfcprop%q2m(:)) - Diag%spfhmin(:) = min(Diag%spfhmin(:),Sfcprop%q2m(:)) endif end subroutine GFS_surface_generic_post_run