diff --git a/src/dynamics/fv/cd_core.F90 b/src/dynamics/fv/cd_core.F90 index f7f64e6512..e679a1d144 100644 --- a/src/dynamics/fv/cd_core.F90 +++ b/src/dynamics/fv/cd_core.F90 @@ -12,8 +12,7 @@ subroutine cd_core(grid, nx, u, v, pt, & mlt, ncx, ncy, nmfx, nmfy, iremote, & cxtag, cytag, mfxtag, mfytag, & cxreqs, cyreqs, mfxreqs, mfyreqs, & - kmtp, am_correction, am_geom_crrct, am_fixer, & - dod, don, high_order_top) + kmtp, am_correction, am_fixer, dod, don ,high_order_top) ! Dynamical core for both C- and D-grid Lagrangian dynamics ! @@ -83,7 +82,6 @@ subroutine cd_core(grid, nx, u, v, pt, & real(r8), intent(in) :: del2coef integer, intent(in) :: kmtp ! range of levels (1:kmtp) where order is reduced logical, intent(in) :: am_correction ! logical switch for correction (applied here) - logical, intent(in) :: am_geom_crrct ! logical switch for correction (applied here) logical, intent(in) :: am_fixer ! logical switch for fixer (generate out args) logical, intent(in) :: high_order_top ! use uniform 4th order everywhere (incl. model top) @@ -170,7 +168,7 @@ subroutine cd_core(grid, nx, u, v, pt, & real(r8), intent(out) :: & ptk(grid%im,grid%jfirst:grid%jlast,grid%kfirst:grid%klast) - ! Omega calculation +! C.-C. Chen, omega calculation real(r8), intent(out) :: & cx_om(grid%im,grid%jfirst:grid%jlast,grid%kfirst:grid%klast) ! Courant in X real(r8), intent(out) :: & @@ -231,7 +229,7 @@ subroutine cd_core(grid, nx, u, v, pt, & integer :: npes_yz integer i, j, k, ml - integer js1g1, js2g0, js2g1, jn2g1, js4g0, jn3g0 + integer js1g1, js2g0, js2g1, jn2g1 ,js4g0,jn3g0 integer jn2g0, jn1g1 integer iord , jord @@ -291,10 +289,7 @@ subroutine cd_core(grid, nx, u, v, pt, & ! Used to allow the same code to execute with or without the AM correction real(r8) :: ptr(grid%im,grid%jfirst-1:grid%jlast+1,grid%kfirst:grid%klast+1) - logical :: sw_am_corr - logical :: am_press_crrct - real(r8) :: wg_hiord - real(r8) :: tpr, acap + logical :: sw_am_corr !****************************************************************** !****************************************************************** @@ -376,13 +371,6 @@ subroutine cd_core(grid, nx, u, v, pt, & endif #endif - am_press_crrct = am_geom_crrct .and. am_correction - if (am_press_crrct) then - wg_hiord = -1._r8 - else - wg_hiord = 0._r8 - endif - npes_yz = grid%npes_yz im = grid%im @@ -411,21 +399,16 @@ subroutine cd_core(grid, nx, u, v, pt, & kelp(grid%im,grid%jfirst-1:grid%jlast ,grid%kfirst:grid%klast ), & dpn(grid%im,grid%jfirst :grid%jlast ,grid%kfirst:grid%klast ), & dpo(grid%im,grid%jfirst :grid%jlast ,grid%kfirst:grid%klast ) ) - acap = 1._r8/4._r8 ! effective AM/MoI contribution from polar caps - endif - if (am_press_crrct) then - allocate( & - dpr(grid%im,grid%jfirst-1:grid%jlast+1,grid%kfirst:grid%klast ) ) - xakap = 1._r8/cap3vc(1,jfirst,kfirst) endif if (am_correction) then allocate( & + dpr(grid%im,grid%jfirst-1:grid%jlast+1,grid%kfirst:grid%klast ), & ddpu(grid%im,grid%jfirst :grid%jlast ,grid%kfirst:grid%klast ), & dpns(grid%jfirst:grid%jlast,grid%kfirst:grid%klast), & ddus(grid%jfirst:grid%jlast,grid%kfirst:grid%klast) ) - ddus = 0._r8 + xakap = 1._r8/cap3vc(1,jfirst,kfirst) else - xakap = 1._r8 + xakap = 1._r8 endif ! maintain consistent accuracy (uniform PPM order) over domain @@ -471,7 +454,6 @@ subroutine cd_core(grid, nx, u, v, pt, & jn2g0 = min(jm-1,jlast) jn1g1 = min(jm,jlast+1) jn2g1 = min(jm-1,jlast+1) - js4g0 = max(4,jfirst) jn3g0 = min(jm-2,jlast) @@ -750,7 +732,7 @@ subroutine cd_core(grid, nx, u, v, pt, & ua(1,jfirst-ng_d,k), va(1,jfirst-ng_s,k), & uc(1,jfirst-ng_d,k), vc(1,jfirst-2,k), & u_cen(1,jfirst-ng_d,k), v_cen(1,jfirst-ng_s,k), & - reset_winds, met_rlx(k), am_geom_crrct) + reset_winds, met_rlx(k), am_correction) ! Optionally filter advecting C-grid winds if (filtcw .gt. 0) then @@ -798,7 +780,7 @@ subroutine cd_core(grid, nx, u, v, pt, & ua(1,jfirst-ng_d,k), va(1,jfirst-ng_s,k), & uc(1,jfirst-ng_d,k), vc(1,jfirst-2,k), & ptc(1,jfirst,k), delpf(1,jfirst-ng_d,k), & - ptk(1,jfirst,k), tiny, iord, jord, am_geom_crrct) + ptk(1,jfirst,k), tiny, iord, jord, am_correction) end do call FVstopclock(grid,'---C_CORE') @@ -1062,7 +1044,7 @@ subroutine cd_core(grid, nx, u, v, pt, & do k = kfirst, klast do j = js2g0, jn2g0 - if (am_press_crrct) then + if (am_correction) then do i = 1, im ! AM fix: ensure interior pressure torque vanishes @@ -1143,7 +1125,7 @@ subroutine cd_core(grid, nx, u, v, pt, & call FVstartclock(grid,'---C_V_PGRAD') - if (am_press_crrct) then + if (am_correction) then !$omp parallel do private(i, j, k) ! AM correction (pressure, advective winds): pxc -> ptr do k = kfirst, klast+1 @@ -1326,20 +1308,8 @@ subroutine cd_core(grid, nx, u, v, pt, & dpo(i,j,k)=(kelp(i,j,k)*cosp(j)+kelp(i,j-1,k)*cosp(j-1))/(cosp(j)+cosp(j-1)) ! A->D end do end do - if (jfirst == 1) then - do i = 1, im - dpn(i, 2,k)=(help(i, 2 ,k)*cosp( 2 )+acap*help(i, 1,k)*cose( 2))/cosp( 2 ) - dpo(i, 2,k)=(kelp(i, 2 ,k)*cosp( 2 )+acap*kelp(i, 1,k)*cose( 2))/cosp( 2 ) - end do - endif - if (jlast == jm) then - do i = 1, im - dpn(i,jm,k)=(help(i,jm-1,k)*cosp(jm-1)+acap*help(i,jm,k)*cose(jm))/cosp(jm-1) - dpo(i,jm,k)=(kelp(i,jm-1,k)*cosp(jm-1)+acap*kelp(i,jm,k)*cose(jm))/cosp(jm-1) - end do - endif end do - + if (am_correction) then !$omp parallel do private(i, j, k) do k = kfirst, klast @@ -1354,7 +1324,7 @@ subroutine cd_core(grid, nx, u, v, pt, & do k = kfirst, klast do j = js2g0, jlast do i = 1, im - ddu(i,j,k) = ddu(i,j,k)*0.5_r8*(dpo(i,j,k) + dpn(i,j,k)) + ddu(i,j,k)=ddu(i,j,k)* D0_5*(dpo(i,j,k)+dpn(i,j,k)*3._r8)*D0_5 end do end do end do @@ -1362,22 +1332,15 @@ subroutine cd_core(grid, nx, u, v, pt, & !$omp parallel do private(i, j, k) do k = kfirst, klast do j = js2g0, jlast - ddus(j,k) = ddu(1,j,k) & - + (u(1,j,k) + uc(1,j,k)*0.5_r8)*ddpu(1,j,k) & - + wg_hiord*vf(1,j,k)*(dpn(1,j,k) - dpo(1,j,k))*0.5_r8 + ddus(j,k) = ddu(1,j,k) + (u(1,j,k) + uc(1,j,k)/D4_0)*ddpu(1,j,k) - & + vf(1,j,k)*(dpn(1,j,k) - dpo(1,j,k))*D0_5 dpns(j,k) = dpn(1,j,k) do i = 2, im - ddus(j,k) = ddus(j,k) & - + ddu(i,j,k) & - + (u(i,j,k)+uc(i,j,k)*0.5_r8)*ddpu(i,j,k) & - + wg_hiord*vf(i,j,k)*(dpn(i,j,k)-dpo(i,j,k))*0.5_r8 + ddus(j,k) = ddus(j,k) + ddu(i,j,k) +(u(i,j,k)+uc(i,j,k)/D4_0)*ddpu(i,j,k) - & + vf(i,j,k)*(dpn(i,j,k)-dpo(i,j,k))*D0_5 dpns(j,k) = dpns(j,k) + dpn(i,j,k) end do ddus(j,k) = ddus(j,k)/dpns(j,k) - ! taper beyond 72S/N - tpr = max(abs(-2.5_r8 + ((j-1)-0.5_r8)*(5._r8/(jm-1))),2._r8) - tpr = cos(pi*tpr)**2 - ddus(j,k)=ddus(j,k)*tpr end do end do @@ -1393,29 +1356,7 @@ subroutine cd_core(grid, nx, u, v, pt, & end if ! (am_correction) if (am_fixer) then - if (.not. am_geom_crrct) then -!$omp parallel do private(i, j, k) - do k = kfirst, klast - do j = js2g0, jlast - do i = 1, im - dpn(i,j,k) = (help(i,j,k) + help(i,j-1,k) )/ 2._r8 - dpo(i,j,k) = (kelp(i,j,k) + kelp(i,j-1,k) )/ 2._r8 - end do - end do - if (jfirst == 1) then - do i = 1, im - dpn(i,2,k) = (help(i,2,k) + help(i,1,k) )/ 2._r8 - dpo(i,2,k) = (kelp(i,2,k) + kelp(i,1,k) )/ 2._r8 - end do - endif - if (jlast == jm) then - do i = 1, im - dpn(i,jm,k) = (help(i,jm-1,k) + help(i,jm,k) )/ 2._r8 - dpo(i,jm,k) = (kelp(i,jm-1,k) + kelp(i,jm,k) )/ 2._r8 - end do - endif - end do - endif + !$omp parallel do private(i, j, k) do k = kfirst, klast do j = js2g0, jlast @@ -1426,7 +1367,15 @@ subroutine cd_core(grid, nx, u, v, pt, & dod(j,k) = dod(j,k) + (cosp(j) + cosp(j-1))*cose(j)**2*dpn(i,j,k) end do end do + + ! north pole + if (jfirst == 1) then + do i = 1, im + dod(1,k) = dod(1,k) + grid%acap/(D0_5*im)*cose(1)**2*help(i,1,k) + end do + end if end do + end if ! (am_fixer) call FVstopclock(grid,'---dp4corr_COMM_2') @@ -1734,8 +1683,8 @@ subroutine cd_core(grid, nx, u, v, pt, & end if call FVstopclock(grid,'---PRE_D_PGRAD_COMM_1') #endif - - if (am_press_crrct) then + + if (am_correction) then ! AM correction (pressure, prognostic winds): pkc -> ptr !$omp parallel do private(i, j, k) do k = kfirst, klast+1 @@ -1756,7 +1705,7 @@ subroutine cd_core(grid, nx, u, v, pt, & end do endif - if (am_press_crrct) then + if (am_correction) then !$omp parallel do private(i, j, k) ! Beware k+1 references directly below (AAM) do k = kfirst, klast @@ -1809,7 +1758,7 @@ subroutine cd_core(grid, nx, u, v, pt, & cycle end if - if (am_press_crrct) then + if (am_correction) then do j=js2g1,jn2g0 ! wk3 needed S wk3(1,j) = (wz(1,j,k)+wz(im,j,k)) * & (ptr(1,j,k) - ptr(im,j,k)) @@ -1859,7 +1808,7 @@ subroutine cd_core(grid, nx, u, v, pt, & ! N-S walls do j=js2g0,jn1g1 ! wk1 needed N - if (am_press_crrct) then + if (am_correction) then do i=1,im wk1(i,j) = (wz(i,j,k) + wz(i,j-1,k))*(ptr(i,j,k) - ptr(i,j-1,k)) enddo @@ -1897,7 +1846,7 @@ subroutine cd_core(grid, nx, u, v, pt, & enddo enddo - if (am_press_crrct) then + if (am_correction) then ! use true pressure for wk1, then update it do j = js1g1, jn1g1 @@ -1924,7 +1873,7 @@ subroutine cd_core(grid, nx, u, v, pt, & !$omp parallel do private(i, j, k, wk, wk1, wk2, wk3) do k = kfirst, klast - if (am_press_crrct) then + if (am_correction) then do j = js1g1, jn1g1 wk1(1,j) = dpr(1,j,k) + dpr(im,j,k) do i = 2, im @@ -1964,7 +1913,7 @@ subroutine cd_core(grid, nx, u, v, pt, & * (wk2(im,j)-wk2(1,j)+wz3(im,j,k+1)-wz3(im,j,k)) end do - if (am_geom_crrct) then + if (am_correction) then ! apply cos-weighted avg'ing do j = js2g0, jn2g0 ! Assumes wk2 ghosted on N do i = 1, im diff --git a/src/dynamics/fv/d2a3dikj.F90 b/src/dynamics/fv/d2a3dikj.F90 index 2ff9bbd748..fe3ffbb8c3 100644 --- a/src/dynamics/fv/d2a3dikj.F90 +++ b/src/dynamics/fv/d2a3dikj.F90 @@ -14,7 +14,7 @@ module d2a3dikj_mod ! ! !INTERFACE: - subroutine d2a3dikj(grid, am_geom_crrct, u, v, ua, va) + subroutine d2a3dikj(grid, am_correction, u, v, ua, va) ! !USES: @@ -36,7 +36,7 @@ subroutine d2a3dikj(grid, am_geom_crrct, u, v, ua, va) implicit none ! !INPUT PARAMETERS: type (t_fvdycore_grid), intent(in) :: grid - logical, intent(in) :: am_geom_crrct + logical, intent(in) :: am_correction real(r8), intent(in) :: u(grid%ifirstxy:grid%ilastxy, & grid%jfirstxy:grid%jlastxy,grid%km) ! U-Wind real(r8), intent(in) :: v(grid%ifirstxy:grid%ilastxy, & @@ -127,7 +127,7 @@ subroutine d2a3dikj(grid, am_geom_crrct, u, v, ua, va) if ( jlastxy .lt. jm ) then - if (am_geom_crrct) then + if (am_correction) then !$omp parallel do private(i, k) do k = 1, km do i = ifirstxy, ilastxy @@ -146,7 +146,7 @@ subroutine d2a3dikj(grid, am_geom_crrct, u, v, ua, va) end if #endif - if (am_geom_crrct) then + if (am_correction) then !$omp parallel do private(i,j,k) do k = 1, km do j = jfirstxy, jlastxy-1 diff --git a/src/dynamics/fv/dp_coupling.F90 b/src/dynamics/fv/dp_coupling.F90 index da28bb3cca..a40afe461f 100644 --- a/src/dynamics/fv/dp_coupling.F90 +++ b/src/dynamics/fv/dp_coupling.F90 @@ -270,7 +270,7 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out) allocate (v3(ifirstxy:ilastxy, km, jfirstxy:jlastxy)) if (iam .lt. grid%npes_xy) then - call d2a3dikj(grid, dyn_state%am_geom_crrct, u3sxy, v3sxy, u3, v3) + call d2a3dikj(grid, dyn_state%am_correction, u3sxy, v3sxy, u3, v3) end if ! (iam .lt. grid%npes_xy) call t_stopf ('d2a3dikj') @@ -303,9 +303,9 @@ subroutine d_p_coupling(grid, phys_state, phys_tend, pbuf2d, dyn_out) if (iam .lt. grid%npes_xy) then ! (note dummy use of dva3 hence call order matters) - call d2a3dikj(grid, dyn_state%am_geom_crrct,duf3sxy, dummy, duf3 ,dva3) - call d2a3dikj(grid, dyn_state%am_geom_crrct,dua3sxy, dva3sxy, dua3, dva3) - call d2a3dikj(grid, dyn_state%am_geom_crrct, du3sxy, dv3sxy, du3 , dv3 ) + call d2a3dikj(grid, dyn_state%am_correction,duf3sxy, dummy, duf3 ,dva3) + call d2a3dikj(grid, dyn_state%am_correction,dua3sxy, dva3sxy, dua3, dva3) + call d2a3dikj(grid, dyn_state%am_correction, du3sxy, dv3sxy, du3 , dv3 ) end if ! (iam .lt. grid%npes_xy) call t_startf('DP_CPLN_fv_am') @@ -950,7 +950,7 @@ subroutine p_d_coupling(grid, phys_state, phys_tend, & call t_startf('uv3s_update') if (iam .lt. grid%npes_xy) then call uv3s_update(grid, dudtxy, u3sxy, dvdtxy, v3sxy, dt5, & - dyn_state%am_geom_crrct) + dyn_state%am_correction) end if ! (iam .lt. grid%npes_xy) call t_stopf('uv3s_update') diff --git a/src/dynamics/fv/dyn_comp.F90 b/src/dynamics/fv/dyn_comp.F90 index f1f057a7d6..f7f8226c70 100644 --- a/src/dynamics/fv/dyn_comp.F90 +++ b/src/dynamics/fv/dyn_comp.F90 @@ -186,18 +186,15 @@ subroutine dyn_readnl(nlfilename) real(r8):: fv_del2coef = 3.e5_r8 ! strength of 2nd order velocity damping logical :: fv_high_altitude = .false. ! switch to apply variables appropriate for high-altitude physics - logical :: fv_high_order_top=.false.! do not degrade calculation to 1st order near the model top - - logical :: fv_am_correction=.false. ! apply correction for angular momentum (AM) in SW eqns - logical :: fv_am_geom_crrct=.false. ! apply correction for angular momentum (AM) in geometry - logical :: fv_am_fixer =.false. ! apply global fixer to conserve AM - logical :: fv_am_fix_lbl =.false. ! apply global AM fixer level by level - logical :: fv_am_diag =.false. ! turns on an AM diagnostic calculation written to log file + logical :: fv_am_correction = .false. ! apply correction for angular momentum (AM) + ! conservation in SW eqns + logical :: fv_am_fixer = .false. ! apply global fixer to conserve AM + logical :: fv_am_fix_lbl = .false. ! apply global AM fixer level by level + logical :: fv_am_diag = .false. ! turns on an AM diagnostic calculation written to log file namelist /dyn_fv_inparm/ fv_nsplit, fv_nspltrac, fv_nspltvrm, fv_iord, fv_jord, & fv_kord, fv_conserve, fv_filtcw, fv_fft_flt, & - fv_div24del2flag, fv_del2coef, fv_high_order_top, & - fv_am_correction, fv_am_geom_crrct, & + fv_div24del2flag, fv_del2coef, fv_am_correction, & fv_am_fixer, fv_am_fix_lbl, fv_am_diag, fv_high_altitude, & fv_print_dpcoup_warn @@ -259,15 +256,9 @@ subroutine dyn_readnl(nlfilename) call mpi_bcast(fv_del2coef, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: fv_del2coef") - call mpi_bcast(fv_high_order_top, 1, mpi_logical, mstrid, mpicom, ierr) - if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: fv_high_order_top") - call mpi_bcast(fv_am_correction, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: fv_am_correction") - call mpi_bcast(fv_am_geom_crrct, 1, mpi_logical, mstrid, mpicom, ierr) - if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: fv_am_geom_crrct") - ! if fv_am_fix_lbl is true then fv_am_fixer must also be true. if (fv_am_fix_lbl .and. .not. fv_am_fixer) then fv_am_fixer = .true. @@ -338,9 +329,7 @@ subroutine dyn_readnl(nlfilename) dyn_state%div24del2flag = fv_div24del2flag dyn_state%del2coef = fv_del2coef - dyn_state%high_order_top= fv_high_order_top dyn_state%am_correction = fv_am_correction - dyn_state%am_geom_crrct = fv_am_geom_crrct dyn_state%am_fixer = fv_am_fixer dyn_state%am_fix_lbl = fv_am_fix_lbl dyn_state%am_diag = fv_am_diag @@ -363,8 +352,7 @@ subroutine dyn_readnl(nlfilename) write(iulog,*)' FFT filter (fv_fft_flt) = ', fv_fft_flt write(iulog,*)' Divergence/velocity damping (fv_div24del2flag) = ', fv_div24del2flag write(iulog,*)' Coef for 2nd order velocity damping (fv_del2coef) = ', fv_del2coef - write(iulog,*)' High-order top = ', fv_high_order_top - write(iulog,*)' Geometry & pressure corr. for AM (fv_am_geom_crrct) = ', fv_am_geom_crrct + write(iulog,*)' ' write(iulog,*)' Angular momentum (AM) correction (fv_am_correction) = ', fv_am_correction write(iulog,*)' Apply AM fixer (fv_am_fixer) = ', fv_am_fixer write(iulog,*)' Level by level AM fixer (fv_am_fix_lbl) = ', fv_am_fix_lbl @@ -1048,7 +1036,6 @@ subroutine dyn_run(ptop, ndt, te0, dyn_state, dyn_in, dyn_out, rc) ! angular momentum (AM) conservation logical :: am_correction ! apply AM correction? - logical :: am_geom_crrct ! apply AM geom. corr? logical :: am_fixer ! apply AM fixer? logical :: am_fix_lbl ! apply fixer separately on each shallow-water layer? logical :: am_fix_taper=.false. ! def. no tapering; modified if global fixer applied or high_order_top=.false. @@ -1088,7 +1075,7 @@ subroutine dyn_run(ptop, ndt, te0, dyn_state, dyn_in, dyn_out, rc) ! NOTE -- model behaviour with high_order_top=true is still under validation and may require ! some other form of enhanced damping in the top layer - logical :: high_order_top + logical, parameter :: high_order_top=.false. !-------------------------------------------------------------------------------------- kmtp=dyn_state%grid%km/8 @@ -1134,9 +1121,7 @@ subroutine dyn_run(ptop, ndt, te0, dyn_state, dyn_in, dyn_out, rc) high_alt = grid%high_alt consv = dyn_state%consv - high_order_top= dyn_state%high_order_top am_correction = dyn_state%am_correction - am_geom_crrct = dyn_state%am_geom_crrct am_fixer = dyn_state%am_fixer am_fix_lbl = dyn_state%am_fix_lbl am_diag = dyn_state%am_diag @@ -1873,8 +1858,8 @@ subroutine dyn_run(ptop, ndt, te0, dyn_state, dyn_in, dyn_out, rc) naux, ncx, ncy, nmfx, nmfy, iremotea, & cxtaga, cytaga, mfxtaga, mfytaga, cdcreqs(1,1), & cdcreqs(1,2), cdcreqs(1,3), cdcreqs(1,4), & - kmtp, am_correction, am_geom_crrct, am_fix_out, & - dod, don, high_order_top) + kmtp, & + am_correction, am_fix_out, dod, don ,high_order_top) ctreqs(2,:) = cdcreqs(:,1) ctreqs(3,:) = cdcreqs(:,2) @@ -2638,7 +2623,7 @@ subroutine dyn_run(ptop, ndt, te0, dyn_state, dyn_in, dyn_out, rc) phisxy, cp3v, cap3v, kord, pelnxy, & te0, tempxy, dp0xy, mfxxy, mfyxy, & uc_i, vc_i, du_fix_s, du_fix_i, & - am_geom_crrct, (am_fixer.or.am_diag) ) + am_correction, (am_fixer.or.am_diag) ) if (am_diag) then !$omp parallel do private(i,j,k) @@ -3144,7 +3129,7 @@ subroutine process_inidat(fh_ini, grid, dyn_in, fieldname, m_cnst) ! reset PIO to handle errors as before call pio_seterrorhandling(fh_ini, err_handling) - + else if (.not. analytic_ic_active()) then diff --git a/src/dynamics/fv/dyn_grid.F90 b/src/dynamics/fv/dyn_grid.F90 index 722fd8e6fe..eaf43e2d5e 100644 --- a/src/dynamics/fv/dyn_grid.F90 +++ b/src/dynamics/fv/dyn_grid.F90 @@ -130,7 +130,7 @@ subroutine dyn_grid_init() ! Initialize FV specific grid object variables dt = get_step_size() call grid_vars_init(pi, rearth, omega, dt, state%fft_flt, & - state%am_geom_crrct, grid) + state%am_correction, grid) ! initialize commap variables diff --git a/src/dynamics/fv/dynamics_vars.F90 b/src/dynamics/fv/dynamics_vars.F90 index 97cbfb7d34..3f66fb538a 100644 --- a/src/dynamics/fv/dynamics_vars.F90 +++ b/src/dynamics/fv/dynamics_vars.F90 @@ -295,8 +295,6 @@ module dynamics_vars integer :: div24del2flag ! 2 for 2nd order div damping, 4 for 4th order div damping, ! 42 for 4th order div damping plus 2nd order velocity damping real(r8) :: del2coef ! strength of 2nd order velocity damping - logical :: high_order_top! use normal 4-order PPM calculation near the model top - logical :: am_geom_crrct ! apply correction for angular momentum (AM) conservation in geometry logical :: am_correction ! apply correction for angular momentum (AM) conservation in SW eqns logical :: am_fixer ! apply global fixer to conserve AM logical :: am_fix_lbl ! apply global AM fixer level by level @@ -722,7 +720,7 @@ end subroutine spmd_vars_init !======================================================================================== subroutine grid_vars_init(pi, ae, om, dt, fft_flt, & - am_geom_crrct, grid) + am_correction, grid) ! Initialize FV specific GRID vars ! @@ -741,7 +739,7 @@ subroutine grid_vars_init(pi, ae, om, dt, fft_flt, & real(r8), intent(in) :: om ! angular velocity of earth's rotation real(r8), intent(in) :: dt integer, intent(in) :: fft_flt - logical, intent(in) :: am_geom_crrct + logical, intent(in) :: am_correction type( T_FVDYCORE_GRID ), intent(inout) :: grid @@ -814,7 +812,7 @@ subroutine grid_vars_init(pi, ae, om, dt, fft_flt, & ! Define cosine at edges.. - if (am_geom_crrct) then + if (am_correction) then do j = 2, jm ph5 = -0.5_r8*pi + ((j-1)-0.5_r8)*(pi/(jm-1._r8)) cose(j) = cos(ph5) @@ -832,7 +830,7 @@ subroutine grid_vars_init(pi, ae, om, dt, fft_flt, & sinp( 1) = -1._r8 sinp(jm) = 1._r8 - if (am_geom_crrct) then + if (am_correction) then do j = 2, jm-1 sinp(j) = (cose(j) - cose(j+1))/grid%dp ! sqrt(cosp^2+sinp^2)=1 end do @@ -956,7 +954,7 @@ subroutine grid_vars_init(pi, ae, om, dt, fft_flt, & ! Compute coriolis parameter at cell corners. - if (am_geom_crrct) then + if (am_correction) then do j = js2gc, jn1gc grid%fc(j) = (om+om)*grid%sine(j) end do diff --git a/src/dynamics/fv/sw_core.F90 b/src/dynamics/fv/sw_core.F90 index 654b7d151a..823e8c9b10 100644 --- a/src/dynamics/fv/sw_core.F90 +++ b/src/dynamics/fv/sw_core.F90 @@ -63,7 +63,7 @@ module sw_core subroutine c_sw(grid, u, v, pt, delp, & u2, v2, & uc, vc, ptc, delpf, ptk, & - tiny, iord, jord, am_geom_crrct) + tiny, iord, jord, am_correction) ! Routine for shallow water dynamics on the C-grid @@ -78,7 +78,7 @@ subroutine c_sw(grid, u, v, pt, delp, & type (T_FVDYCORE_GRID), intent(in) :: grid integer, intent(in):: iord integer, intent(in):: jord - logical, intent(in):: am_geom_crrct + logical, intent(in):: am_correction real(r8), intent(in):: u2(grid%im,grid%jfirst-grid%ng_d:grid%jlast+grid%ng_d) real(r8), intent(in):: v2(grid%im,grid%jfirst-grid%ng_s:grid%jlast+grid%ng_d) @@ -267,7 +267,7 @@ subroutine c_sw(grid, u, v, pt, delp, & ! New va definition - if (am_geom_crrct) then + if (am_correction) then do j=js2g1,jn2g0 ! va needed on S (for YCC, iv==1) do i=1,im ! weight by cos @@ -504,11 +504,11 @@ end subroutine c_sw ! !INTERFACE: subroutine d_sw( grid, u, v, uc, vc, & pt, delp, delpf, cx3, cy3, & - mfx, mfy, cdx, cdy, & + mfx, mfy, cdx, cdy, & cdxde, cdxdp, cdyde, cdydp, & !ldel2 variables cdxdiv, cdydiv, cdx4, cdy4, cdtau4, & ldiv2, ldiv4, ldel2, & - iord, jord, tiny, am_correction, & + iord, jord, tiny, am_correction, & ddp, duc, vf) !-------------------------------------------------------------------------- ! Routine for shallow water dynamics on the D-grid @@ -1376,7 +1376,7 @@ end subroutine d_sw ! ! !INTERFACE: subroutine d2a2c_winds(grid, u, v, ua, va, uc, vc, u_cen, v_cen, & - reset_winds, met_rlx, am_geom_crrct) + reset_winds, met_rlx, am_correction) implicit none @@ -1395,7 +1395,7 @@ subroutine d2a2c_winds(grid, u, v, ua, va, uc, vc, u_cen, v_cen, & real(r8), intent(in):: u_cen(grid%im,grid%jfirst-grid%ng_d:grid%jlast+grid%ng_d) real(r8), intent(in):: v_cen(grid%im,grid%jfirst-grid%ng_s:grid%jlast+grid%ng_d) real(r8), intent(in):: met_rlx - logical, intent(in):: am_geom_crrct + logical, intent(in):: am_correction ! !DESCRIPTION: ! @@ -1553,7 +1553,7 @@ subroutine d2a2c_winds(grid, u, v, ua, va, uc, vc, u_cen, v_cen, & va(im,j) = v(im,j) + v(1,j) enddo - if (am_geom_crrct) then + if (am_correction) then do j = js2gd, jn2gsm1 do i = 1, im ua(i,j) =(u(i,j)*cose(j) + u(i,j+1)*cose(j+1))/cosp(j) ! curl free -> curl free @@ -1637,7 +1637,7 @@ subroutine d2a2c_winds(grid, u, v, ua, va, uc, vc, u_cen, v_cen, & enddo enddo - if (am_geom_crrct) then + if (am_correction) then do j = js2g2, jn1g2 ! vc needed N*2, S*2 (for ycc), va defined at poles do i = 1, im vc(i,j) = D0_25*(va(i,j)*cosp(j) + va(i,j-1)*cosp(j-1))/cose(j) ! div free -> div free diff --git a/src/dynamics/fv/te_map.F90 b/src/dynamics/fv/te_map.F90 index 7044974a45..04fc3a1b72 100644 --- a/src/dynamics/fv/te_map.F90 +++ b/src/dynamics/fv/te_map.F90 @@ -18,7 +18,7 @@ subroutine te_map(grid, consv, convt, ps, omga, & hs, cp3v, cap3v, kord, peln, & te0, te, dz, mfx, mfy, & uc, vc, du_s, du_w, & - am_geom_crrct, am_diag_lbl) + am_correction, am_diag_lbl) ! ! !USES: @@ -84,7 +84,7 @@ subroutine te_map(grid, consv, convt, ps, omga, & real(r8) pkz(grid%ifirstxy:grid%ilastxy,grid%jfirstxy:grid%jlastxy,grid%km) ! layer-mean pk for converting t to pt ! AM conservation mods - logical, intent(in) :: am_geom_crrct ! logical switch for AM correction + logical, intent(in) :: am_correction ! logical switch for AM correction logical, intent(in) :: am_diag_lbl ! input real(r8), intent(in) :: du_s(grid%km) @@ -628,7 +628,7 @@ subroutine te_map(grid, consv, convt, ps, omga, & if(j /= 1) then - if (am_geom_crrct) then + if (am_correction) then ! WS 99.07.29 : protect j==jfirst case if (j > jfirst) then @@ -678,7 +678,7 @@ subroutine te_map(grid, consv, convt, ps, omga, & enddo enddo - else ! not am_geom_crrct + else ! not am_correction ! WS 99.07.29 : protect j==jfirst case if (j > jfirst) then @@ -710,7 +710,7 @@ subroutine te_map(grid, consv, convt, ps, omga, & #endif endif ! (j > jfirst) - endif ! (am_geom_crrct) + endif ! (am_correction) !------------------------------- @@ -720,7 +720,7 @@ subroutine te_map(grid, consv, convt, ps, omga, & 0, 0, itot, i1-ifirst+1, i2-ifirst+1, & j, jfirst, jlast, -1, kord) - if (am_geom_crrct) then + if (am_correction) then ! compute zonal momentum difference due to remapping do k=1,km diff --git a/src/dynamics/fv/uv3s_update.F90 b/src/dynamics/fv/uv3s_update.F90 index ffd082a82a..bcf29be3e4 100644 --- a/src/dynamics/fv/uv3s_update.F90 +++ b/src/dynamics/fv/uv3s_update.F90 @@ -5,7 +5,7 @@ ! !INTERFACE: subroutine uv3s_update(grid, dua, u3s, dva, v3s, dt5, & - am_geom_crrct) + am_correction) ! !USES: @@ -27,7 +27,7 @@ subroutine uv3s_update(grid, dua, u3s, dva, v3s, dt5, & ! dvdt on A-grid real(r8),intent(in) :: dva(grid%ifirstxy:grid%ilastxy,grid%km,grid%jfirstxy:grid%jlastxy) real(r8),intent(in) :: dt5 ! weighting factor - logical, intent(in) :: am_geom_crrct + logical, intent(in) :: am_correction ! !INPUT/OUTPUT PARAMETERS: real(r8), intent(inout) :: u3s(grid%ifirstxy:grid%ilastxy,grid%jfirstxy:grid%jlastxy, & @@ -121,7 +121,7 @@ subroutine uv3s_update(grid, dua, u3s, dva, v3s, dt5, & ! Adjust D-grid winds by interpolating A-grid tendencies. ! - if (am_geom_crrct) then + if (am_correction) then do j = jfirstxy+1, jlastxy do i = ifirstxy, ilastxy tmp = u3s(i,j,k) @@ -149,7 +149,7 @@ subroutine uv3s_update(grid, dua, u3s, dva, v3s, dt5, & enddo #if defined( SPMD ) - if (am_geom_crrct) then + if (am_correction) then if ( jfirstxy .gt. 1 ) then do i = ifirstxy, ilastxy tmp = u3s(i,jfirstxy,k)