diff --git a/.gitmodules b/.gitmodules index 9dba021a80..4b1ed7a112 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,10 +43,10 @@ [submodule "fv3"] path = src/dynamics/fv3 - url = https://github.com/ESCOMP/CAM_FV3_interface.git + url = https://github.com/jtruesdal/CAM_FV3_interface.git fxrequired = AlwaysRequired - fxtag = fv3int_061924 - fxDONOTUSEurl = https://github.com/ESCOMP/CAM_FV3_interface.git + fxtag = fv3int_nh_121825 + fxDONOTUSEurl = https://github.com/jtruesdal/CAM_FV3_interface.git [submodule "geoschem"] path = src/chemistry/geoschem/geoschem_src diff --git a/bld/build-namelist b/bld/build-namelist index b9fd1328a1..a8e615fe59 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -4108,7 +4108,9 @@ if ($dyn eq 'fv') { # FV3 dycore if ( $dyn eq 'fv3') { - + add_default($nl, 'fv3_a_imp'); + add_default($nl, 'fv3_p_fac'); + add_default($nl, 'fv3_use_logp'); add_default($nl, 'fv3_adjust_dry_mass'); add_default($nl, 'fv3_beta'); add_default($nl, 'fv3_clock_grain'); diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 83333e0700..9d97e994c4 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -3114,6 +3114,9 @@ .true. + 1.0D0 + 0.05D0 + .false. .false. 0 .false. diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 1cfe3b794d..225852dfab 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -9352,6 +9352,42 @@ Default: none + +Real: Controls behavior of the non-hydrostatic solver. Values greater +than 0.5 enable the semi-implicit solver, in which the value of a_imp +controls the time-off-centering: use a_imp = 1.0 for a fully backward +time-stepping. For consistency, the sum of beta and a_imp should +be 1 when the semi-implicit solver is used. The semi-implicit algo- +rithm is substantially more efficient except at very high (km-scale) +resolutions with an acoustic time step of a few seconds or less. 0.75 +by default. Proper values are 0, or between 0.5 and 1. This variable is +only used if hydrostatic =.false. +Default: 1. + + + +Real: Safety factor for minimum nonhydrostatic pressures, which +will be limited so the full pressure is no less than p_fac times the +hydrostatic pressure. This is only of concern in mid-top or high- +top models with very low pressures near the model top, and has +no effect in most simulations. The pressure limiting activates only +when model is in danger of blowup due to unphysical negative +total pressures. 0.05 by default. Only used if hydrostatic =.false. +and the semi-implicit solver is used. Proper range is 0 to 0.25. +Default: 0.05 + + + +Logical: Enables a variant of the Lin pressure-gradient force +algorithm, which uses the logarithm of pressure instead of the Exner +function (as in Lin 1997). This yields more accurate results for re- +gions that are nearly isothermal. Ignored if hydrostatic = true. +Default: FALSE + + The level of clock granularity used for performance timing sections diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 23585e901a..2dbaa0d426 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -372,8 +372,6 @@ co2_cycle_rad_passive=.true. use_hemco=.true. - - rearth = 6.37122D6 run_component_cam env_run.xml diff --git a/src/dynamics/fv3 b/src/dynamics/fv3 index 66227690a9..d6d14976ff 160000 --- a/src/dynamics/fv3 +++ b/src/dynamics/fv3 @@ -1 +1 @@ -Subproject commit 66227690a9fb43a64492de32de14562a25ede717 +Subproject commit d6d14976ff20521141f652c63e455730e680299a diff --git a/src/dynamics/tests/inic_analytic.F90 b/src/dynamics/tests/inic_analytic.F90 index 5722d865e3..bcebfe75cf 100644 --- a/src/dynamics/tests/inic_analytic.F90 +++ b/src/dynamics/tests/inic_analytic.F90 @@ -38,8 +38,8 @@ module inic_analytic CONTAINS !============================================================================== - subroutine dyn_set_inic_col(vcoord, latvals, lonvals, glob_ind, zint, U, V, T, & - PS, PHIS_IN, PHIS_OUT, Q, m_cnst, mask, verbose) + subroutine dyn_set_inic_col(vcoord, latvals, lonvals, glob_ind, zint, U, V, W, & + T, PS, PHIS_IN, PHIS_OUT, Q, m_cnst, mask, verbose) use cam_initfiles, only: pertlim #ifdef ANALYTIC_IC use ic_held_suarez, only: hs94_set_ic @@ -62,6 +62,7 @@ subroutine dyn_set_inic_col(vcoord, latvals, lonvals, glob_ind, zint, U, V, T, & real(r8), optional, intent(in) :: zint(:,:) ! height at layer interfaces real(r8), optional, intent(inout) :: U(:,:) ! zonal velocity real(r8), optional, intent(inout) :: V(:,:) ! meridional velocity + real(r8), optional, intent(inout) :: W(:,:) ! vertical velocity (nonhydrostatic) real(r8), optional, intent(inout) :: T(:,:) ! temperature real(r8), optional, intent(inout) :: PS(:) ! surface pressure real(r8), optional, intent(in) :: PHIS_IN(:) ! surface geopotential @@ -116,6 +117,13 @@ subroutine dyn_set_inic_col(vcoord, latvals, lonvals, glob_ind, zint, U, V, T, & return end if end if + if (present(W)) then + if (size(W) > 0) then + call check_array_size(W(:,1), 'W', latvals, subname) + else + return + end if + end if if (present(T)) then if (size(T) > 0) then call check_array_size(T(:,1), 'T', latvals, subname) @@ -160,20 +168,20 @@ subroutine dyn_set_inic_col(vcoord, latvals, lonvals, glob_ind, zint, U, V, T, & end if select case(trim(analytic_ic_type)) case('held_suarez_1994') - call hs94_set_ic(latvals, lonvals, U=U, V=V, T=T, PS=PS, PHIS=PHIS_OUT, & + call hs94_set_ic(latvals, lonvals, U=U, V=V, W=W, T=T, PS=PS, PHIS=PHIS_OUT, & Q=Q, m_cnst=m_cnst, mask=mask_use, verbose=verbose_use) case('moist_baroclinic_wave_dcmip2016', 'dry_baroclinic_wave_dcmip2016') - call bc_wav_set_ic(vcoord, latvals, lonvals, zint=zint, U=U, V=V, T=T, PS=PS, & - PHIS=PHIS_OUT, Q=Q, m_cnst=m_cnst, mask=mask_use, verbose=verbose_use) + call bc_wav_set_ic(vcoord, latvals, lonvals, zint=zint, U=U, V=V, W=W, T=T, & + PS=PS, PHIS=PHIS_OUT, Q=Q, m_cnst=m_cnst, mask=mask_use, verbose=verbose_use) case('dry_baroclinic_wave_jw2006') - call bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U=U, V=V, T=T, PS=PS, & + call bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U=U, V=V, W=W, T=T, PS=PS, & PHIS=PHIS_OUT, Q=Q, m_cnst=m_cnst, mask=mask_use, verbose=verbose_use) case('us_standard_atmosphere') - call us_std_atm_set_ic(latvals, lonvals, zint=zint, U=U, V=V, T=T, PS=PS, PHIS_IN=PHIS_IN, & - PHIS_OUT=PHIS_OUT, Q=Q, m_cnst=m_cnst, mask=mask_use, verbose=verbose_use) + call us_std_atm_set_ic(latvals, lonvals, zint=zint, U=U, V=V, W=W, T=T, PS=PS, & + PHIS_IN=PHIS_IN, PHIS_OUT=PHIS_OUT, Q=Q, m_cnst=m_cnst, mask=mask_use, verbose=verbose_use) case default call endrun(subname//': Unknown analytic_ic_type, "'//trim(analytic_ic_type)//'"') @@ -216,7 +224,7 @@ subroutine dyn_set_inic_col(vcoord, latvals, lonvals, glob_ind, zint, U, V, T, & end subroutine dyn_set_inic_col - subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & + subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, W, T, & PS, PHIS_IN, PHIS_OUT, Q, m_cnst, mask) !----------------------------------------------------------------------- ! @@ -231,6 +239,7 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & integer, intent(in) :: glob_ind(:) ! global column index real(r8), optional, intent(inout) :: U(:,:,:) ! zonal velocity real(r8), optional, intent(inout) :: V(:,:,:) ! meridional velocity + real(r8), optional, intent(inout) :: W(:,:,:) ! vertical velocity (nonhydrostatic) real(r8), optional, intent(inout) :: T(:,:,:) ! temperature real(r8), optional, intent(inout) :: PS(:,:) ! surface pressure real(r8), optional, intent(in) :: PHIS_IN(:,:)! surface geopotential @@ -259,6 +268,9 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & if(present(V)) then call get_input_shape(V, 'V', mname, size1, size2, size3, subname) end if + if(present(W)) then + call get_input_shape(W, 'W', mname, size1, size2, size3, subname) + end if if(present(T)) then call get_input_shape(T, 'T', mname, size1, size2, size3, subname) end if @@ -301,6 +313,10 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), V=V(:,:,i), mask=mask(bbeg:bend), verbose=verbose) end if + if (present(W)) then + call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & + glob_ind(bbeg:bend), W=W(:,:,i), mask=mask(bbeg:bend), verbose=verbose) + end if if (present(PS).and.present(PHIS_IN).and.present(T)) then call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), PS=PS(:,i), PHIS_IN=PHIS_IN(:,i), T=T(:,:,i), & @@ -333,6 +349,10 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), V=V(:,:,i), verbose=verbose) end if + if (present(W)) then + call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & + glob_ind(bbeg:bend), W=W(:,:,i), verbose=verbose) + end if if (present(PS).and.present(PHIS_IN).and.present(T)) then call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), PHIS_IN=PHIS_IN(:,i),PS=PS(:,i),T=T(:,:,i), & @@ -382,6 +402,10 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), V=V(:,i,:), mask=mask(bbeg:bend), verbose=verbose) end if + if (present(W)) then + call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & + glob_ind(bbeg:bend), W=W(:,i,:), mask=mask(bbeg:bend), verbose=verbose) + end if if (present(PS).and.present(PHIS_IN).and.present(T)) then call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), PHIS_IN=PHIS_IN(:,i),PS=PS(:,i),T=T(:,i,:), & @@ -414,6 +438,10 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), V=V(:,i,:), verbose=verbose) end if + if (present(W)) then + call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & + glob_ind(bbeg:bend), W=W(:,i,:), verbose=verbose) + end if if (present(PS).and.present(PHIS_IN).and.present(T)) then call dyn_set_inic_col(vcoord,latvals(bbeg:bend), lonvals(bbeg:bend), & glob_ind(bbeg:bend), PHIS_IN=PHIS_IN(:,i),PS=PS(:,i),T=T(:,i,:), & @@ -463,6 +491,10 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & call dyn_set_inic_col(vcoord,lat_use, lonvals, glob_ind(bbeg:bend), & V=V(:,i,:), verbose=verbose) end if + if (present(W)) then + call dyn_set_inic_col(vcoord,lat_use, lonvals, glob_ind(bbeg:bend), & + W=W(:,i,:), verbose=verbose) + end if if (present(PS).and.present(PHIS_IN).and.present(T)) then call dyn_set_inic_col(vcoord,lat_use, lonvals, glob_ind(bbeg:bend), & PS=PS(:,i),T=T(:,i,:),PHIS_IN=PHIS_IN(:,i), verbose=verbose) @@ -511,6 +543,10 @@ subroutine dyn_set_inic_cblock(vcoord,latvals, lonvals, glob_ind, U, V, T, & call dyn_set_inic_col(vcoord,lat_use, lonvals, glob_ind(bbeg:bend), & V=V(:,:,i), verbose=verbose) end if + if (present(W)) then + call dyn_set_inic_col(vcoord,lat_use, lonvals, glob_ind(bbeg:bend), & + W=W(:,:,i), verbose=verbose) + end if if (present(PS).and.present(PHIS_IN).and.present(T)) then call dyn_set_inic_col(vcoord,lat_use, lonvals, glob_ind(bbeg:bend), & T=T(:,:,i),PS=PS(:,i), PHIS_IN=PHIS_IN(:,i), verbose=verbose) diff --git a/src/dynamics/tests/initial_conditions/ic_baro_dry_jw06.F90 b/src/dynamics/tests/initial_conditions/ic_baro_dry_jw06.F90 index 86058ef027..9bcbadcffe 100644 --- a/src/dynamics/tests/initial_conditions/ic_baro_dry_jw06.F90 +++ b/src/dynamics/tests/initial_conditions/ic_baro_dry_jw06.F90 @@ -48,7 +48,7 @@ module ic_baro_dry_jw06 contains - subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, T, PS, PHIS, & + subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, W, T, PS, PHIS, & Q, m_cnst, mask, verbose) use dyn_tests_utils, only: vc_moist_pressure, vc_dry_pressure, vc_height use constituents, only: cnst_name @@ -67,6 +67,7 @@ subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, T, PS, PHIS, & ! z_k for vccord 1) real(r8), optional, intent(inout) :: U(:,:) ! zonal velocity real(r8), optional, intent(inout) :: V(:,:) ! meridional velocity + real(r8), optional, intent(inout) :: W(:,:) ! vertical velocity (nonhydrostatic) real(r8), optional, intent(inout) :: T(:,:) ! temperature real(r8), optional, intent(inout) :: PS(:) ! surface pressure real(r8), optional, intent(out) :: PHIS(:) ! surface geopotential @@ -77,7 +78,7 @@ subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, T, PS, PHIS, & ! Local variables logical, allocatable :: mask_use(:) logical :: verbose_use - logical :: lu,lv,lt,lq,l3d_vars + logical :: lu,lv,lw,lt,lq,l3d_vars integer :: i, k, m integer :: ncol integer :: nlev @@ -91,8 +92,8 @@ subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, T, PS, PHIS, & real(r8) :: phi_vertical real(r8) :: u_wind(size(latvals)) - a_omega = rearth*omega - exponent = rair*gamma/gravit + a_omega = rearth*omega + exponent = rair*gamma/gravit allocate(mask_use(size(latvals))) if (present(mask)) then @@ -163,13 +164,15 @@ subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, T, PS, PHIS, & ! lu = present(U) lv = present(V) + lw = present(W) lT = present(T) lq = present(Q) - l3d_vars = lu .or. lv .or. lt .or.lq + l3d_vars = lu .or. lv .or. lw .or. lt .or.lq nlev = -1 if (l3d_vars) then if (lu) nlev = size(U, 2) if (lv) nlev = size(V, 2) + if (lw) nlev = size(W, 2) if (lt) nlev = size(T, 2) if (lq) nlev = size(Q, 2) @@ -201,6 +204,16 @@ subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, T, PS, PHIS, & write(iulog,*) ' V initialized by "',subname,'"' end if end if + if (lw) then + do k = 1, nlev + where(mask_use) + W(:,k) = 0.0_r8 + end where + end do + if(masterproc.and. verbose_use) then + write(iulog,*) ' W (nonhydrostatic) initialized by "',subname,'"' + end if + end if if (lt) then do k = 1, nlev eta = hyam(k) + hybm(k) @@ -232,7 +245,7 @@ subroutine bc_dry_jw06_set_ic(vcoord, latvals, lonvals, U, V, T, PS, PHIS, & end where end do if(masterproc.and. verbose_use) then - write(iulog,*) ' ', trim(cnst_name(m_cnst(1))), ' initialized by "',subname,'"' + write(iulog,*) ' ', trim(cnst_name(m_cnst(1))), ' initialized by "',subname,'"' end if end if end if diff --git a/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 b/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 index 19d9dad35f..8aa2b3f7eb 100644 --- a/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 +++ b/src/dynamics/tests/initial_conditions/ic_baroclinic.F90 @@ -73,7 +73,7 @@ module ic_baroclinic contains - subroutine bc_wav_set_ic(vcoord,latvals, lonvals, zint, U, V, T, PS, PHIS, & + subroutine bc_wav_set_ic(vcoord,latvals, lonvals, zint, U, V, W, T, PS, PHIS, & Q, m_cnst, mask, verbose) use dyn_tests_utils, only: vc_moist_pressure, vc_dry_pressure, vc_height use constituents, only: cnst_name @@ -93,6 +93,7 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, zint, U, V, T, PS, PHIS, & real(r8), optional, intent(in) :: zint(:,:) ! interface height (ncol,ilev), ordered top to bottom real(r8), optional, intent(inout) :: U(:,:) ! zonal velocity real(r8), optional, intent(inout) :: V(:,:) ! meridional velocity + real(r8), optional, intent(inout) :: W(:,:) ! vertical velocity (nonhydrostatic) real(r8), optional, intent(inout) :: T(:,:) ! temperature real(r8), optional, intent(inout) :: PS(:) ! surface pressure real(r8), optional, intent(out) :: PHIS(:) ! surface geopotential @@ -113,7 +114,7 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, zint, U, V, T, PS, PHIS, & real(r8) :: uk,vk,Tvk,qk,pk !mid-level state real(r8) :: psurface real(r8) :: wvp,qdry - logical :: lU, lV, lT, lQ, l3d_vars + logical :: lu, lv, lw, lt, lq, l3d_vars logical :: cnst1_is_moisture real(r8), allocatable :: pdry_half(:), pwet_half(:),zdry_half(:),zk(:) real(r8), allocatable :: zmid(:,:) ! layer midpoint heights for test tracer initialization @@ -214,13 +215,15 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, zint, U, V, T, PS, PHIS, & ! lu = present(U) lv = present(V) - lT = present(T) + lw = present(W) + lt = present(T) lq = present(Q) - l3d_vars = lu .or. lv .or. lt .or. lq + l3d_vars = lu .or. lv .or. lw .or. lt .or. lq nlev = -1 if (l3d_vars) then if (lu) nlev = size(U, 2) if (lv) nlev = size(V, 2) + if (lw) nlev = size(W, 2) if (lt) nlev = size(T, 2) if (lq) then @@ -334,6 +337,17 @@ subroutine bc_wav_set_ic(vcoord,latvals, lonvals, zint, U, V, T, PS, PHIS, & ' ', trim(cnst_name(m_cnst(1))), ' initialized by "',subname,'"' end if + if (lw) then + do k = 1, nlev + where(mask_use) + W(:,k) = 0.0_r8 + end where + end do + if(masterproc.and. verbose_use) then + write(iulog,*) ' W (nonhydrostatic) initialized by "',subname,'"' + end if + end if + if (lq) then ncnst = size(m_cnst, 1) diff --git a/src/dynamics/tests/initial_conditions/ic_held_suarez.F90 b/src/dynamics/tests/initial_conditions/ic_held_suarez.F90 index e257571ced..8f5aa37517 100644 --- a/src/dynamics/tests/initial_conditions/ic_held_suarez.F90 +++ b/src/dynamics/tests/initial_conditions/ic_held_suarez.F90 @@ -22,7 +22,7 @@ module ic_held_suarez CONTAINS !============================================================================== - subroutine hs94_set_ic(latvals, lonvals, U, V, T, PS, PHIS, & + subroutine hs94_set_ic(latvals, lonvals, U, V, W, T, PS, PHIS, & Q, m_cnst, mask, verbose) use const_init, only: cnst_init_default use constituents, only: cnst_name @@ -38,6 +38,7 @@ subroutine hs94_set_ic(latvals, lonvals, U, V, T, PS, PHIS, & real(r8), intent(in) :: lonvals(:) ! lon in degrees (ncol) real(r8), optional, intent(inout) :: U(:,:) ! zonal velocity real(r8), optional, intent(inout) :: V(:,:) ! meridional velocity + real(r8), optional, intent(inout) :: W(:,:) ! vertical velocity (nonhydrostatic) real(r8), optional, intent(inout) :: T(:,:) ! temperature real(r8), optional, intent(inout) :: PS(:) ! surface pressure real(r8), optional, intent(out) :: PHIS(:) ! surface geopotential @@ -97,6 +98,18 @@ subroutine hs94_set_ic(latvals, lonvals, U, V, T, PS, PHIS, & end if end if + if (present(W)) then + nlev = size(W, 2) + do k = 1, nlev + where(mask_use) + W(:,k) = 0.0_r8 + end where + end do + if(masterproc .and. verbose_use) then + write(iulog,*) ' W (nonhydrostatic) initialized by "',subname,'"' + end if + end if + if (present(T)) then nlev = size(T, 2) do k = 1, nlev diff --git a/src/dynamics/tests/initial_conditions/ic_us_standard_atm.F90 b/src/dynamics/tests/initial_conditions/ic_us_standard_atm.F90 index b97fa35979..71c96549e3 100644 --- a/src/dynamics/tests/initial_conditions/ic_us_standard_atm.F90 +++ b/src/dynamics/tests/initial_conditions/ic_us_standard_atm.F90 @@ -30,7 +30,7 @@ module ic_us_standard_atmosphere CONTAINS !========================================================================================= -subroutine us_std_atm_set_ic(latvals, lonvals, zint, U, V, T, PS, PHIS_IN, & +subroutine us_std_atm_set_ic(latvals, lonvals, zint, U, V, W, T, PS, PHIS_IN, & PHIS_OUT, Q, m_cnst, mask, verbose) !---------------------------------------------------------------------------- @@ -46,6 +46,7 @@ subroutine us_std_atm_set_ic(latvals, lonvals, zint, U, V, T, PS, PHIS_IN, & real(r8), optional, intent(in) :: zint(:,:) ! height at layer interfaces real(r8), optional, intent(inout) :: U(:,:) ! zonal velocity real(r8), optional, intent(inout) :: V(:,:) ! meridional velocity + real(r8), optional, intent(inout) :: W(:,:) ! vertical velocity (nonhydrostatic) real(r8), optional, intent(inout) :: T(:,:) ! temperature real(r8), optional, intent(inout) :: PS(:) ! surface pressure real(r8), optional, intent(in) :: PHIS_IN(:) ! surface geopotential @@ -121,6 +122,19 @@ subroutine us_std_atm_set_ic(latvals, lonvals, zint, U, V, T, PS, PHIS_IN, & end if end if + if (present(W)) then + nlev = size(W, 2) + do k = 1, nlev + where(mask_use) + W(:,k) = 0.0_r8 + end where + end do + if(masterproc .and. verbose_use) then + write(iulog,*) ' W (nonhydrostatic) initialized by '//subname + end if + end if + + if (present(T)) then nlev = size(T, 2) allocate(pmid(nlev), zmid(nlev))