From 46c4a55c8320f1e846812082df4ec2eafaa51cf0 Mon Sep 17 00:00:00 2001 From: Tanya Smirnova Date: Wed, 9 Mar 2022 23:08:27 +0000 Subject: [PATCH] 1.Bug fix for snow initialization in GFS_surface_composites.F90i 2. Set compute_fluxes=.true. in module_sf_mynn.F90 --- physics/GFS_surface_composites.F90 | 85 +++++++++++++++++++++++------ physics/GFS_surface_composites.meta | 44 +++++++++++++++ physics/module_sf_mynn.F90 | 2 +- 3 files changed, 113 insertions(+), 18 deletions(-) diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index 14bc48cd7..2a3ed024b 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -27,8 +27,9 @@ end subroutine GFS_surface_composites_pre_finalize !> \section arg_table_GFS_surface_composites_pre_run Argument Table !! \htmlinclude GFS_surface_composites_pre_run.html !! - subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, frac_grid, & - flag_cice, cplflx, cplice, cplwav2atm, landfrac, lakefrac, lakedepth, oceanfrac, frland, & + subroutine GFS_surface_composites_pre_run (im, xlat_d, xlon_d, flag_init, flag_restart, lkm, frac_grid, & + flag_cice, cplflx, cplice, cplwav2atm, lsm, lsm_ruc, & + landfrac, lakefrac, lakedepth, oceanfrac, frland, & dry, icy, lake, use_flake, wet, hice, cice, zorlo, zorll, zorli, & snowd, snowd_lnd, snowd_ice, tprcp, tprcp_wat, & tprcp_lnd, tprcp_ice, uustar, uustar_wat, uustar_lnd, uustar_ice, & @@ -40,10 +41,11 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra implicit none ! Interface variables - integer, intent(in ) :: im, lkm, kdt + integer, intent(in ) :: im, lkm, kdt, lsm, lsm_ruc logical, intent(in ) :: flag_init, flag_restart, frac_grid, cplflx, cplice, cplwav2atm logical, dimension(:), intent(inout) :: flag_cice logical, dimension(:), intent(inout) :: dry, icy, lake, use_flake, wet + real(kind=kind_phys), dimension(:), intent(in ) :: xlat_d, xlon_d real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac real(kind=kind_phys), dimension(:), intent(inout) :: cice, hice real(kind=kind_phys), dimension(:), intent( out) :: frland @@ -201,12 +203,17 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra endif endif enddo - endif + endif ! frac_grid do i=1,im tprcp_wat(i) = tprcp(i) tprcp_lnd(i) = tprcp(i) tprcp_ice(i) = tprcp(i) + !if ( (xlon_d(i) > 298.6) .and. (xlon_d(i) < 298.7) .and. & + ! (xlat_d(i) > 68.6 ) .and. (xlat_d(i) < 68.7 )) then + ! print *,'Composit weasd_ice(i),snowd_ice',kdt,i,xlat_d(i),xlon_d(i),weasd_ice(i),snowd_ice(i) + !endif + if (wet(i)) then ! Water uustar_wat(i) = uustar(i) tsfc_wat(i) = tsfco(i) @@ -218,7 +225,6 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra endif if (dry(i)) then ! Land uustar_lnd(i) = uustar(i) - weasd_lnd(i) = weasd(i) tsurf_lnd(i) = tsfcl(i) ! DH* else @@ -229,7 +235,6 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra endif if (icy(i)) then ! Ice uustar_ice(i) = uustar(i) - weasd_ice(i) = weasd(i) tsurf_ice(i) = tisfc(i) ep1d_ice(i) = zero gflx_ice(i) = zero @@ -256,7 +261,9 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra endif enddo ! - if (.not. cplflx .or. kdt == 1) then +!tgs - cold-start initialization of snow on sea ice and land for a coupled run or +! a run with RUC lsm (that has the ice model) + if (( cplflx .or. lsm == lsm_ruc) .and. (kdt == 1 .and. .not. flag_restart)) then if (frac_grid) then do i=1,im if (dry(i)) then @@ -275,6 +282,15 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra enddo else do i=1,im + !if ( (xlon_d(i) > 284.35) .and. (xlon_d(i) < 284.6) .and. & + ! (xlat_d(i) > 41.0 ) .and. (xlat_d(i) < 41.2 )) then + ! print *,'Composit2 weasd_lnd(i),snowd_lnd',kdt,i,xlat_d(i),xlon_d(i),weasd_lnd(i),snowd_lnd(i) + !endif + !if ( (xlon_d(i) > 298.6) .and. (xlon_d(i) < 298.7) .and. & + ! (xlat_d(i) > 68.6 ) .and. (xlat_d(i) < 68.7 )) then + ! print *,'Composit2 weasd_ice(i),snowd_ice',kdt,i,xlat_d(i),xlon_d(i),weasd_ice(i),snowd_ice(i) + !endif + if (dry(i)) then snowd_lnd(i) = snowd(i) weasd_lnd(i) = weasd(i) @@ -283,13 +299,27 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra elseif (icy(i)) then snowd_lnd(i) = zero weasd_lnd(i) = zero - tem = one / cice(i) - snowd_ice(i) = snowd(i) * tem - weasd_ice(i) = weasd(i) * tem + if(lsm /= lsm_ruc) then + tem = one / cice(i) + snowd_ice(i) = snowd(i) * tem + weasd_ice(i) = weasd(i) * tem + else + snowd_ice(i) = snowd(i) + weasd_ice(i) = weasd(i) + endif endif + !if ( (xlon_d(i) > 284.35) .and. (xlon_d(i) < 284.6) .and. & + ! (xlat_d(i) > 41.0 ) .and. (xlat_d(i) < 41.2 )) then + ! print *,'Composit3 weasd_lnd(i),snowd_lnd',kdt,i,xlat_d(i),xlon_d(i),weasd_lnd(i),snowd_lnd(i) + !endif + !if ( (xlon_d(i) > 298.6) .and. (xlon_d(i) < 298.7) .and. & + ! (xlat_d(i) > 68.6 ) .and. (xlat_d(i) < 68.7 )) then + ! print *,'Composit3 weasd_ice(i),snowd_ice',kdt,i,xlat_d(i),xlon_d(i),weasd_ice(i),snowd_ice(i) + !endif + enddo - endif - endif + endif ! frac_grid + endif ! cold-start ! write(0,*)' minmax of ice snow=',minval(snowd_ice),maxval(snowd_ice) @@ -378,6 +408,7 @@ module GFS_surface_composites_post use machine, only: kind_phys + ! For consistent calculations of composite surface properties use sfc_diff, only: stability @@ -402,8 +433,8 @@ end subroutine GFS_surface_composites_post_finalize !! \htmlinclude GFS_surface_composites_post_run.html !! subroutine GFS_surface_composites_post_run ( & - im, kice, km, rd, rvrdm1, cplflx, cplwav2atm, frac_grid, flag_cice, thsfc_loc, islmsk, dry, wet, icy, wind, t1, q1, prsl1, & - landfrac, lakefrac, oceanfrac, zorl, zorlo, zorll, zorli, garea, & + im, kice, km, rd, rvrdm1, cplflx, cplwav2atm, lsm, lsm_ruc, frac_grid, flag_cice, thsfc_loc, islmsk, dry, wet, icy, & + wind, t1, q1, prsl1, landfrac, lakefrac, oceanfrac, zorl, zorlo, zorll, zorli, garea, & cd, cd_wat, cd_lnd, cd_ice, cdq, cdq_wat, cdq_lnd, cdq_ice, rb, rb_wat, rb_lnd, rb_ice, stress, stress_wat, stress_lnd, & stress_ice, ffmm, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh, ffhh_wat, ffhh_lnd, ffhh_ice, uustar, uustar_wat, uustar_lnd, & uustar_ice, fm10, fm10_wat, fm10_lnd, fm10_ice, fh2, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, & @@ -417,7 +448,7 @@ subroutine GFS_surface_composites_post_run ( implicit none - integer, intent(in) :: im, kice, km + integer, intent(in) :: im, kice, km, lsm, lsm_ruc logical, intent(in) :: cplflx, frac_grid, cplwav2atm logical, intent(in) :: lheatstrg logical, dimension(:), intent(in) :: flag_cice, dry, wet, icy @@ -544,6 +575,8 @@ subroutine GFS_surface_composites_post_run ( cdq(i) = cdq_lnd(i) stress(i) = stress_lnd(i) uustar(i) = uustar_lnd(i) + weasd(i) = weasd_lnd(i) + snowd(i) = snowd_lnd(i) elseif(txo == one) then ! 100% open water rb(i) = rb_wat(i) ffmm(i) = ffmm_wat(i) @@ -554,6 +587,8 @@ subroutine GFS_surface_composites_post_run ( cdq(i) = cdq_wat(i) stress(i) = stress_wat(i) uustar(i) = uustar_wat(i) + weasd(i) = zero + snowd(i) = zero elseif(txi == one) then ! 100% ice rb(i) = rb_ice(i) ffmm(i) = ffmm_ice(i) @@ -564,6 +599,14 @@ subroutine GFS_surface_composites_post_run ( cdq(i) = cdq_ice(i) stress(i) = stress_ice(i) uustar(i) = uustar_ice(i) + if(lsm /= lsm_ruc) then + weasd(i) = weasd_ice(i) * cice(i) + snowd(i) = snowd_ice(i) * cice(i) + else + weasd(i) = weasd_ice(i) + snowd(i) = snowd_ice(i) + endif + else ! Mix of multiple surface types (land, water, and/or ice) ! ! re-compute zvfun with composite surface roughness & green vegetation fraction @@ -644,6 +687,7 @@ subroutine GFS_surface_composites_post_run ( do i=1,im if (islmsk(i) == 1) then + !-- land zorl(i) = zorll(i) cd(i) = cd_lnd(i) cdq(i) = cdq_lnd(i) @@ -669,6 +713,7 @@ subroutine GFS_surface_composites_post_run ( hice(i) = zero cice(i) = zero elseif (islmsk(i) == 0) then + !-- water zorl(i) = zorlo(i) cd(i) = cd_wat(i) cdq(i) = cdq_wat(i) @@ -695,6 +740,7 @@ subroutine GFS_surface_composites_post_run ( hice(i) = zero cice(i) = zero else ! islmsk(i) == 2 + !-- ice zorl(i) = zorli(i) cd(i) = cd_ice(i) cdq(i) = cdq_ice(i) @@ -709,8 +755,13 @@ subroutine GFS_surface_composites_post_run ( chh(i) = chh_ice(i) gflx(i) = gflx_ice(i) ep1d(i) = ep1d_ice(i) - weasd(i) = weasd_ice(i) * cice(i) - snowd(i) = snowd_ice(i) * cice(i) + if(lsm /= lsm_ruc) then + weasd(i) = weasd_ice(i) * cice(i) + snowd(i) = snowd_ice(i) * cice(i) + else + weasd(i) = weasd_ice(i) + snowd(i) = snowd_ice(i) + endif qss(i) = qss_ice(i) evap(i) = evap_ice(i) hflx(i) = hflx_ice(i) diff --git a/physics/GFS_surface_composites.meta b/physics/GFS_surface_composites.meta index fde52ed23..1b044fb46 100644 --- a/physics/GFS_surface_composites.meta +++ b/physics/GFS_surface_composites.meta @@ -14,6 +14,22 @@ dimensions = () type = integer intent = in +[xlat_d] + standard_name = latitude_in_degree + long_name = latitude in degree north + units = degree_north + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[xlon_d] + standard_name = longitude_in_degree + long_name = longitude in degree east + units = degree_east + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [flag_init] standard_name = flag_for_first_timestep long_name = flag signaling first time step for time integration loop @@ -70,6 +86,20 @@ dimensions = () type = logical intent = in +[lsm] + standard_name = control_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in +[lsm_ruc] + standard_name = identifier_for_ruc_land_surface_scheme + long_name = flag for RUC land surface model + units = flag + dimensions = () + type = integer + intent = in [landfrac] standard_name = land_area_fraction long_name = fraction of horizontal grid area occupied by land @@ -762,6 +792,20 @@ type = real kind = kind_phys intent = in +[lsm] + standard_name = control_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in +[lsm_ruc] + standard_name = identifier_for_ruc_land_surface_scheme + long_name = flag for RUC land surface model + units = flag + dimensions = () + type = integer + intent = in [landfrac] standard_name = land_area_fraction long_name = fraction of horizontal grid area occupied by land diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index c98dc2169..d6b72ec98 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -112,7 +112,7 @@ MODULE module_sf_mynn !1: check input !2: everything - heavy I/O LOGICAL, PARAMETER :: compute_diag = .false. - LOGICAL, PARAMETER :: compute_flux = .false. !shouldn't need compute + LOGICAL, PARAMETER :: compute_flux = .true. !shouldn't need compute ! these in FV3. They will be written over anyway. ! Computing the fluxes here is leftover from the WRF world.