Skip to content

Add LAI to the static information. #1255

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 37 additions & 5 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,18 @@
<var name="surface_pressure"/>

#ifdef DO_PHYSICS
<var name="isltyp"/>
<var name="ivgtyp"/>
<var name="mminlu"/>
<var name="isice_lu"/>
<var name="iswater_lu"/>
<var name="landmask"/>
<var name="shdmin"/>
<var name="shdmax"/>
<var name="snoalb"/>
<var name="albedo12m"/>
<var name="greenfrac"/>
<var name="lai12m"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fields isltyp, ..., greenfrac are added in the "input" and "restart" streams through inclusion of the "invariant" stream (see line 532 and line 581/593). So I think what we want is to add lai12m to the "invariant" stream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgduda Michael, I am sorry I don't understand this comment. I tried to follow albedo12m. Could you please give me more information or make the change as you see needed?

<var name="sfc_albbck"/>
<var name="skintemp"/>
<var name="snow"/>
Expand Down Expand Up @@ -821,6 +833,18 @@
<var name="rnwfablten"/>
<var name="rthratensw"/>
<var name="rthratenlw"/>
<var name="isltyp"/>
<var name="ivgtyp"/>
<var name="mminlu"/>
<var name="isice_lu"/>
<var name="iswater_lu"/>
<var name="landmask"/>
<var name="shdmin"/>
<var name="shdmax"/>
<var name="snoalb"/>
<var name="albedo12m"/>
<var name="greenfrac"/>
<var name="lai12m"/>
<var name="sfc_albbck"/>
<var name="skintemp"/>
<var name="snow"/>
Expand Down Expand Up @@ -2079,11 +2103,6 @@
description="logical for configuration of fractional sea-ice"
possible_values=".true. for sea-ice between 0 or 1; .false. for sea-ice equal to 0 or 1 (flag)."/>

<nml_option name="config_sfc_albedo" type="logical" default_value="true" in_defaults="false"
units="-"
description="logical for configuration of surface albedo"
possible_values=".true. for climatologically varying surface albedo; .false. for fixed input data"/>

<nml_option name="config_sfc_snowalbedo" type="logical" default_value="true" in_defaults="false"
units="-"
description="logical for configuration of maximum surface albedo for snow"
Expand Down Expand Up @@ -2154,6 +2173,16 @@
description="time interval between updates of absorption/emission coefficients in CAM radiation"
possible_values="`DD_HH:MM:SS' or `none'"/>

<nml_option name="config_albedo_update" type="character" default_value="24:00:00" in_defaults="false"
units="-"
description="time interval between updates of greeness fraction"
possible_values="`DD_HH:MM:SS' or `none'"/>

<nml_option name="config_lai_update" type="character" default_value="24:00:00" in_defaults="false"
units="-"
description="time interval between updates of lai"
possible_values="`DD_HH:MM:SS' or `none'"/>

<nml_option name="config_greeness_update" type="character" default_value="24:00:00" in_defaults="false"
units="-"
description="time interval between updates of greeness fraction"
Expand Down Expand Up @@ -3466,6 +3495,9 @@
<var name="albedo12m" type="real" dimensions="nMonths nCells" units="unitless"
description="monthly-mean climatological surface albedo"/>

<var name="lai12m" type="real" dimensions="nMonths nCells" units="unitless"
description="monthly-mean climatological leaf area index"/>

<var name="greenfrac" type="real" dimensions="nMonths nCells" units="unitless"
description="monthly-mean climatological greeness fraction"/>

Expand Down
78 changes: 66 additions & 12 deletions src/core_atmosphere/physics/mpas_atmphys_manager.F
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ module mpas_atmphys_manager
!defines alarm to update the surface boundary conditions:
character(len=*), parameter:: sfcbdyAlarmID = 'sfcbdy'

!defines alarm to update the background surface albedo and the greeness fraction:
!defines alarm to update the background surface albedo:
character(len=*), parameter:: albedoAlarmID = 'albedo'

!defines alarm to update the background greeness fraction:
character(len=*), parameter:: greenAlarmID = 'green'

!defines alarm to update the background leaf area index:
character(len=*), parameter:: laiAlarmID = 'lai'


!defines alarm to update the ozone path length,the trace gas path length,the total emissivity,
!and the total absorptivity in the "CAM" long-wave radiation codes. The default time interval
!between updates is 6 hours and is set with config_camrad_abs_update (00:30:00).
Expand Down Expand Up @@ -149,11 +156,14 @@ subroutine physics_timetracker(domain,dt,clock,itimestep,xtime_s)
!local pointers:
logical,pointer:: config_frac_seaice, &
config_o3climatology, &
config_sfc_albedo, &
config_sst_update, &
config_sstdiurn_update, &
config_deepsoiltemp_update

character(len=StrKIND),pointer:: config_albedo_update, &
config_lai_update, &
config_greeness_update

character(len=StrKIND),pointer:: config_convection_scheme, &
config_radt_lw_scheme, &
config_radt_sw_scheme
Expand Down Expand Up @@ -194,11 +204,14 @@ subroutine physics_timetracker(domain,dt,clock,itimestep,xtime_s)

call mpas_pool_get_config(domain%blocklist%configs,'config_frac_seaice' ,config_frac_seaice )
call mpas_pool_get_config(domain%blocklist%configs,'config_o3climatology' ,config_o3climatology )
call mpas_pool_get_config(domain%blocklist%configs,'config_sfc_albedo' ,config_sfc_albedo )
call mpas_pool_get_config(domain%blocklist%configs,'config_sst_update' ,config_sst_update )
call mpas_pool_get_config(domain%blocklist%configs,'config_sstdiurn_update' ,config_sstdiurn_update )
call mpas_pool_get_config(domain%blocklist%configs,'config_deepsoiltemp_update',config_deepsoiltemp_update)

call mpas_pool_get_config(domain%blocklist%configs,'config_albedo_update' ,config_albedo_update )
call mpas_pool_get_config(domain%blocklist%configs,'config_lai_update' ,config_lai_update )
call mpas_pool_get_config(domain%blocklist%configs,'config_greeness_update' ,config_greeness_update )

!update the current julian day and current year:

currTime = mpas_get_clock_time(clock,MPAS_NOW,ierr)
Expand Down Expand Up @@ -228,12 +241,28 @@ subroutine physics_timetracker(domain,dt,clock,itimestep,xtime_s)
call mpas_pool_get_subpool(block%structs,'diag_physics',diag_physics)


!update the background surface albedo and greeness of vegetation: interpolation of input
!update the background surface albedo: interpolation of input
!monthly values to current day:
if(mpas_is_alarm_ringing(clock,albedoAlarmID,ierr=ierr)) then
call mpas_reset_clock_alarm(clock,albedoAlarmID,ierr=ierr)
call mpas_log_write('--- time to update background surface albedo')
call physics_update_surface_alb(timeStamp,mesh,sfc_input)
endif

!update the background surface leaf area index: interpolation of input
!monthly values to current day:
if(mpas_is_alarm_ringing(clock,laiAlarmID,ierr=ierr)) then
call mpas_reset_clock_alarm(clock,laiAlarmID,ierr=ierr)
call mpas_log_write('--- time to update background leaf area index.')
call physics_update_surface_lai(timeStamp,mesh,sfc_input,diag_physics)
endif

!update the background surface greenness of vegetation: interpolation of input
!monthly values to current day:
if(mpas_is_alarm_ringing(clock,greenAlarmID,ierr=ierr)) then
call mpas_reset_clock_alarm(clock,greenAlarmID,ierr=ierr)
call mpas_log_write('--- time to update background surface albedo, greeness fraction.')
call physics_update_surface(timeStamp,config_sfc_albedo,mesh,sfc_input)
call mpas_log_write('--- time to update background greenness fraction of vegetation')
call physics_update_surface_gvf(timeStamp,mesh,sfc_input)
endif

!update surface boundary conditions with input sea-surface temperatures and fractional
Expand Down Expand Up @@ -398,6 +427,8 @@ subroutine physics_run_init(configs,mesh,state,clock,stream_manager)
config_radtsw_interval, &
config_bucket_update, &
config_camrad_abs_update, &
config_albedo_update, &
config_lai_update, &
config_greeness_update

logical,pointer:: config_sst_update
Expand Down Expand Up @@ -434,11 +465,14 @@ subroutine physics_run_init(configs,mesh,state,clock,stream_manager)
call mpas_pool_get_config(configs,'config_radtsw_interval' ,config_radtsw_interval )
call mpas_pool_get_config(configs,'config_bucket_update' ,config_bucket_update )
call mpas_pool_get_config(configs,'config_camrad_abs_update',config_camrad_abs_update)
call mpas_pool_get_config(configs,'config_greeness_update' ,config_greeness_update )
call mpas_pool_get_config(configs,'config_sst_update' ,config_sst_update )
call mpas_pool_get_config(configs,'config_frac_seaice' ,config_frac_seaice )
call mpas_pool_get_config(configs,'config_microp_re' ,config_microp_re )

call mpas_pool_get_config(configs,'config_albedo_update' ,config_albedo_update )
call mpas_pool_get_config(configs,'config_lai_update' ,config_lai_update )
call mpas_pool_get_config(configs,'config_greeness_update' ,config_greeness_update )

call mpas_pool_get_config(configs,'config_dt',config_dt)


Expand Down Expand Up @@ -546,12 +580,32 @@ subroutine physics_run_init(configs,mesh,state,clock,stream_manager)

endif

!set alarm for updating the background surface albedo and the greeness fraction:
call mpas_set_timeInterval(alarmTimeStep,timeString=config_greeness_update,ierr=ierr)
alarmStartTime = startTime
call mpas_add_clock_alarm(clock,greenAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
!set alarm for updating the background surface albedo:
if(trim(config_albedo_update) /= "none") then
call mpas_set_timeInterval(alarmTimeStep,timeString=config_albedo_update,ierr=ierr)
alarmStartTime = startTime
call mpas_add_clock_alarm(clock,albedoAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
if(ierr /= 0) &
call physics_error_fatal('subroutine physics_init: error creating alarm albedo')
endif

!set alarm for updating the background leaf area index:
if(trim(config_lai_update) /= "none") then
call mpas_set_timeInterval(alarmTimeStep,timeString=config_lai_update,ierr=ierr)
alarmStartTime = startTime
call mpas_add_clock_alarm(clock,laiAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
if(ierr /= 0) &
call physics_error_fatal('subroutine physics_init: error creating alarm lai')
endif

!set alarm for updating the background greenness pf vegetation:
if(trim(config_greeness_update) /= "none") then
call mpas_set_timeInterval(alarmTimeStep,timeString=config_greeness_update,ierr=ierr)
alarmStartTime = startTime
call mpas_add_clock_alarm(clock,greenAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
if(ierr /= 0) &
call physics_error_fatal('subroutine physics_init: error creating alarm greeness')
call physics_error_fatal('subroutine physics_init: error creating alarm greenness')
endif

!set alarm for updating the surface boundary conditions:
if (config_sst_update) then
Expand Down
104 changes: 83 additions & 21 deletions src/core_atmosphere/physics/mpas_atmphys_update_surface.F
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ module mpas_atmphys_update_surface
private
public:: physics_update_sst, &
physics_update_sstskin, &
physics_update_surface, &
physics_update_surface_alb, &
physics_update_surface_lai, &
physics_update_surface_gvf, &
physics_update_deepsoiltemp


Expand All @@ -29,7 +31,9 @@ module mpas_atmphys_update_surface
!
! subroutines in mpas_atmphys_update_surface:
! -------------------------------------------
! physics_update_surface : update the surface albedo and greeness fraction.
! physics_update_surface_alb : update the surface albedo.
! physics_update_surface_lai : update the surface leaf area index.
! physics_update_surface_gvf : update the surface greeness fraction.
! physics_update_sst : update the sea-surface temperatures.
! physics_update_sstskin : add a diurnal cycle to the sea-surface temperatures.
! physics_update_deepsoiltemp: update the deep soil temperatures.
Expand All @@ -51,27 +55,23 @@ module mpas_atmphys_update_surface


!=================================================================================================================
subroutine physics_update_surface(current_date,config_sfc_albedo,mesh,sfc_input)
subroutine physics_update_surface_alb(current_date,mesh,sfc_input)
!=================================================================================================================

!input variables:
type(mpas_pool_type),intent(in):: mesh
character(len=*),intent(in):: current_date
logical,intent(in):: config_sfc_albedo

!inout variables:
type(mpas_pool_type),intent(inout):: sfc_input

!local pointers:
!logical,pointer:: config_sfc_albedo

integer,pointer:: nCellsSolve
integer,dimension(:),pointer:: landmask

real(kind=RKIND),dimension(:) ,pointer:: sfc_albbck
real(kind=RKIND),dimension(:,:),pointer:: albedo12m
real(kind=RKIND),dimension(:) ,pointer:: vegfra,shdmin,shdmax
real(kind=RKIND),dimension(:,:),pointer:: greenfrac

!local variables:
integer:: iCell
Expand All @@ -84,31 +84,93 @@ subroutine physics_update_surface(current_date,config_sfc_albedo,mesh,sfc_input)
call mpas_pool_get_array(sfc_input,'albedo12m' , albedo12m )
call mpas_pool_get_array(sfc_input,'sfc_albbck', sfc_albbck)

call mpas_pool_get_array(sfc_input,'greenfrac' , greenfrac )
call mpas_pool_get_array(sfc_input,'vegfra' , vegfra )
call mpas_pool_get_array(sfc_input,'shdmin' , shdmin )
call mpas_pool_get_array(sfc_input,'shdmax' , shdmax )

!updates the surface background albedo for the current date as a function of the monthly-mean
!surface background albedo valid on the 15th day of the month, if config_sfc_albedo is true:
if(config_sfc_albedo) then
!surface background albedo valid on the 15th day of the month:
call monthly_interp_to_date(nCellsSolve,current_date,albedo12m,sfc_albbck)

call monthly_interp_to_date(nCellsSolve,current_date,albedo12m,sfc_albbck)
do iCell = 1, nCellsSolve
sfc_albbck(iCell) = sfc_albbck(iCell) / 100.
if(landmask(iCell) .eq. 0) sfc_albbck(iCell) = 0.08
enddo

do iCell = 1, nCellsSolve
sfc_albbck(iCell) = sfc_albbck(iCell) / 100.
if(landmask(iCell) .eq. 0) sfc_albbck(iCell) = 0.08
enddo
end subroutine physics_update_surface_alb

endif
!=================================================================================================================
subroutine physics_update_surface_lai(current_date,mesh,sfc_input,diag_physics)
!=================================================================================================================

!input variables:
type(mpas_pool_type),intent(in):: mesh
character(len=*),intent(in):: current_date

!inout variables:
type(mpas_pool_type),intent(inout):: sfc_input
type(mpas_pool_type),intent(inout):: diag_physics

!local pointers:

integer,pointer:: nCellsSolve

real(kind=RKIND),dimension(:,:),pointer:: lai12m
real(kind=RKIND),dimension(:) ,pointer:: lai

!local variables:
integer:: iCell

!-----------------------------------------------------------------------------------------------------------------

call mpas_pool_get_dimension(mesh,'nCellsSolve',nCellsSolve)

call mpas_pool_get_array(sfc_input,'lai12m' , lai12m )
call mpas_pool_get_array(diag_physics,'lai ' , lai )

!updates the leaf area index for the current date as a function of the monthly-mean lai
!valid on the 15th day of the month.
call monthly_interp_to_date(nCellsSolve,current_date,lai12m,lai)

do iCell = 1,nCellsSolve
lai(iCell) = lai(iCell) / 10.
enddo

end subroutine physics_update_surface_lai

!=================================================================================================================
subroutine physics_update_surface_gvf(current_date,mesh,sfc_input)
!=================================================================================================================

!input variables:
type(mpas_pool_type),intent(in):: mesh
character(len=*),intent(in):: current_date

!inout variables:
type(mpas_pool_type),intent(inout):: sfc_input

!local pointers:

integer,pointer:: nCellsSolve

real(kind=RKIND),dimension(:) ,pointer:: vegfra,shdmin,shdmax
real(kind=RKIND),dimension(:,:),pointer:: greenfrac

!local variables:
integer:: iCell

!-----------------------------------------------------------------------------------------------------------------

call mpas_pool_get_dimension(mesh,'nCellsSolve',nCellsSolve)

call mpas_pool_get_array(sfc_input,'greenfrac' , greenfrac )
call mpas_pool_get_array(sfc_input,'vegfra' , vegfra )
call mpas_pool_get_array(sfc_input,'shdmin' , shdmin )
call mpas_pool_get_array(sfc_input,'shdmax' , shdmax )

!updates the green-ness fraction for the current date as a function of the monthly-mean green-
!ness valid on the 15th day of the month. get the min/max for each cell for the monthly green-
!ness fraction:
call monthly_interp_to_date(nCellsSolve,current_date,greenfrac,vegfra)
call monthly_min_max(nCellsSolve,greenfrac,shdmin,shdmax)

end subroutine physics_update_surface
end subroutine physics_update_surface_gvf

!=================================================================================================================
subroutine physics_update_sst(dminfo,config_frac_seaice,mesh,sfc_input,diag_physics)
Expand Down
Loading