Skip to content
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

Reduce file size via 2-stream model initialization and DA cycling #5

Merged
merged 11 commits into from
Nov 17, 2020
152 changes: 130 additions & 22 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@
<!-- **************************************************************************************** -->

<streams>
<stream name="input"
type="input"
filename_template="x1.40962.init.nc"

<stream name="static"
type="input"
filename_template="x1.40962.static.nc"
input_interval="initial_only"
immutable="true">

Expand Down Expand Up @@ -442,6 +443,10 @@
<var name="fEdge"/>
<var name="fVertex"/>
<var name="meshDensity"/>
<var name="meshScalingDel2"/>
<var name="meshScalingDel4"/>
<var name="meshScalingRegionalCell"/>
<var name="meshScalingRegionalEdge"/>
<var name="bdyMaskCell"/>
<var name="bdyMaskEdge"/>
<var name="bdyMaskVertex"/>
Expand All @@ -467,29 +472,73 @@
<var name="defc_a"/>
<var name="defc_b"/>
<var name="coeffs_reconstruct"/>
<var name="east"/>
<var name="north"/>
<var name="var2d"/>
<var name="con"/>
<var name="oa1"/>
<var name="oa2"/>
<var name="oa3"/>
<var name="oa4"/>
<var name="ol1"/>
<var name="ol2"/>
<var name="ol3"/>
<var name="ol4"/>
<var name="isltyp"/>
<var name="ivgtyp"/>
<var name="mminlu"/>
<var name="landmask"/>
<var name="shdmin"/>
<var name="shdmax"/>
<var name="snoalb"/>
<var name="albedo12m"/>
<var name="greenfrac"/>
<var name="pin"/>
<var name="ozmixm"/>
</stream>

<stream name="input"
type="input"
filename_template="x1.40962.init.nc"
input_interval="initial_only"
immutable="true">

<var_array name="scalars"/>
<var name="initial_time"/>
<var name="xtime"/>
<var name="cldfrac"/>
<var name="re_cloud" packages="mp_thompson_in;mp_wsm6_in"/>
<var name="re_ice" packages="mp_thompson_in;mp_wsm6_in"/>
<var name="re_snow" packages="mp_thompson_in;mp_wsm6_in"/>
<var name="u"/>
<var name="w"/>
<var name="rho"/>
<var name="pressure_p"/>
<var name="pressure_base"/>
<var name="theta"/>
<var name="relhum"/>
<var name="rho_base"/>
<var name="theta_base"/>
<var name="uReconstructZonal"/>
<var name="uReconstructMeridional"/>
<var name="surface_pressure"/>
<var name="isltyp"/>
<var name="ivgtyp"/>
<var name="mminlu"/>
<var name="refl10cm_max"/>
<var name="rainc"/>
<var name="rainnc"/>
<var name="lai"/>
<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="sfc_albbck"/>
<var name="sfc_albedo"/>
<var name="sfc_albedo_seaice"/>
<var name="sfc_emibck"/>
<var name="mavail"/>
<var name="sfc_emiss"/>
<var name="thc"/>
<var name="ust"/>
<var name="xicem"/>
<var name="z0"/>
<var name="znt"/>
<var name="skintemp"/>
<var name="snow"/>
<var name="snowc"/>
Expand All @@ -506,19 +555,11 @@
<var name="t2m"/>
<var name="precipw"/>
<var name="dzs"/>
<var name="zs"/>
<var name="ter"/>
<var name="sh2o"/>
<var name="smois"/>
<var name="tslb"/>
<var name="var2d"/>
<var name="con"/>
<var name="oa1"/>
<var name="oa2"/>
<var name="oa3"/>
<var name="oa4"/>
<var name="ol1"/>
<var name="ol2"/>
<var name="ol3"/>
<var name="ol4"/>
<var name="h_oml_initial"/>
</stream>

Expand Down Expand Up @@ -1117,6 +1158,73 @@
<var_array name="lbc_scalars" />

</stream>

<stream name="da_state"
type="input;output"
filename_template="mpasout.$Y-$M-$D_$h.$m.$s.nc"
input_interval="initial_only"
output_interval="0_06:00:00"
immutable="true">

<var_array name="scalars"/>
<var name="initial_time"/>
<var name="xtime"/>
<var name="cldfrac"/>
<var name="re_cloud" packages="mp_thompson_in;mp_wsm6_in"/>
<var name="re_ice" packages="mp_thompson_in;mp_wsm6_in"/>
<var name="re_snow" packages="mp_thompson_in;mp_wsm6_in"/>
<var name="u"/>
<var name="w"/>
<var name="rho"/>
<var name="pressure_p"/>
<var name="pressure_base"/>
<var name="theta"/>
<var name="relhum"/>
<var name="rho_base"/>
<var name="theta_base"/>
<var name="uReconstructZonal"/>
<var name="uReconstructMeridional"/>
<var name="surface_pressure"/>
<var name="refl10cm_max"/>
<var name="rainc"/>
<var name="rainnc"/>
<var name="lai"/>
<var name="isice_lu"/>
<var name="iswater_lu"/>
<var name="sfc_albbck"/>
<var name="sfc_albedo"/>
<var name="sfc_albedo_seaice"/>
<var name="sfc_emibck"/>
<var name="mavail"/>
<var name="sfc_emiss"/>
<var name="thc"/>
<var name="ust"/>
<var name="xicem"/>
<var name="z0"/>
<var name="znt"/>
<var name="skintemp"/>
<var name="snow"/>
<var name="snowc"/>
<var name="snowh"/>
<var name="sst"/>
<var name="tmn"/>
<var name="vegfra"/>
<var name="seaice"/>
<var name="xice"/>
<var name="xland"/>
<var name="u10"/>
<var name="v10"/>
<var name="q2"/>
<var name="t2m"/>
<var name="precipw"/>
<var name="dzs"/>
<var name="zs"/>
<var name="ter"/>
<var name="sh2o"/>
<var name="smois"/>
<var name="tslb"/>
<var name="h_oml_initial"/>
</stream>
</streams>


Expand Down
4 changes: 3 additions & 1 deletion src/core_atmosphere/mpas_atm_core.F
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,18 @@ function atm_core_init(domain, startTimeStamp) result(ierr)
if (config_do_restart) then
call MPAS_stream_mgr_read(domain % streamManager, streamID='restart', ierr=ierr)
else
call MPAS_stream_mgr_read(domain % streamManager, streamID='static', whence=MPAS_STREAM_NEAREST, ierr=ierr)
call MPAS_stream_mgr_read(domain % streamManager, streamID='input', ierr=ierr)
end if

if (ierr /= MPAS_STREAM_MGR_NOERR) then
call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_ERR)
call mpas_log_write('Error reading initial conditions', messageType=MPAS_LOG_ERR)
call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_CRIT)
end if
call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='static', direction=MPAS_STREAM_INPUT, ierr=ierr)
call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='input', direction=MPAS_STREAM_INPUT, ierr=ierr)
call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='restart', direction=MPAS_STREAM_INPUT, ierr=ierr)

!
! Read all other inputs
! For now we don't do this here to match results with previous code; to match requires
Expand Down
2 changes: 1 addition & 1 deletion src/core_atmosphere/mpas_atm_core_interface.F
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function atm_get_mesh_stream(configs, stream) result(ierr)
else if (config_do_restart) then
write(stream,'(a)') 'restart'
else
write(stream,'(a)') 'input'
write(stream,'(a)') 'static'
end if

end function atm_get_mesh_stream
Expand Down
6 changes: 4 additions & 2 deletions src/core_atmosphere/physics/mpas_atmphys_landuse.F
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu
integer,intent(in):: julday

!local pointers:
logical,pointer:: config_do_restart, &
logical,pointer:: config_do_restart, config_do_DAcycling, &
config_frac_seaice, &
config_sfc_albedo

Expand Down Expand Up @@ -133,6 +133,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu
!call mpas_log_write('--- enter subroutine landuse_init_forMPAS:')

call mpas_pool_get_config(configs,'config_do_restart' ,config_do_restart )
call mpas_pool_get_config(configs,'config_do_DAcycling' ,config_do_DAcycling )
call mpas_pool_get_config(configs,'config_frac_seaice',config_frac_seaice)
call mpas_pool_get_config(configs,'config_sfc_albedo' ,config_sfc_albedo )

Expand Down Expand Up @@ -252,8 +253,9 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu
!call mpas_log_write('--- isice =$i',intArgs=(/isice/))
!call mpas_log_write('--- iswater =$i',intArgs=(/iswater/))
!call mpas_log_write('--- isurban =$i',intArgs=(/isurban/))
if(config_do_restart) then
if(config_do_restart .or. config_do_DAcycling) then
call mpas_log_write('--- config_do_restart =$l', logicArgs=(/config_do_restart/))
call mpas_log_write('--- config_do_DAcycling =$l', logicArgs=(/config_do_DAcycling/))
call mpas_log_write('--- skip the end of landuse_init_forMPAS')
return
endif
Expand Down
4 changes: 4 additions & 0 deletions src/core_init_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,10 @@
<var name="relhum" packages="met_stage_out"/>
<var name="rho_base" packages="met_stage_out"/>
<var name="theta_base" packages="met_stage_out"/>
<var name="pressure_base" packages="met_stage_out"/>
<var name="pressure_p" packages="met_stage_out"/>
<var name="uReconstructZonal" packages="met_stage_out"/>
<var name="uReconstructMeridional" packages="met_stage_out"/>
<var name="surface_pressure" packages="met_stage_out"/>
<var name="precipw" packages="met_stage_out"/>
<var name="h_oml_initial" packages="met_stage_out"/>
Expand Down
2 changes: 1 addition & 1 deletion src/core_init_atmosphere/mpas_init_atm_cases.F
Original file line number Diff line number Diff line change
Expand Up @@ -4498,7 +4498,7 @@ subroutine init_atm_case_gfs(block, mesh, nCells, nEdges, nVertLevels, fg, state
if (allocated(maskslab)) deallocate(maskslab)

! Freeze really cold ocean
where (sst < 271.0 .and. landmask == 0) xice = 1.0
!where (sst < 271.0 .and. landmask == 0) xice = 1.0

! Limit XICE to values between 0 and 1. Although the input meteorological field is between 0.
! and 1., interpolation to the MPAS grid can yield values of XiCE less than 0. and greater
Expand Down