Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
Browse files Browse the repository at this point in the history
…ture/gfdlmpv3
  • Loading branch information
dustinswales committed Nov 18, 2024
2 parents 7193dbd + 8f7cab2 commit 4a19ef6
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 3 deletions.
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
71 changes: 69 additions & 2 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ module GFS_typedefs
use module_radlw_parameters, only: topflw_type, sfcflw_type
use module_ozphys, only: ty_ozphys
use module_h2ophys, only: ty_h2ophys
use land_iau_mod, only: land_iau_external_data_type, land_iau_control_type, &
land_iau_state_type, land_iau_mod_set_control

implicit none

Expand Down Expand Up @@ -480,7 +482,12 @@ module GFS_typedefs

!--- For smoke and dust auxiliary inputs
real (kind=kind_phys), pointer :: fire_in (:,:) => null() !< fire auxiliary inputs


!--- Land IAU DDTs
type(land_iau_external_data_type) :: land_iau_data
type(land_iau_control_type) :: land_iau_control
type(land_iau_state_type) :: land_iau_state

contains
procedure :: create => sfcprop_create !< allocate array data
end type GFS_sfcprop_type
Expand Down Expand Up @@ -1644,6 +1651,19 @@ module GFS_typedefs
type(ty_h2ophys) :: h2ophys !< DDT with data needed by h2o photchemistry physics.
integer :: levh2o !< Number of vertical layers in stratospheric h2o data.
integer :: h2o_coeff !< Number of coefficients in stratospheric h2o data.

! !--- Land IAU
! !> land iau setting read from namelist
! logical :: do_land_iau
! real(kind=kind_phys) :: land_iau_delthrs
! character(len=240) :: land_iau_inc_files(7)
! real(kind=kind_phys) :: land_iau_fhrs(7)
! logical :: land_iau_filter_increments
! integer :: lsoil_incr
! logical :: land_iau_upd_stc
! logical :: land_iau_upd_slc
! logical :: land_iau_do_stcsmc_adjustment
! real(kind=kind_phys) :: land_iau_min_T_increment

contains
procedure :: init => control_initialize
Expand Down Expand Up @@ -2296,6 +2316,9 @@ subroutine sfcprop_create (Sfcprop, Model)
type(GFS_control_type), intent(in) :: Model
integer :: IM

character(len=512) :: errmsg
integer :: errflg

IM = Model%ncols

!--- physics and radiation
Expand Down Expand Up @@ -2864,6 +2887,20 @@ subroutine sfcprop_create (Sfcprop, Model)
Sfcprop%smoke_fire = zero
endif

! land iau control setting
call land_iau_mod_set_control(Sfcprop%land_iau_control, &
Model%fn_nml, Model%input_nml_file, Model%me, Model%master, &
Model%isc, Model%jsc, Model%nx, Model%ny, Model%tile_num, Model%nblks, Model%blksz, &
Model%lsoil, Model%lsnow_lsm, Model%dtp, Model%fhour, errmsg, errflg)

if (errflg/=0) then
if (Model%me==Model%master) then
write(0,'(a)') "Error inside sfcprop_create"
write(0,'(a)') trim(errmsg)
stop
endif
endif

end subroutine sfcprop_create


Expand Down Expand Up @@ -3987,6 +4024,18 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
real(kind=kind_phys) :: radar_tten_limits(2) = (/ limit_unspecified, limit_unspecified /)
integer :: itime

! !> land iau setting read from namelist
! logical :: do_land_iau = .false.
! real(kind=kind_phys) :: land_iau_delthrs = 0
! character(len=240) :: land_iau_inc_files(7) = ''
! real(kind=kind_phys) :: land_iau_fhrs(7) = -1
! logical :: land_iau_filter_increments = .false.
! integer :: lsoil_incr = 4
! logical :: land_iau_upd_stc = .false.
! logical :: land_iau_upd_slc = .false.
! logical :: land_iau_do_stcsmc_adjustment = .false.
! real(kind=kind_phys) :: land_iau_min_T_increment = 0.0001

!--- END NAMELIST VARIABLES

NAMELIST /gfs_physics_nml/ &
Expand Down Expand Up @@ -4143,7 +4192,13 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
! and (maybe) convection suppression
fh_dfi_radar, radar_tten_limits, do_cap_suppress, &
!--- GSL lightning threat indices
lightning_threat
lightning_threat !, &
! !--- land_iau_nml
! do_land_iau, land_iau_delthrs, land_iau_inc_files, &
! land_iau_fhrs, land_iau_filter_increments, lsoil_incr, &
! land_iau_upd_stc, land_iau_upd_slc, &
! land_iau_do_stcsmc_adjustment, land_iau_min_T_increment


!--- other parameters
integer :: nctp = 0 !< number of cloud types in CS scheme
Expand Down Expand Up @@ -6257,6 +6312,18 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
endif
!--- END CODE FROM GLOOPB

! !---Land IAU Settings
! Model%do_land_iau = do_land_iau
! Model%iau_delthrs = land_iau_delthrs
! Model%iau_inc_files = land_iau_inc_files
! Model%iaufhrs = land_iau_fhrs
! Model%iau_filter_increments = land_iau_filter_increments
! Model%lsoil_incr = lsoil_incr
! Model%upd_stc = land_iau_upd_stc
! Model%upd_slc = land_iau_upd_slc
! Model%do_stcsmc_adjustment = land_iau_do_stcsmc_adjustment
! Model%min_T_increment = land_iau_min_T_increment

call Model%print ()

end subroutine control_initialize
Expand Down
20 changes: 19 additions & 1 deletion ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2389,6 +2389,24 @@
type = real
kind = kind_phys
active = (do_fire_coupling)
[land_iau_data]
standard_name = land_data_assimilation_data
long_name = land data assimilation data
units = mixed
dimensions = ()
type = land_iau_external_data_type
[land_iau_control]
standard_name = land_data_assimilation_control
long_name = land data assimilation control
units = mixed
dimensions = ()
type = land_iau_control_type
[land_iau_state]
standard_name = land_data_assimilation_interpolated_data
long_name = land data assimilation space- and time-interpolated
units = mixed
dimensions = ()
type = land_iau_state_type

########################################################################
[ccpp-table-properties]
Expand Down Expand Up @@ -10070,7 +10088,7 @@
dependencies = hooks/machine.F,hooks/physcons.F90
dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f
dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90
dependencies = MP/GFDL_parse_tracers.F90
dependencies = SFC_Models/Land/Noahmp/lnd_iau_mod.F90,MP/GFDL/GFDL_parse_tracers.F90

[ccpp-arg-table]
name = GFS_typedefs
Expand Down
16 changes: 16 additions & 0 deletions ccpp/driver/CCPP_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ subroutine CCPP_step (step, nblks, ierr)
return
end if

! call timestep_init for "physics"---required for Land IAU
call ccpp_physics_timestep_init(cdata_domain, suite_name=trim(ccpp_suite),group_name="physics", ierr=ierr)
if (ierr/=0) then
write(0,'(a)') "An error occurred in ccpp_physics_timestep_init for group physics"
write(0,'(a)') trim(cdata_domain%errmsg)
return
end if

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! DH* 20210104 - this block of code will be removed once the CCPP framework !
! fully supports handling diagnostics through its metadata, work in progress !
Expand Down Expand Up @@ -214,6 +222,14 @@ subroutine CCPP_step (step, nblks, ierr)
return
end if

! call timestep_finalize for "physics"---required for Land IAU
call ccpp_physics_timestep_finalize(cdata_domain, suite_name=trim(ccpp_suite), group_name="physics", ierr=ierr)
if (ierr/=0) then
write(0,'(a)') "An error occurred in ccpp_physics_timestep_finalize for group physics"
write(0,'(a)') trim(cdata_domain%errmsg)
return
end if

! Physics finalize
else if (trim(step)=="physics_finalize") then

Expand Down

0 comments on commit 4a19ef6

Please sign in to comment.