Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into feature/s2s_with…
Browse files Browse the repository at this point in the history
…_lnd
  • Loading branch information
uturuncoglu committed Dec 6, 2024
2 parents bad33b1 + 1648e17 commit 846eb8d
Show file tree
Hide file tree
Showing 15 changed files with 636 additions and 443 deletions.
75 changes: 75 additions & 0 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3121,6 +3121,54 @@ subroutine assign_importdata(jdat, rc)
endif
endif

fldname = 'hflx_fire'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex)) 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)
im = GFS_control%chunk_begin(nb)+ix-1
GFS_sfcprop%hflx_fire(im) = datar82d(i-isc+1,j-jsc+1)
enddo
enddo
endif
endif

fldname = 'evap_fire'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex)) 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)
im = GFS_control%chunk_begin(nb)+ix-1
GFS_sfcprop%evap_fire(im) = datar82d(i-isc+1,j-jsc+1)
enddo
enddo
endif
endif

fldname = 'smoke_fire'
if (trim(impfield_name) == trim(fldname)) then
findex = queryImportFields(fldname)
if (importFieldsValid(findex)) 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)
im = GFS_control%chunk_begin(nb)+ix-1
GFS_sfcprop%smoke_fire(im) = datar82d(i-isc+1,j-jsc+1)
enddo
enddo
endif
endif

! write post merge import data to NetCDF file.
if (GFS_control%cpl_imp_dbg) then
call ESMF_FieldGet(importFields(n), grid=grid, rc=rc)
Expand Down Expand Up @@ -3294,6 +3342,21 @@ subroutine setup_exportdata(rc)
do nb = 1, Atm_block%nblks
select case (trim(fieldname))
!--- Instantaneous quantities
! Instantaneous mean layer pressure (Pa)
case ('inst_pres_levels')
call block_data_copy_or_fill(datar83d, GFS_statein%prsl, zeror8, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! Instantaneous geopotential at model layer centers (m2 s-2)
case ('inst_geop_levels')
call block_data_copy_or_fill(datar83d, GFS_statein%phil, zeror8, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! Instantaneous zonal wind (m s-1)
case ('inst_zonal_wind_levels')
call block_data_copy_or_fill(datar83d, GFS_statein%ugrs, zeror8, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! Instantaneous meridional wind (m s-1)
case ('inst_merid_wind_levels')
call block_data_copy_or_fill(datar83d, GFS_statein%vgrs, zeror8, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! Instantaneous surface roughness length (cm)
case ('inst_surface_roughness')
call block_data_copy(datar82d, GFS_sfcprop%zorl, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! Instantaneous u wind (m/s) 10 m above ground
case ('inst_zonal_wind_height10m')
call block_data_copy(datar82d, GFS_coupling%u10mi_cpl, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
Expand Down Expand Up @@ -3378,6 +3441,9 @@ subroutine setup_exportdata(rc)
! Land/Sea mask (sea:0,land:1)
case ('inst_land_sea_mask', 'slmsk')
call block_data_copy(datar82d, GFS_sfcprop%slmsk, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! Total precipitation amount in each time step
case ('inst_rainfall_amount')
call block_data_copy(datar82d, GFS_sfcprop%tprcp, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
!--- Mean quantities
! MEAN Zonal compt of momentum flux (N/m**2)
case ('mean_zonal_moment_flx_atm')
Expand Down Expand Up @@ -3430,6 +3496,15 @@ subroutine setup_exportdata(rc)
! MEAN NET sfc uv+vis diffused flux (W/m**2)
case ('mean_net_sw_vis_dif_flx')
call block_data_copy(datar82d, GFS_coupling%nvisdf_cpl, Atm_block, nb, rtime, spval, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! MEAN precipitation rate (kg/m2/s)
case ('mean_prec_rate')
call block_data_copy(datar82d, GFS_sfcprop%tprcp, Atm_block, nb, rtimek, spval, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! MEAN convective precipitation rate (kg/m2/s)
case ('mean_prec_rate_conv')
call block_data_copy(datar82d, GFS_coupling%rainc_cpl, Atm_block, nb, rtimek, spval, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! MEAN snow precipitation rate (kg/m2/s)
case ('mean_fprec_rate')
call block_data_copy(datar82d, GFS_coupling%snow_cpl, Atm_block, nb, rtimek, spval, offset=GFS_Control%chunk_begin(nb), rc=localrc)
! oceanfrac used by atm to calculate fluxes
case ('openwater_frac_in_atm')
call block_data_combine_fractions(datar82d, GFS_sfcprop%oceanfrac, GFS_sfcprop%fice, Atm_block, nb, offset=GFS_Control%chunk_begin(nb), rc=localrc)
Expand Down
7 changes: 7 additions & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'physics/physics/Radiation/RRTMG/radlw_param.f',
'physics/physics/photochem/module_ozphys.F90',
'physics/physics/photochem/module_h2ophys.F90',
'physics/physics/SFC_Models/Land/Noahmp/lnd_iau_mod.F90',
'data/CCPP_typedefs.F90',
'data/GFS_typedefs.F90',
'data/CCPP_data.F90',
Expand Down Expand Up @@ -49,6 +50,12 @@
'module_h2ophys' : '',
'ty_h2ophys' : '',
},
'land_iau_mod' : {
'land_iau_mod' : '',
'land_iau_external_data_type' : '',
'land_iau_state_type' : '',
'land_iau_control_type' : '',
},
'CCPP_typedefs' : {
'GFS_interstitial_type' : 'GFS_Interstitial(cdata%thrd_no)',
'GFDL_interstitial_type' : 'GFDL_interstitial',
Expand Down
51 changes: 2 additions & 49 deletions ccpp/data/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ module CCPP_typedefs
integer :: nbdlw !<
integer :: nbdsw !<
real (kind=kind_phys), pointer :: ncgl(:,:) => null() !<
real (kind=kind_phys), pointer :: ncpi(:,:) => null() !<
real (kind=kind_phys), pointer :: ncpl(:,:) => null() !<
real (kind=kind_phys), pointer :: ncpr(:,:) => null() !<
real (kind=kind_phys), pointer :: ncps(:,:) => null() !<
integer :: ncstrac !<
Expand Down Expand Up @@ -367,15 +365,6 @@ module CCPP_typedefs
real (kind=kind_phys), pointer :: tracer(:,:,:) => null() !<
real (kind=kind_phys), pointer :: aerosolslw(:,:,:,:) => null() !< Aerosol radiative properties in each LW band.
real (kind=kind_phys), pointer :: aerosolssw(:,:,:,:) => null() !< Aerosol radiative properties in each SW band.
real (kind=kind_phys), pointer :: cld_frac(:,:) => null() !< Total cloud fraction
real (kind=kind_phys), pointer :: cld_lwp(:,:) => null() !< Cloud liquid water path
real (kind=kind_phys), pointer :: cld_reliq(:,:) => null() !< Cloud liquid effective radius
real (kind=kind_phys), pointer :: cld_iwp(:,:) => null() !< Cloud ice water path
real (kind=kind_phys), pointer :: cld_reice(:,:) => null() !< Cloud ice effecive radius
real (kind=kind_phys), pointer :: cld_swp(:,:) => null() !< Cloud snow water path
real (kind=kind_phys), pointer :: cld_resnow(:,:) => null() !< Cloud snow effective radius
real (kind=kind_phys), pointer :: cld_rwp(:,:) => null() !< Cloud rain water path
real (kind=kind_phys), pointer :: cld_rerain(:,:) => null() !< Cloud rain effective radius
real (kind=kind_phys), pointer :: precip_frac(:,:) => null() !< Precipitation fraction
real (kind=kind_phys), pointer :: cld_cnv_frac(:,:) => null() !< SGS convective cloud fraction
real (kind=kind_phys), pointer :: cld_cnv_lwp(:,:) => null() !< SGS convective cloud liquid water path
Expand Down Expand Up @@ -766,15 +755,6 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%fluxswDOWN_clrsky (IM, Model%levs+1))
allocate (Interstitial%aerosolslw (IM, Model%levs, Model%rrtmgp_nBandsLW, NF_AELW))
allocate (Interstitial%aerosolssw (IM, Model%levs, Model%rrtmgp_nBandsSW, NF_AESW))
allocate (Interstitial%cld_frac (IM, Model%levs))
allocate (Interstitial%cld_lwp (IM, Model%levs))
allocate (Interstitial%cld_reliq (IM, Model%levs))
allocate (Interstitial%cld_iwp (IM, Model%levs))
allocate (Interstitial%cld_reice (IM, Model%levs))
allocate (Interstitial%cld_swp (IM, Model%levs))
allocate (Interstitial%cld_resnow (IM, Model%levs))
allocate (Interstitial%cld_rwp (IM, Model%levs))
allocate (Interstitial%cld_rerain (IM, Model%levs))
allocate (Interstitial%precip_frac (IM, Model%levs))
allocate (Interstitial%cld_cnv_frac (IM, Model%levs))
allocate (Interstitial%cnv_cloud_overlap_param(IM, Model%levs))
Expand Down Expand Up @@ -862,15 +842,6 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%cnv_ndrop (IM,Model%levs))
allocate (Interstitial%cnv_nice (IM,Model%levs))
end if
if (Model%do_shoc) then
if (.not. associated(Interstitial%qrn)) allocate (Interstitial%qrn (IM,Model%levs))
if (.not. associated(Interstitial%qsnw)) allocate (Interstitial%qsnw (IM,Model%levs))
! DH* updated version of shoc from May 22 2019 (not yet in CCPP) doesn't use qgl? remove?
if (.not. associated(Interstitial%qgl)) allocate (Interstitial%qgl (IM,Model%levs))
! *DH
allocate (Interstitial%ncpi (IM,Model%levs))
allocate (Interstitial%ncpl (IM,Model%levs))
end if
if (Model%lsm == Model%lsm_noahmp) then
allocate (Interstitial%t2mmp (IM))
allocate (Interstitial%q2mp (IM))
Expand Down Expand Up @@ -1176,15 +1147,6 @@ subroutine gfs_interstitial_rad_reset (Interstitial, Model)
Interstitial%fluxswDOWN_clrsky = clear_val
Interstitial%aerosolslw = clear_val
Interstitial%aerosolssw = clear_val
Interstitial%cld_frac = clear_val
Interstitial%cld_lwp = clear_val
Interstitial%cld_reliq = clear_val
Interstitial%cld_iwp = clear_val
Interstitial%cld_reice = clear_val
Interstitial%cld_swp = clear_val
Interstitial%cld_resnow = clear_val
Interstitial%cld_rwp = clear_val
Interstitial%cld_rerain = clear_val
Interstitial%precip_frac = clear_val
Interstitial%cld_cnv_frac = clear_val
Interstitial%cnv_cloud_overlap_param = clear_val
Expand Down Expand Up @@ -1471,15 +1433,6 @@ subroutine gfs_interstitial_phys_reset (Interstitial, Model)
Interstitial%cnv_ndrop = clear_val
Interstitial%cnv_nice = clear_val
end if
if (Model%do_shoc) then
Interstitial%qrn = clear_val
Interstitial%qsnw = clear_val
! DH* updated version of shoc from May 22 2019 doesn't use qgl? remove?
Interstitial%qgl = clear_val
! *DH
Interstitial%ncpi = clear_val
Interstitial%ncpl = clear_val
end if
if (Model%lsm == Model%lsm_noahmp) then
Interstitial%t2mmp = clear_val
Interstitial%q2mp = clear_val
Expand Down Expand Up @@ -1667,8 +1620,8 @@ subroutine gfdl_interstitial_create (Interstitial, is, ie, isd, ied, js, je, jsd
else
Interstitial%ngas = 0
end if
allocate(Interstitial%rilist(0:Interstitial%ngas))
allocate(Interstitial%cpilist(0:Interstitial%ngas))
allocate (Interstitial%rilist(0:Interstitial%ngas))
allocate (Interstitial%cpilist(0:Interstitial%ngas))
if (present(rilist)) then
Interstitial%rilist = rilist(0:Interstitial%ngas)
Interstitial%cpilist = cpilist(0:Interstitial%ngas)
Expand Down
29 changes: 10 additions & 19 deletions ccpp/data/CCPP_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
active = (.not. flag_for_rrtmgp_radiation_scheme)
[bexp1d]
standard_name = perturbation_of_soil_type_b_parameter
long_name = perturbation of soil type "b" parameter
Expand Down Expand Up @@ -1390,22 +1391,6 @@
type = real
kind = kind_phys
active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme)
[ncpi]
standard_name = local_ice_number_concentration
long_name = number concentration of ice local to physics
units = kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_shoc)
[ncpl]
standard_name = local_condesed_water_number_concentration
long_name = number concentration of condensed water local to physics
units = kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_shoc)
[ncpr]
standard_name = local_rain_number_concentration
long_name = number concentration of rain local to physics
Expand Down Expand Up @@ -1617,7 +1602,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme .or. flag_for_shoc)
active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme)
[qicn]
standard_name = mass_fraction_of_convective_cloud_ice
long_name = mass fraction of convective cloud ice water
Expand Down Expand Up @@ -1648,15 +1633,15 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme .or. flag_for_shoc)
active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme)
[qsnw]
standard_name = local_snow_water_mixing_ratio
long_name = ratio of mass of snow water to mass of dry air plus vapor (without condensates) local to physics
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme .or. flag_for_shoc)
active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme)
[prcpmp]
standard_name = lwe_thickness_of_explicit_precipitation_amount
long_name = explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep
Expand Down Expand Up @@ -2596,20 +2581,23 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension, number_of_longwave_bands)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[aerosolslw(:,:,:,2)]
standard_name = RRTMGP_aerosol_single_scattering_albedo_for_longwave_bands_01_16
long_name = aerosol single scattering albedo for longwave bands 01-16
units = frac
dimensions = (horizontal_loop_extent,vertical_layer_dimension, number_of_longwave_bands)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[aerosolslw(:,:,:,3)]
standard_name = RRTMGP_aerosol_asymmetry_parameter_for_longwave_bands_01_16
long_name = aerosol asymmetry parameter for longwave bands 01-16
units = none
dimensions = (horizontal_loop_extent,vertical_layer_dimension, number_of_longwave_bands)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[aerosolssw]
standard_name = RRTMGP_aerosol_optical_properties_for_shortwave_bands_01_16
long_name = aerosol optical properties for shortwave bands 01-16
Expand All @@ -2625,20 +2613,23 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension, number_of_shortwave_bands)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[aerosolssw(:,:,:,2)]
standard_name = RRTMGP_aerosol_single_scattering_albedo_for_shortwave_bands_01_16
long_name = aerosol single scattering albedo for shortwave bands 01-16
units = frac
dimensions = (horizontal_loop_extent,vertical_layer_dimension, number_of_shortwave_bands)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[aerosolssw(:,:,:,3)]
standard_name = RRTMGP_aerosol_asymmetry_parameter_for_shortwave_bands_01_16
long_name = aerosol asymmetry parameter for shortwave bands 01-16
units = none
dimensions = (horizontal_loop_extent,vertical_layer_dimension, number_of_shortwave_bands)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[precip_frac]
standard_name = precipitation_fraction_by_layer
long_name = precipitation fraction in each layer
Expand Down
Loading

0 comments on commit 846eb8d

Please sign in to comment.