diff --git a/src/atmos_param/two_stream_gray_rad/two_stream_gray_rad.F90 b/src/atmos_param/two_stream_gray_rad/two_stream_gray_rad.F90 index 9849c30c0..0e1e047b6 100644 --- a/src/atmos_param/two_stream_gray_rad/two_stream_gray_rad.F90 +++ b/src/atmos_param/two_stream_gray_rad/two_stream_gray_rad.F90 @@ -418,16 +418,17 @@ subroutine two_stream_gray_rad_down (is, js, Time_diag, lat, lon, p_half, t, ! Seasonal Cycle: Use astronomical parameters to calculate insolation call get_time(Time_diag, seconds, days) call get_time(length_of_year(), year_in_s) - r_seconds = real(seconds) day_in_s = length_of_day() - frac_of_day = r_seconds / day_in_s + r_seconds = real(seconds) + r_days=real(days) + r_total_seconds=r_seconds+(r_days*86400.) + + frac_of_day = r_total_seconds / day_in_s if(solday .ge. 0) then r_solday=real(solday) frac_of_year = (r_solday*day_in_s) / year_in_s else - r_days=real(days) - r_total_seconds=r_seconds+(r_days*day_in_s) frac_of_year = r_total_seconds / year_in_s endif diff --git a/src/atmos_spectral/driver/solo/idealized_moist_phys.F90 b/src/atmos_spectral/driver/solo/idealized_moist_phys.F90 index 8115c08a2..1877fcbb1 100644 --- a/src/atmos_spectral/driver/solo/idealized_moist_phys.F90 +++ b/src/atmos_spectral/driver/solo/idealized_moist_phys.F90 @@ -8,7 +8,7 @@ module idealized_moist_phys_mod use fms_mod, only: write_version_number, file_exist, close_file, stdlog, error_mesg, NOTE, FATAL, read_data, field_size, uppercase, mpp_pe -use constants_mod, only: grav, rdgas, rvgas, cp_air, PSTD_MKS, dens_h2o !mj cp_air needed for rrtmg !s pstd_mks needed for pref calculation +use constants_mod, only: grav, rdgas, rvgas, cp_air, PSTD_MKS, dens_liquid !mj cp_air needed for rrtmg !s pstd_mks needed for pref calculation use time_manager_mod, only: time_type, get_time, operator( + ) @@ -424,9 +424,9 @@ subroutine idealized_moist_phys_init(Time, Time_step_in, nhum, rad_lon_2d, rad_l allocate (dt_bucket (is:ie, js:je)); dt_bucket = 0.0 ! RG Add bucket allocate (filt (is:ie, js:je)); filt = 0.0 ! RG Add bucket allocate(bucket_depth (is:ie, js:je, num_time_levels)); bucket_depth = init_bucket_depth ! RG Add bucket -allocate(depth_change_lh(is:ie, js:je)) ! RG Add bucket -allocate(depth_change_cond(is:ie, js:je)) ! RG Add bucket -allocate(depth_change_conv(is:ie, js:je)) ! RG Add bucket +allocate(depth_change_lh(is:ie, js:je)) ; depth_change_lh = 0.0 ! RG Add bucket +allocate(depth_change_cond(is:ie, js:je)) ; depth_change_cond = 0.0 ! RG Add bucket +allocate(depth_change_conv(is:ie, js:je)) ; depth_change_conv = 0.0 ! RG Add bucket allocate(z_surf (is:ie, js:je)) allocate(t_surf (is:ie, js:je)) allocate(q_surf (is:ie, js:je)); q_surf = 0.0 @@ -829,7 +829,7 @@ subroutine idealized_moist_phys(Time, p_half, p_full, z_half, z_full, ug, vg, tg conv_dt_tg = conv_dt_tg/delta_t conv_dt_qg = conv_dt_qg/delta_t - depth_change_conv = rain/dens_h2o ! RG Add bucket + depth_change_conv = rain/dens_liquid ! RG Add bucket rain = rain/delta_t precip = rain @@ -858,7 +858,7 @@ subroutine idealized_moist_phys(Time, p_half, p_full, z_half, z_full, ug, vg, tg conv_dt_tg = conv_dt_tg/delta_t conv_dt_qg = conv_dt_qg/delta_t - depth_change_conv = rain/dens_h2o ! RG Add bucket + depth_change_conv = rain/dens_liquid ! RG Add bucket rain = rain/delta_t precip = rain @@ -937,7 +937,7 @@ subroutine idealized_moist_phys(Time, p_half, p_full, z_half, z_full, ug, vg, tg cond_dt_tg = cond_dt_tg/delta_t cond_dt_qg = cond_dt_qg/delta_t - depth_change_cond = rain/dens_h2o ! RG Add bucket + depth_change_cond = rain/dens_liquid ! RG Add bucket rain = rain/delta_t snow = snow/delta_t precip = precip + rain + snow diff --git a/src/coupler/surface_flux.F90 b/src/coupler/surface_flux.F90 index 97a207f51..d802351e7 100644 --- a/src/coupler/surface_flux.F90 +++ b/src/coupler/surface_flux.F90 @@ -39,7 +39,7 @@ module surface_flux_mod use fms_mod, only: file_exist, check_nml_error, open_namelist_file, stdlog use monin_obukhov_mod, only: mo_drag, mo_profile use sat_vapor_pres_mod, only: escomp, descomp -use constants_mod, only: cp_air, hlv, stefan, rdgas, rvgas, grav, vonkarm, dens_h2o +use constants_mod, only: cp_air, hlv, stefan, rdgas, rvgas, grav, vonkarm, dens_liquid use mpp_mod, only: input_nml_file implicit none @@ -601,10 +601,10 @@ subroutine surface_flux_1d ( & flux_q = rho_drag * (q_surf0 - q_atm) ! flux of water vapor (Kg/(m**2 s)) end where - depth_change_lh_1d = flux_q * dt/dens_h2o + depth_change_lh_1d = flux_q * dt/dens_liquid where (flux_q > 0.0 .and. bucket_depth < depth_change_lh_1d) ! where more evaporation than what's in bucket, empty bucket - flux_q = bucket_depth * dens_h2o / dt - depth_change_lh_1d = flux_q * dt / dens_h2o + flux_q = bucket_depth * dens_liquid / dt + depth_change_lh_1d = flux_q * dt / dens_liquid end where where (bucket_depth <= 0.0) diff --git a/src/shared/constants/constants.F90 b/src/shared/constants/constants.F90 index 97c6d87d5..34e8379c4 100644 --- a/src/shared/constants/constants.F90 +++ b/src/shared/constants/constants.F90 @@ -94,36 +94,41 @@ module constants_mod ! Humidity factor. Controls the humidity content of the atmosphere through ! the Saturation Vapour Pressure expression when using DO_SIMPLE. ! -! +! ! gas constant for water vapor ! -! +! ! specific heat capacity of water vapor at constant pressure ! ! ! density of liquid water ! -! -! latent heat of evaporation +! +! latent heat of evaporation for water ! -! -! latent heat of fusion +! +! latent heat of fusion for water ! -! -! latent heat of sublimation +! +! latent heat of sublimation for water ! -! +! ! temp where fresh water freezes ! +! +! Pressure of Triple Point: prefactor in version of +! Clausius-Clapeyron when using DO_SIMPLE. +! real, public, parameter :: DEF_ES0 = 1.0 -real, public, parameter :: RVGAS = 461.50 -real, public, parameter :: CP_VAPOR = 4.0*RVGAS +real, public, parameter :: RVGAS_H2O = 461.50 +real, public, parameter :: CP_VAPOR_H2O = 4.0*RVGAS_H2O real, public, parameter :: DENS_H2O = 1000. -real, public, parameter :: HLV = 2.500e6 -real, public, parameter :: HLF = 3.34e5 -real, public, parameter :: HLS = HLV + HLF -real, public, parameter :: TFREEZE = 273.16 +real, public, parameter :: HLV_H2O = 2.500e6 +real, public, parameter :: HLF_H2O = 3.34e5 +real, public, parameter :: HLS_H2O = HLV_H2O + HLF_H2O +real, public, parameter :: TFREEZE_H2O = 273.16 +real, public, parameter :: TPPRESS_H2O = 610.78 !-------------- radiation constants ----------------- @@ -164,7 +169,7 @@ module constants_mod ! real, public, parameter :: WTMAIR = 2.896440E+01 -real, public, parameter :: WTMH2O = WTMAIR*(EARTH_RDGAS/RVGAS) !pjp OK to change value because not used yet. +real, public, parameter :: WTMH2O = WTMAIR*(EARTH_RDGAS/RVGAS_H2O) !pjp OK to change value because not used yet. !real, public, parameter :: WTMO3 = 47.99820E+01 real, public, parameter :: WTMOZONE = 47.99820 real, public, parameter :: WTMC = 12.00000 @@ -254,6 +259,7 @@ module constants_mod real, public :: RADIUS = 6376.0e3 real, public :: GRAV = EARTH_GRAV real, public :: OMEGA = EARTH_OMEGA ! planetary rotation rate in s^-1 +real, public :: ROTATION_PERIOD = -1.0 real, public :: ORBITAL_PERIOD = EARTH_ORBITAL_PERIOD ! orbital period (periapse -> periapse) in s real, public :: SECONDS_PER_SOL = SECONDS_PER_DAY real, public :: orbital_rate ! this is calculated from 2pi/orbital_period @@ -262,12 +268,20 @@ module constants_mod real, public :: PSTD = 1.013250E+06 real, public :: PSTD_MKS = PSTD_MKS_EARTH real, public :: RDGAS = EARTH_RDGAS +real, public :: RVGAS = RVGAS_H2O +real, public :: CP_VAPOR = 4.0*RVGAS_H2O +real, public :: DENS_LIQUID = DENS_H2O real, public :: KAPPA = EARTH_KAPPA real, public :: CP_AIR = EARTH_CP_AIR +real, public :: HLV = HLV_H2O +real, public :: HLF = HLF_H2O +real, public :: HLS = HLS_H2O +real, public :: TFREEZE = TFREEZE_H2O +real, public :: TPPRESS = TPPRESS_H2O real, public :: es0 = DEF_ES0 logical :: earthday_multiple = .false. -namelist/constants_nml/ radius, grav, omega, orbital_period, pstd, pstd_mks, rdgas, kappa, solar_const, earthday_multiple, es0 +namelist/constants_nml/ radius, grav, omega, orbital_period, orbital_rate, rotation_period, pstd, pstd_mks, rdgas, rvgas, kappa, hlv, hlf, tfreeze, tppress, dens_liquid, solar_const, earthday_multiple, es0 !----------------------------------------------------------------------- ! version and tagname published @@ -298,6 +312,13 @@ subroutine constants_init 10 call close_file (unit) if (mpp_pe() == mpp_root_pe()) write (stdlog(),nml=constants_nml) + + if (rotation_period.gt.0) then + omega = 2.*pi/rotation_period + + call error_mesg( 'constants_init','rotation_period has been specified, so omega calculated from rotation_period', NOTE) + + endif !> SECONDS_PER_SOL is the exoplanet equivalent of seconds_per_day. !! It is the number of seconds between sucessive solar zeniths at longitude 0. @@ -314,6 +335,8 @@ subroutine constants_init endif CP_AIR = RDGAS/KAPPA + CP_VAPOR = 4.0*RVGAS + HLS = HLV + HLF constants_initialised = .true. diff --git a/src/shared/sat_vapor_pres/sat_vapor_pres.F90 b/src/shared/sat_vapor_pres/sat_vapor_pres.F90 index 1e1a6f3aa..127035814 100644 --- a/src/shared/sat_vapor_pres/sat_vapor_pres.F90 +++ b/src/shared/sat_vapor_pres/sat_vapor_pres.F90 @@ -132,7 +132,7 @@ module sat_vapor_pres_mod ! Description summarizing public interface. ! - use constants_mod, only: TFREEZE, RDGAS, RVGAS, HLV, ES0 + use constants_mod, only: TFREEZE, TFREEZE_H2O, RDGAS, RVGAS, HLV, ES0, TPPRESS use fms_mod, only: write_version_number, stdout, stdlog, mpp_pe, mpp_root_pe, & mpp_error, FATAL, fms_error_handler, open_namelist_file, & error_mesg, & @@ -2309,8 +2309,8 @@ subroutine sat_vapor_pres_init(err_msg) endif nsize = (tcmax-tcmin)*esres+1 nlim = nsize-1 - call sat_vapor_pres_init_k(nsize, real(tcmin), real(tcmax), TFREEZE, HLV, & - RVGAS, ES0, err_msg_local, use_exact_qs, do_simple, & + call sat_vapor_pres_init_k(nsize, real(tcmin), real(tcmax), TFREEZE, TFREEZE_H2O, HLV, & + RVGAS, ES0, TPPRESS, err_msg_local, use_exact_qs, do_simple, & construct_table_wrt_liq, & construct_table_wrt_liq_and_ice, & teps, tmin, dtinv) diff --git a/src/shared/sat_vapor_pres/sat_vapor_pres_k.F90 b/src/shared/sat_vapor_pres/sat_vapor_pres_k.F90 index 1c1cded34..f17997034 100644 --- a/src/shared/sat_vapor_pres/sat_vapor_pres_k.F90 +++ b/src/shared/sat_vapor_pres/sat_vapor_pres_k.F90 @@ -158,7 +158,7 @@ module sat_vapor_pres_k_mod contains - subroutine sat_vapor_pres_init_k(table_size, tcmin, tcmax, TFREEZE, HLV, RVGAS, ES0, err_msg, & + subroutine sat_vapor_pres_init_k(table_size, tcmin, tcmax, TFREEZE, TFREEZE_H2O, HLV, RVGAS, ES0, TPPRESS, err_msg, & use_exact_qs_input, do_simple, & construct_table_wrt_liq, & construct_table_wrt_liq_and_ice, & @@ -169,7 +169,7 @@ subroutine sat_vapor_pres_init_k(table_size, tcmin, tcmax, TFREEZE, HLV, RVGAS, integer, intent(in) :: table_size real, intent(in) :: tcmin ! TABLE(1) = sat vapor pressure at temperature tcmin (deg C) real, intent(in) :: tcmax ! TABLE(table_size) = sat vapor pressure at temperature tcmax (deg C) - real, intent(in) :: TFREEZE, HLV, RVGAS, ES0 + real, intent(in) :: TFREEZE, TFREEZE_H2O, HLV, RVGAS, ES0, TPPRESS logical, intent(in) :: use_exact_qs_input, do_simple logical, intent(in) :: construct_table_wrt_liq logical, intent(in) :: construct_table_wrt_liq_and_ice @@ -212,7 +212,7 @@ subroutine sat_vapor_pres_init_k(table_size, tcmin, tcmax, TFREEZE, HLV, RVGAS, table_siz = table_size dtres = (tcmax - tcmin)/(table_size-1) - tminl = real(tcmin)+TFREEZE ! minimum valid temp in table + tminl = real(tcmin)+TFREEZE_H2O ! minimum valid temp in table. Always use TFREEZE_WATER here, as this is just converting tcmin from celcius to kelvin. dtinvl = 1./dtres tepsl = .5*dtres tinrc = .1*dtres @@ -234,7 +234,7 @@ subroutine sat_vapor_pres_init_k(table_size, tcmin, tcmax, TFREEZE, HLV, RVGAS, do i = 1, table_size tem(1) = tminl + dtres*real(i-1) - TABLE(i) = ES0*610.78*exp(-hlv/rvgas*(1./tem(1) - 1./tfreeze)) + TABLE(i) = ES0*tppress*exp(-hlv/rvgas*(1./tem(1) - 1./tfreeze)) DTABLE(i) = hlv*TABLE(i)/rvgas/tem(1)**2. enddo