Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UFS-dev PR#155 #1060

Merged
merged 36 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9dc3d40
Inlcude surface ocean currents for the calculation of the air-sea flu…
binli2337 Nov 20, 2023
32584c2
Use the ocean current field for the air-sea flux calculation.
binli2337 Nov 25, 2023
cf408aa
Update sfc_diff.meta
binli2337 Nov 27, 2023
6bdadb5
Set check_ssu_ssv to false in the following files:
binli2337 Nov 29, 2023
a2a2424
Update sfc_diff.meta
binli2337 Nov 29, 2023
9fb9c05
Add a namelist option for including surface ocean current in the comp…
binli2337 Dec 6, 2023
087d425
Merge branch 'ufs/dev' into hafsv2_baseline_with_current
binli2337 Dec 8, 2023
06b0563
Revise the namelist option to include sea surface current in the comp…
binli2337 Dec 8, 2023
a799bc5
Revise the following files for the computation of air-sea fluxes.
binli2337 Dec 19, 2023
a5ac3f5
Updated sfc_diff.f to add the option to check the surface ocean current.
binli2337 Dec 26, 2023
094860f
update sfc_diff.f
binli2337 Dec 27, 2023
19cad16
Update the following files:
binli2337 Dec 30, 2023
e8eaaf9
Code cleanup
binli2337 Jan 3, 2024
f80f52f
Change the variable name for zonal ocean current from ssu to usfco.
binli2337 Jan 5, 2024
fa1078f
Update sfc_diff.f.
binli2337 Jan 6, 2024
f171597
Merge branch 'ufs/dev' into feature/hafsv2_baseline_with_ssc
binli2337 Jan 13, 2024
ea70fbd
Make changes for consistent style.
binli2337 Jan 17, 2024
c946020
fix NSSL MP init issue when initialized from other microphysics schemes
JiliDong-NOAA Jan 17, 2024
4610b23
Merge branch 'ufs-community:ufs/dev' into feature/hafsv2_baseline_wit…
binli2337 Jan 18, 2024
5fe0d63
Change flag_for_air_sea_flux_computation_over_water to
binli2337 Jan 25, 2024
4bdf3fa
add kind_phys to parameter in mp_nssl
JiliDong-NOAA Jan 25, 2024
be9b2b7
add more kind_phys to real variables in mp_nssl
JiliDong-NOAA Jan 25, 2024
5120410
Update standard_name and long_name for usfco and vsfco.
binli2337 Jan 26, 2024
570feac
Merge branch 'ufs-community:ufs/dev' into nssl_mp_init
JiliDong-NOAA Jan 26, 2024
e0401d6
Merge remote-tracking branch 'remotes/upstream/ufs/dev' into feature/…
BinLiu-NOAA Jan 27, 2024
f31b4af
Merge pull request #119 from Qingfu-Liu/HR4_roughness
grantfirl Jan 29, 2024
17280e1
Merge branch 'ufs-community:ufs/dev' into nssl_mp_init
JiliDong-NOAA Jan 29, 2024
ae1f0ca
Merge branch 'ufs/dev' into feature/hafsv2_baseline_with_ssc
binli2337 Jan 30, 2024
d52832b
Merge pull request #157 from JiliDong-NOAA/nssl_mp_init
dustinswales Jan 31, 2024
1545c6b
Merge branch 'ufs-community:ufs/dev' into feature/hafsv2_baseline_wit…
binli2337 Jan 31, 2024
418da82
Merge branch 'feature/hafsv2_baseline_with_ssc' into ufs-dev-PR155
grantfirl Feb 6, 2024
a855644
Merge branch 'ufs-dev-PR120' into ufs-dev-PR155
grantfirl Feb 9, 2024
d1a57a4
Merge branch 'ufs-dev-PR94' into ufs-dev-PR155
grantfirl Feb 10, 2024
5356ef2
fix use_lake_model type in scm_sfc_flux_spec.F90
grantfirl Feb 10, 2024
bb4c4f8
Merge branch 'main' into ufs-dev-PR155
grantfirl Mar 15, 2024
72ab0a6
Merge branch 'main' into ufs-dev-PR155
grantfirl Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ subroutine scm_sfc_flux_spec_run (im, u1, v1, z1, t1, q1, p1, roughness_length,
integer, intent(in) :: im, lkm
integer, intent(inout) :: islmsk(:), use_lake_model(:)
logical, intent(in) :: cplflx, cplice
logical, intent(inout) :: dry(:), icy(:), flag_cice(:), wet(:)
logical, intent(inout) :: dry(:), icy(:), flag_cice(:), wet(:)
real(kind=kind_phys), intent(in) :: cp, grav, hvap, rd, fvirt, vonKarman, min_seaice, tgice, min_lakeice
real(kind=kind_phys), intent(in) :: u1(:), v1(:), z1(:), t1(:), q1(:), p1(:), roughness_length(:), &
spec_sh_flux(:), spec_lh_flux(:), exner_inverse(:), T_surf(:), oceanfrac(:), lakefrac(:), lakedepth(:)
Expand Down Expand Up @@ -212,12 +212,12 @@ subroutine scm_sfc_flux_spec_run (im, u1, v1, z1, t1, q1, p1, roughness_length,
do i = 1, im
if ((wet(i) .or. icy(i)) .and. lakefrac(i) > 0.0_kind_phys) then
if (lkm == 1 .and. lakefrac(i) >= 0.15 .and. lakedepth(i) > 1.0_kind_phys) then
use_lake_model(i) = .true.
use_lake_model(i) = 1
else
use_lake_model(i) = .false.
use_lake_model(i) = 0
endif
else
use_lake_model(i) = .false.
use_lake_model(i) = 0
endif
enddo
!
Expand Down
48 changes: 42 additions & 6 deletions physics/MP/NSSL/mp_nssl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module mp_nssl

private
logical :: is_initialized = .False.
logical :: missing_vars_global = .False.
real :: nssl_qccn

contains
Expand All @@ -26,7 +27,9 @@ module mp_nssl
!! \htmlinclude mp_nssl_init.html
!!
subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, &
mpirank, mpiroot, &
mpirank, mpiroot,mpicomm, &
qc, qr, qi, qs, qh, &
ccw, crw, cci, csw, chw, vh, &
con_g, con_rd, con_cp, con_rv, &
con_t0c, con_cliq, con_csol, con_eps, &
imp_physics, imp_physics_nssl, &
Expand All @@ -36,6 +39,9 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, &


use module_mp_nssl_2mom, only: nssl_2mom_init, nssl_2mom_init_const
#ifdef MPI
use mpi
#endif

implicit none

Expand All @@ -50,16 +56,32 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, &

integer, intent(in) :: mpirank
integer, intent(in) :: mpiroot
integer, intent(in) :: mpicomm
integer, intent(in) :: imp_physics
integer, intent(in) :: imp_physics_nssl
real(kind_phys), intent(in) :: nssl_cccn, nssl_alphah, nssl_alphahl
real(kind_phys), intent(in) :: nssl_alphar, nssl_ehw0, nssl_ehlw0
logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_invertccn, nssl_3moment

real(kind_phys), intent(inout) :: qc (:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: qr (:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: qi (:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: qs (:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: qh (:,:) !(1:ncol,1:nlev) graupel
real(kind_phys), intent(inout) :: ccw(:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: crw(:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: cci(:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: csw(:,:) !(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: chw(:,:) !(1:ncol,1:nlev) graupel number
real(kind_phys), intent(inout) :: vh (:,:) !(1:ncol,1:nlev) graupel volume

! Local variables: dimensions used in nssl_init
integer :: ims,ime, jms,jme, kms,kme, nx, nz, i,k
real :: nssl_params(20)
real(kind_phys) :: nssl_params(20)
integer :: ihailv,ipc
real(kind_phys), parameter :: qmin = 1.e-12
integer :: ierr
logical :: missing_vars = .False.


! Initialize the CCPP error handling variables
Expand Down Expand Up @@ -143,6 +165,19 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, &

! For restart runs, the init is done here
if (restart) then

! For restart, check if the IC is from a different scheme that does not have all the needed variables
missing_vars = .False.
IF ( Any( qc > qmin .and. ccw == 0.0 ) ) missing_vars = .true.
IF ( .not. missing_vars .and. Any( qi > qmin .and. cci == 0.0 ) ) missing_vars = .true.
IF ( .not. missing_vars .and. Any( qs > qmin .and. csw == 0.0 ) ) missing_vars = .true.
IF ( .not. missing_vars .and. Any( qr > qmin .and. crw == 0.0 ) ) missing_vars = .true.
IF ( .not. missing_vars .and. Any( qh > qmin .and. (chw == 0.0 .or. vh == 0.0) ) ) missing_vars = .true.

#ifdef MPI
call MPI_Allreduce(missing_vars, missing_vars_global, 1, MPI_LOGICAL, MPI_LOR, mpicomm, ierr)
#endif

is_initialized = .true.
return
end if
Expand Down Expand Up @@ -312,13 +347,14 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, &
its,ite, jts,jte, kts,kte, i,j,k
integer :: itimestep ! timestep counter
integer :: ntmul, n
real, parameter :: dtpmax = 60. ! allow up to dt=75 (1.25*60)
real(kind_phys), parameter :: dtpmax = 60. ! allow up to dt=75 (1.25*60)
real(kind_phys) :: dtptmp
integer, parameter :: ndebug = 0
logical :: invertccn
real :: cwmas
real(kind_phys) :: cwmas

real(kind_phys), allocatable :: an(:,:,:,:) ! temporary scalar array



errflg = 0
Expand Down Expand Up @@ -529,8 +565,8 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, &
dtptmp = dtp
ntmul = 1
ENDIF
IF ( first_time_step .and. .not. restart ) THEN

IF ( first_time_step .and. ( .not. restart .or. missing_vars_global ) ) THEN
itimestep = 0 ! gets incremented to 1 in call loop
IF ( nssl_ccn_on ) THEN
IF ( invertccn ) THEN
Expand Down
95 changes: 95 additions & 0 deletions physics/MP/NSSL/mp_nssl.meta
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,101 @@
dimensions = ()
type = integer
intent = in
[mpicomm]
standard_name = mpi_communicator
long_name = MPI communicator
units = index
dimensions = ()
type = integer
intent = in
[qc]
standard_name = cloud_liquid_water_mixing_ratio
long_name = cloud water mixing ratio wrt dry+vapor (no condensates)
units = kg kg-1
dimensions = (horizontal_dimension ,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[qr]
standard_name = rain_mixing_ratio
long_name = rain water mixing ratio wrt dry+vapor (no condensates)
units = kg kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[qi]
standard_name = cloud_ice_mixing_ratio
long_name = ice water mixing ratio wrt dry+vapor (no condensates)
units = kg kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[qs]
standard_name = snow_mixing_ratio
long_name = snow water mixing ratio wrt dry+vapor (no condensates)
units = kg kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[qh]
standard_name = graupel_mixing_ratio
long_name = graupel mixing ratio wrt dry+vapor (no condensates)
units = kg kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[ccw]
standard_name = mass_number_concentration_of_cloud_liquid_water_particles_in_air
long_name = cloud droplet number concentration
units = kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[crw]
standard_name = mass_number_concentration_of_rain_water_in_air
long_name = rain number concentration
units = kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[cci]
standard_name = mass_number_concentration_of_cloud_ice_water_crystals_in_air
long_name = ice number concentration
units = kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[csw]
standard_name = mass_number_concentration_of_snow_in_air
long_name = snow number concentration
units = kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[chw]
standard_name = mass_number_concentration_of_graupel_in_air
long_name = graupel number concentration
units = kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[vh]
standard_name = graupel_volume
long_name = graupel particle volume
units = m3 kg-1
dimensions = (horizontal_dimension,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[con_g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
Expand Down
17 changes: 13 additions & 4 deletions physics/PBL/SATMEDMF/satmedmfvdifq.F
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ end subroutine satmedmfvdifq_init
!! \section detail_satmedmfvidfq GFS satmedmfvdifq Detailed Algorithm
subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
& ntiw,ntke,grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, &
& dv,du,tdt,rtg,u1,v1,t1,q1,swh,hlw,xmu, &
& garea,zvfun,sigmaf, &
& dv,du,tdt,rtg,u1,v1,t1,q1,usfco,vsfco,icplocn2atm, &
& swh,hlw,xmu,garea,zvfun,sigmaf, &
& psk,rbsoil,zorl,u10m,v10m,fm,fh, &
& tsea,heat,evap,stress,spd1,kpbl, &
& prsi,del,prsl,prslk,phii,phil,delt, &
Expand Down Expand Up @@ -110,6 +110,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
& tdt(:,:), rtg(:,:,:)
real(kind=kind_phys), intent(in) :: &
& u1(:,:), v1(:,:), &
& usfco(:), vsfco(:), &
& t1(:,:), q1(:,:,:), &
& swh(:,:), hlw(:,:), &
& xmu(:), garea(:), &
Expand All @@ -126,6 +127,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend
integer, intent(in) :: dtidx(:,:), index_of_temperature, &
& index_of_x_wind, index_of_y_wind, index_of_process_pbl
integer, intent(in) :: icplocn2atm
real(kind=kind_phys), intent(out) :: &
& dusfc(:), dvsfc(:), &
& dtsfc(:), dqsfc(:), &
Expand All @@ -142,6 +144,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
!----------------------------------------------------------------------
!***
!*** local variables
real(kind=kind_phys) spd1_m
!***
integer i,is,k,n,ndt,km1,kmpbl,kmscu,ntrac1,idtend
integer kps,kbx,kmx
Expand Down Expand Up @@ -2376,8 +2379,14 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
enddo
enddo
do i = 1,im
dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i)
dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i)
if(icplocn2atm == 0) then
dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i)
dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i)
else if (icplocn2atm ==1) then
spd1_m=sqrt( (u1(i,1)-usfco(i))**2+(v1(i,1)-vsfco(i))**2 )
dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-usfco(i))/spd1_m
dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-vsfco(i))/spd1_m
endif
enddo
!
if(ldiag3d .and. .not. gen_tend) then
Expand Down
23 changes: 23 additions & 0 deletions physics/PBL/SATMEDMF/satmedmfvdifq.meta
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,29 @@
type = real
kind = kind_phys
intent = in
[usfco]
standard_name = x_ocean_current
long_name = zonal current at ocean surface
units = m s-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[vsfco]
standard_name = y_ocean_current
long_name = meridional current at ocean surface
units = m s-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[icplocn2atm]
standard_name = control_for_air_sea_flux_computation_over_water
long_name = air-sea flux option
units = 1
dimensions = ()
type = integer
intent = in
[t1]
standard_name = air_temperature
long_name = layer mean air temperature
Expand Down
12 changes: 10 additions & 2 deletions physics/SFC_Layer/UFS/sfc_diag.f
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, &
& lsm,lsm_ruc,grav,cp,eps,epsm1,con_rocp, &
& con_karman, &
& shflx,cdq,wind, &
& usfco,vsfco,icplocn2atm, &
& zf,ps,u1,v1,t1,q1,prslki,evap,fm,fh,fm10,fh2, &
& ust,tskin,qsurf,thsfc_loc,diag_flux,diag_log, &
& use_lake_model,iopt_lake,iopt_lake_clm, &
Expand All @@ -31,13 +32,15 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, &
!
integer, intent(in) :: im, lsm, lsm_ruc, iopt_lake, iopt_lake_clm
logical, intent(in) :: use_lake2m
integer, intent(in) :: icplocn2atm
logical, intent(in) :: thsfc_loc ! Flag for reference pot. temp.
logical, intent(in) :: diag_flux ! Flag for flux method in 2-m diagnostics
logical, intent(in) :: diag_log ! Flag for 2-m log diagnostics under stable conditions
real(kind=kind_phys), intent(in) :: grav,cp,eps,epsm1,con_rocp
real(kind=kind_phys), intent(in) :: con_karman
real(kind=kind_phys), dimension(:), intent( in) :: &
& zf, ps, u1, v1, t1, q1, ust, tskin, &
& usfco, vsfco, &
& qsurf, prslki, evap, fm, fh, fm10, fh2, &
& shflx, cdq, wind, xlat_d, xlon_d
real(kind=kind_phys), dimension(:), intent(out) :: &
Expand Down Expand Up @@ -89,8 +92,13 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, &

do i = 1, im
f10m(i) = fm10(i) / fm(i)
u10m(i) = f10m(i) * u1(i)
v10m(i) = f10m(i) * v1(i)
if (icplocn2atm ==0) then
u10m(i) = f10m(i) * u1(i)
v10m(i) = f10m(i) * v1(i)
else if (icplocn2atm ==1) then
u10m(i) = usfco(i)+f10m(i) * (u1(i)-usfco(i))
v10m(i) = vsfco(i)+f10m(i) * (v1(i)-vsfco(i))
endif
have_2m = use_lake_model(i)>0 .and. use_lake2m .and. &
& iopt_lake==iopt_lake_clm
if(have_2m) then
Expand Down
23 changes: 23 additions & 0 deletions physics/SFC_Layer/UFS/sfc_diag.meta
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,29 @@
type = real
kind = kind_phys
intent = in
[usfco]
standard_name = x_ocean_current
long_name = zonal current at ocean surface
units = m s-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[vsfco]
standard_name = y_ocean_current
long_name = meridional current at ocean surface
units = m s-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[icplocn2atm]
standard_name = control_for_air_sea_flux_computation_over_water
long_name = air-sea flux option
units = 1
dimensions = ()
type = integer
intent = in
[t1]
standard_name = air_temperature_at_surface_adjacent_layer
long_name = 1st model layer air temperature
Expand Down
Loading
Loading