Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/upstream/develop' into feature/…
Browse files Browse the repository at this point in the history
…hafsv2_baseline_with_ssc
  • Loading branch information
BinLiu-NOAA committed Jan 27, 2024
2 parents 7e9eefa + 1d2c823 commit 9663c74
Show file tree
Hide file tree
Showing 11 changed files with 866 additions and 124 deletions.
266 changes: 260 additions & 6 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,266 @@ subroutine assign_importdata(jdat, rc)
endif
endif

! get surface snow area fraction: over land (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_snow_area_fraction_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%sncovr1_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get snow area fraction from land'
endif
endif

! get latent heat flux: over land (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_laten_heat_flx_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%evap_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get latent heat flux from land'
endif
endif

! get sensible heat flux: over land (if cpllnd=true and cpllnd2atm=true)
!--------------------------------------------------
fldname = 'inst_sensi_heat_flx_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%hflx_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get sensible heat flux from land'
endif
endif

! get surface upward potential latent heat flux: over land (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_potential_laten_heat_flx_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%ep_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get potential latent heat flux from land'
endif
endif

! get 2m air temperature: over land (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_temp_height2m_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%t2mmp_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get temperature at 2m from land'
endif
endif

! get 2m specific humidity: over land (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_spec_humid_height2m_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%q2mp_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get specific humidity at 2m from land'
endif
endif

! get specific humidity: over land (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_spec_humid_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%qsurf_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get specific humidity from land'
endif
endif

! get upward heat flux in soil (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_upward_heat_flux_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%gflux_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get upward heat flux from land'
endif
endif

! get surface runoff in soil (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_runoff_rate_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%runoff_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get surface runoff from land'
endif
endif

! get subsurface runoff in soil (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_subsurface_runoff_rate_lnd'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%drain_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get subsurface runoff from land'
endif
endif

! get momentum exchange coefficient (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_drag_wind_speed_for_momentum'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%cmm_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get drag wind speed for momentum from land'
endif
endif

! get thermal exchange coefficient (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_drag_mass_flux_for_heat_and_moisture'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%chh_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get thermal exchange coefficient form land'
endif
endif

! get function of surface roughness length and green vegetation fraction (if cpllnd=true and cpllnd2atm=true)
!------------------------------------------------
fldname = 'inst_func_of_roughness_length_and_vfrac'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
!$omp parallel do default(shared) private(i,j,nb,ix)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
GFS_data(nb)%Coupling%zvfun_lnd(ix) = datar8(i,j)
endif
enddo
enddo
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get func. of roughness length and vfrac form land'
endif
endif

endif ! if (datar8(isc,jsc) > -99999.0) then

!-------------------------------------------------------
Expand Down Expand Up @@ -3124,12 +3384,6 @@ subroutine setup_exportdata(rc)
! bottom layer meridional wind (v)
case('inst_merid_wind_height_lowest')
call block_data_copy_or_fill(datar82d, DYCORE_data(nb)%coupling%v_bot, zeror8, Atm_block, nb, rc=localrc)
! bottom layer zonal wind (u) from physics
case('inst_zonal_wind_height_lowest_from_phys')
call block_data_copy_or_fill(datar82d, GFS_data(nb)%Statein%ugrs, 1, zeror8, Atm_block, nb, rc=localrc)
! bottom layer meridional wind (v) from physics
case('inst_merid_wind_height_lowest_from_phys')
call block_data_copy_or_fill(datar82d, GFS_data(nb)%Statein%vgrs, 1, zeror8, Atm_block, nb, rc=localrc)
! surface friction velocity
case('surface_friction_velocity')
call block_data_copy_or_fill(datar82d, GFS_data(nb)%Sfcprop%uustar, zeror8, Atm_block, nb, rc=localrc)
Expand Down
1 change: 1 addition & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
'physics/physics/SFC_Layer/UFS/sfc_nst_post.f90',
'physics/physics/SFC_Models/Land/RUC/lsm_ruc.F90',
'physics/physics/SFC_Models/SeaIce/CICE/sfc_cice.f',
'physics/physics/SFC_Models/Land/sfc_land.F90',
'physics/physics/SFC_Models/Land/Noah/lsm_noah.f',
'physics/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90',
'physics/physics/SFC_Models/Lake/Flake/flake_driver.F90',
Expand Down
Loading

0 comments on commit 9663c74

Please sign in to comment.