  Aims. We aim to develop a fast and consistent extrapolation method to model
multiple layers of the solar atmosphere.
  Methods. The new approach combines the magnetohydrostatic (MHS) extrapolation
which models the solar low atmosphere in a flat box and the nonlinear
force-free field (NLFFF) extrapolation which models the solar corona with a
chromospheric vector magnetogram deduced from the MHS extrapolation. We test
our code with a snapshot of a radiative magnetohydrodynamic simulation of a
solar flare. Comparisons are conducted by several metrics quantitatively.
  Results. Based on a number of test runs, we find out the optimized
configuration for the combination of two extrapolations with a 5.8-Mm-high box
for the MHS extrapolation and a magnetogram at a height of 1 Mm for the NLFFF
extrapolation. The new approach under this configuration is able to reconstruct
the magnetic fields in multi-layers accurately and efficiently. Based on
figures of merit that are used to assess the performance of different
extrapolations (NLFFF extrapolation, MHS extrapolation, and the combined one),
we find the combined extrapolation reaches accuracy of the MHS extrapolation
which is better than the NLFFF extrapolation. The combined extrapolation is
moderately efficient for application to magnetograms with high resolution.
