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

File size reduction #9

Draft
wants to merge 1 commit into
base: develop-for-jedi
Choose a base branch
from
Draft
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
326 changes: 207 additions & 119 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -395,131 +395,162 @@
<!-- **************************************************************************************** -->

<streams>

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

<var name="latCell"/>
<var name="lonCell"/>
<var name="xCell"/>
<var name="yCell"/>
<var name="zCell"/>
<var name="indexToCellID"/>
<var name="latEdge"/>
<var name="lonEdge"/>
<var name="xEdge"/>
<var name="yEdge"/>
<var name="zEdge"/>
<var name="indexToEdgeID"/>
<var name="latVertex"/>
<var name="lonVertex"/>
<var name="xVertex"/>
<var name="yVertex"/>
<var name="zVertex"/>
<var name="indexToVertexID"/>
<var name="cellsOnEdge"/>
<var name="nEdgesOnCell"/>
<var name="nEdgesOnEdge"/>
<var name="edgesOnCell"/>
<var name="edgesOnEdge"/>
<var name="weightsOnEdge"/>
<var name="dvEdge"/>
<var name="dcEdge"/>
<var name="angleEdge"/>
<var name="areaCell"/>
<var name="areaTriangle"/>
<var name="edgeNormalVectors"/>
<var name="localVerticalUnitVectors"/>
<var name="cellTangentPlane"/>
<var name="cellsOnCell"/>
<var name="verticesOnCell"/>
<var name="verticesOnEdge"/>
<var name="edgesOnVertex"/>
<var name="cellsOnVertex"/>
<var name="kiteAreasOnVertex"/>
<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"/>
<var name="cf1"/>
<var name="cf2"/>
<var name="cf3"/>
<var name="zgrid"/>
<var name="rdzw"/>
<var name="dzu"/>
<var name="rdzu"/>
<var name="fzm"/>
<var name="fzp"/>
<var name="zxu"/>
<var name="zz"/>
<var name="zb"/>
<var name="zb3"/>
<var name="dss"/>
<var name="u_init"/>
<var name="v_init"/>
<var name="t_init"/>
<var name="qv_init"/>
<var name="deriv_two"/>
<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 name="latCell"/>
<var name="lonCell"/>
<var name="xCell"/>
<var name="yCell"/>
<var name="zCell"/>
<var name="indexToCellID"/>
<var name="latEdge"/>
<var name="lonEdge"/>
<var name="xEdge"/>
<var name="yEdge"/>
<var name="zEdge"/>
<var name="indexToEdgeID"/>
<var name="latVertex"/>
<var name="lonVertex"/>
<var name="xVertex"/>
<var name="yVertex"/>
<var name="zVertex"/>
<var name="indexToVertexID"/>
<var name="cellsOnEdge"/>
<var name="nEdgesOnCell"/>
<var name="nEdgesOnEdge"/>
<var name="edgesOnCell"/>
<var name="edgesOnEdge"/>
<var name="weightsOnEdge"/>
<var name="dvEdge"/>
<var name="dcEdge"/>
<var name="angleEdge"/>
<var name="areaCell"/>
<var name="areaTriangle"/>
<var name="edgeNormalVectors"/>
<var name="localVerticalUnitVectors"/>
<var name="cellTangentPlane"/>
<var name="cellsOnCell"/>
<var name="verticesOnCell"/>
<var name="verticesOnEdge"/>
<var name="edgesOnVertex"/>
<var name="cellsOnVertex"/>
<var name="kiteAreasOnVertex"/>
<var name="fEdge"/>
<var name="fVertex"/>
<var name="meshDensity"/>
<var name="bdyMaskCell"/>
<var name="bdyMaskEdge"/>
<var name="bdyMaskVertex"/>
<var name="cf1"/>
<var name="cf2"/>
<var name="cf3"/>
<var name="zgrid"/>
<var name="rdzw"/>
<var name="dzu"/>
<var name="rdzu"/>
<var name="fzm"/>
<var name="fzp"/>
<var name="zxu"/>
<var name="zz"/>
<var name="zb"/>
<var name="zb3"/>
<var name="dss"/>
<var name="u_init"/>
<var name="v_init"/>
<var name="t_init"/>
<var name="qv_init"/>
<var name="deriv_two"/>
<var name="defc_a"/>
<var name="defc_b"/>
<var name="coeffs_reconstruct"/>
<var_array name="scalars"/>
<var name="initial_time"/>
<var name="xtime"/>
<var name="u"/>
<var name="w"/>
<var name="rho"/>
<var name="theta"/>
<var name="relhum"/>
<var name="rho_base"/>
<var name="theta_base"/>
<var name="surface_pressure"/>
<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="sfc_albbck"/>
<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="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"/>
<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="pressure_p"/>
<var name="pressure_base"/>
<var name="rho"/>
<var name="rho_base"/>
<var name="theta"/>
<var name="theta_base"/>
<var name="relhum"/>
<var name="uReconstructZonal"/>
<var name="uReconstructMeridional"/>
<var name="surface_pressure"/>
Comment on lines +506 to +524
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like there is one column misalignment, which leads to spurious diffs. Need to re-align those lines.

<var name="refl10cm_max"/>
<var name="rainc"/>
<var name="rainnc"/>
<var name="u10"/>
<var name="v10"/>
<var name="q2"/>
<var name="t2m"/>
<var name="lai"/>
<var name="isice_lu"/>
<var name="iswater_lu"/>
<var name="sfc_albbck"/>
<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="dzs"/>
<var name="zs"/>
<var name="ter"/>
<var name="sh2o"/>
<var name="smois"/>
<var name="tslb"/>
<var name="precipw"/>
<var name="h_oml_initial"/>
</stream>

<stream name="restart"
Expand Down Expand Up @@ -1117,6 +1148,63 @@
<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="pressure_p"/>
<var name="pressure_base"/>
<var name="rho"/>
<var name="rho_base"/>
<var name="theta"/>
<var name="theta_base"/>
<var name="relhum"/>
<var name="uReconstructZonal"/>
<var name="uReconstructMeridional"/>
<var name="surface_pressure"/>
<var name="refl10cm_max"/>
<var name="rainc"/>
<var name="rainnc"/>
<var name="u10"/>
<var name="v10"/>
<var name="q2"/>
<var name="t2m"/>
<var name="lai"/>
<var name="isice_lu"/>
<var name="iswater_lu"/>
<var name="sfc_albbck"/>
<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="dzs"/>
<var name="zs"/>
<var name="ter"/>
<var name="sh2o"/>
<var name="smois"/>
<var name="tslb"/>
<var name="precipw"/>
<var name="h_oml_initial"/>
</stream>
</streams>


Expand Down
7 changes: 7 additions & 0 deletions src/core_atmosphere/mpas_atm_core.F
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ function atm_core_init(domain, startTimeStamp) result(ierr)
! input alarms for both input and restart before reading any remaining
! input streams.
!
call MPAS_stream_mgr_read(domain % streamManager, streamID='static', whence=MPAS_STREAM_NEAREST, ierr=ierr)
if (ierr /= MPAS_STREAM_MGR_NOERR) then
call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_ERR)
call mpas_log_write('Error reading static fields', 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)
Comment on lines +92 to +98
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should make this static stream read optional for now (e.g., through an extra namelist parameter 'separate_init_stream' or something more meaningful?), single file restart/init initialization capability should remain unchanged. It may be more acceptable for the model group if we want to commit this change to the official MPAS model repo.

if (config_do_restart) then
call MPAS_stream_mgr_read(domain % streamManager, streamID='restart', ierr=ierr)
else
Expand Down
13 changes: 1 addition & 12 deletions src/core_atmosphere/mpas_atm_core_interface.F
Original file line number Diff line number Diff line change
Expand Up @@ -302,20 +302,9 @@ function atm_get_mesh_stream(configs, stream) result(ierr)
character(len=StrKIND), intent(out) :: stream
integer :: ierr

logical, pointer :: config_do_restart

ierr = 0

call mpas_pool_get_config(configs, 'config_do_restart', config_do_restart)

if (.not. associated(config_do_restart)) then
call mpas_log_write('config_do_restart was not found when defining mesh stream.', messageType=MPAS_LOG_ERR)
ierr = 1
else if (config_do_restart) then
write(stream,'(a)') 'restart'
else
write(stream,'(a)') 'input'
end if
write(stream,'(a)') 'static'
Comment on lines -309 to +307
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same 'optional' comment as above.


end function atm_get_mesh_stream

Expand Down