Skip to content

Commit

Permalink
new clm lake variables (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTrahanNOAA authored Apr 26, 2023
1 parent 75fed2b commit fe2c158
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 11 deletions.
31 changes: 26 additions & 5 deletions ufs/ccpp/data/MED_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ module MED_typedefs
real(kind=kind_phys), pointer :: fm10_water(:) => null() !< Monin-Obukhov similarity parameter for momentum at 10m over water
real(kind=kind_phys), pointer :: prslki(:) => null() !< Exner function ratio bt midlayer and interface at 1st layer
logical, pointer :: wet(:) => null() !< flag indicating presence of some ocean or lake surface area fraction
logical, pointer :: use_flake(:) => null() !< flag indicating lake points using flake model
integer, pointer :: use_lake_model(:)=>null() !< 0 for points that don't use a lake model, lkm for points that do
real (kind=kind_phys),pointer :: lake_t2m (:) => null() !< 2 meter temperature from CLM Lake model
real (kind=kind_phys),pointer :: lake_q2m (:) => null() !< 2 meter humidity from CLM Lake model
real(kind=kind_phys), pointer :: wind(:) => null() !< wind speed at lowest model level (m/s)
logical, pointer :: flag_iter(:) => null() !< flag for iteration
real(kind=kind_phys), pointer :: qss_water(:) => null() !< surface air saturation specific humidity over water (kg/kg)
Expand Down Expand Up @@ -172,7 +174,7 @@ module MED_typedefs
integer :: sfc_z0_type !< surface roughness options over water
logical :: thsfc_loc !< flag for reference pressure in theta calculation
integer :: nstf_name(5) !< NSSTM flag: off/uncoupled/coupled=0/1/2
integer :: lkm !< flag for flake model
integer :: lkm !< 0 = no lake model, 1 = lake model, 2 = lake & nsst on lake points
logical :: first_time_step !< flag signaling first time step for time integration routine
logical :: frac_grid !< flag for fractional grid
logical :: cplwav2atm !< default no wav->atm coupling
Expand All @@ -189,6 +191,14 @@ module MED_typedefs
integer :: lsoil !< number of soil layers
integer :: kice !< vertical loop extent for ice levels, start at 1
integer :: lsm_ruc !< flag for RUC land surface model

! Lake variables
logical :: frac_ice = .false. !< flag for fractional ice when fractional grid is not in use
logical :: use_lake2m = .false. !< use 2m T & Q calculated by the lake model
integer :: iopt_lake = 1 !< =1 flake, =2 clm lake
integer :: iopt_lake_flake = 1
integer :: iopt_lake_clm = 2

logical :: diag_flux !< flag for flux method of 2-m diagnostics
logical :: diag_log !< flag for log 2-m diagnostics
contains
Expand Down Expand Up @@ -348,8 +358,12 @@ subroutine interstitial_create(interstitial, im)
interstitial%prslki = clear_val
allocate(interstitial%wet(im))
interstitial%wet = .false.
allocate(interstitial%use_flake(im))
interstitial%use_flake = .false.
allocate(interstitial%use_lake_model(im))
interstitial%use_lake_model = 0
allocate(interstitial%lake_t2m(im))
interstitial%lake_t2m=-9999
allocate(interstitial%lake_q2m(im))
interstitial%lake_q2m=-9999
allocate(interstitial%wind(im))
interstitial%wind = huge
allocate(interstitial%flag_iter(im))
Expand Down Expand Up @@ -596,7 +610,9 @@ subroutine interstitial_phys_reset(interstitial)
interstitial%tsurf_ice = huge
interstitial%tsurf_land = huge
interstitial%tsurf_water = huge
interstitial%use_flake = .false.
interstitial%use_lake_model = 0
interstitial%lake_t2m = -9999
interstitial%lake_q2m = -9999
interstitial%uustar_ice = huge
interstitial%uustar_land = huge
interstitial%uustar_water = huge
Expand Down Expand Up @@ -641,6 +657,11 @@ subroutine control_initialize(model)
model%lsoil = 4
model%kice = 2
model%lsm_ruc = 3
model%frac_ice = .false.
model%use_lake2m = .false.
model%iopt_lake = 1
model%iopt_lake_flake = 1
model%iopt_lake_clm = 2
model%diag_flux = .false.
model%diag_log = .false.

Expand Down
58 changes: 52 additions & 6 deletions ufs/ccpp/data/MED_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,28 @@
units = flag
dimensions = (horizontal_loop_extent)
type = logical
[use_flake]
standard_name = flag_for_using_flake
long_name = flag indicating lake points using flake model
[lake_t2m]
standard_name = temperature_at_2m_from_clm_lake
long_name = temperature at 2m from clm lake
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (control_for_lake_model_selection == 2)
[lake_q2m]
standard_name = specific_humidity_at_2m_from_clm_lake
long_name = specific humidity at 2m from clm lake
units = frac
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (control_for_lake_model_selection == 2)
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_loop_extent)
type = logical
type = integer
[wind]
standard_name = wind_speed_at_lowest_model_layer
long_name = wind speed at lowest model level
Expand Down Expand Up @@ -817,9 +833,33 @@
units = flag
dimensions = ()
type = integer
[iopt_lake]
standard_name = control_for_lake_model_selection
long_name = control for lake model selection
units = 1
dimensions = ()
type = integer
[iopt_lake_flake]
standard_name = flake_model_control_selection_value
long_name = value that indicates flake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
[iopt_lake_clm]
standard_name = clm_lake_model_control_selection_value
long_name = value that indicates clm lake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
[use_lake2m]
standard_name = use_2m_diagnostics_calculated_by_lake_model
long_name = model 2m diagnostics use the temperature and humidity calculated by the lake model
units = flag
dimensions = ()
type = integer
[lkm]
standard_name = control_for_lake_surface_scheme
long_name = flag for lake surface model
standard_name = control_for_lake_model_execution_method
long_name = control for lake model execution: 0=no lake, 1=lake, 2=lake+nsst
units = flag
dimensions = ()
type = integer
Expand All @@ -835,6 +875,12 @@
units = flag
dimensions = ()
type = logical
[frac_ice]
standard_name = flag_for_fractional_ice_when_fractional_landmask_is_disabled
long_name = flag for fractional ice when fractional landmask is disabled
units = flag
dimensions = ()
type = logical
[cplwav2atm]
standard_name = flag_for_one_way_ocean_wave_coupling_to_atmosphere
long_name = flag controlling ocean wave coupling to the atmosphere (default off)
Expand Down

0 comments on commit fe2c158

Please sign in to comment.