SCALE-RM
Functions/Subroutines
mod_da_param_estimation Module Reference

module Parameter Estimation More...

Functions/Subroutines

subroutine, public da_param_estimation_setup
 Setup. More...
 
subroutine, public da_param_estimation_finalize
 finalize More...
 
subroutine, public da_param_estimation_update
 Data Assimilation. More...
 

Detailed Description

module Parameter Estimation

Description
Parameter Estimation
Author
Team SCALE
NAMELIST
  • PARAM_DA_PARAM_ESTIMATION
    nametypedefault valuecomment
    ESTIMATION_TARGET character(len=H_SHORT), dimension(MAXNUM_PARAM_ESTIMATION)
    PEST_TRANSLATION logical, dimension(MAXNUM_PARAM_ESTIMATION)
    PEST_ULIMIT real(RP), dimension(MAXNUM_PARAM_ESTIMATION)
    PEST_LLIMIT real(RP), dimension(MAXNUM_PARAM_ESTIMATION)

History Output
No history output

Function/Subroutine Documentation

◆ da_param_estimation_setup()

subroutine, public mod_da_param_estimation::da_param_estimation_setup

Setup.

Definition at line 70 of file mod_da_param_estimation.F90.

70  use mpi
71  use scale_prc, only: &
72  prc_abort
73  use scale_comm_ensemble, only: &
74  ensemble_nprocs => comm_ensemble_nprocs, &
75  ensemble_myrank => comm_ensemble_myrank
76  implicit none
77 
78  namelist / param_da_param_estimation / &
79  estimation_target, &
80  pest_translation, &
81  pest_ulimit, &
82  pest_llimit
83 
84  integer :: v
85  integer :: ierr
86  !---------------------------------------------------------------------------
87 
88  num_param_estimation = 0
89  do_param_estimation = .false.
90 
91  estimation_target(:) = ''
92 
93  pest_translation(:) = .false.
94 
95  pest_ulimit(:) = huge(0.0_rp)
96  pest_llimit(:) = -huge(0.0_rp)
97 
98  !--- gather parameters from ensemble communication
99  if ( rp == sp ) then
100  datatype = mpi_real
101  else if( rp == dp ) then
102  datatype = mpi_double_precision
103  else
104  log_error("DA_param_estimation_setup",*) 'The precision has not been implemented yet:', rp
105  call prc_abort
106  endif
107 
108  !--- read namelist
109  rewind(io_fid_conf)
110  read(io_fid_conf,nml=param_da_param_estimation,iostat=ierr)
111  if( ierr < 0 ) then !--- missing
112  log_info("DA_param_estimation_setup",*) 'Not found namelist. Default used.'
113  elseif( ierr > 0 ) then !--- fatal error
114  log_error("DA_param_estimation_setup",*) 'Not appropriate names in namelist PARAM_DA_PARAM_ESTIMATION. Check!'
115  call prc_abort
116  endif
117  log_nml(param_da_param_estimation)
118 
119  do v = 1, maxnum_param_estimation
120  if( trim(estimation_target(v)) /= '' ) then
121  num_param_estimation = num_param_estimation + 1
122  end if
123  end do
124 
125  if( num_param_estimation > maxnum_param_estimation ) then
126  log_error("DA_param_estimation_setup",*) 'NUM_PARAM_ESTIMATION has exceeded the limit! ( MAX = ', maxnum_param_estimation, ')'
127  call prc_abort
128  end if
129 
130  if( num_param_estimation > 0 ) then
131  log_info("DA_param_estimation_setup",*) 'Set up Parameter Estimation module. The number of estimation target:', num_param_estimation
132  do_param_estimation = .true.
133 
134  allocate( param_array( ensemble_nprocs, num_param_estimation ) )
135 
136  call estimation_getvar
137  call estimation_log
138 
139  end if
140 
141  return

References scale_comm_ensemble::comm_ensemble_myrank, scale_comm_ensemble::comm_ensemble_nprocs, scale_precision::dp, scale_io::io_fid_conf, scale_prc::prc_abort(), and scale_precision::sp.

Referenced by mod_da_driver::da_driver_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ da_param_estimation_finalize()

subroutine, public mod_da_param_estimation::da_param_estimation_finalize

finalize

Definition at line 147 of file mod_da_param_estimation.F90.

147  implicit none
148  !---------------------------------------------------------------------------
149 
150  if( allocated( param_array ) ) deallocate( param_array )
151 
152  return

Referenced by mod_da_driver::da_driver_finalize().

Here is the caller graph for this function:

◆ da_param_estimation_update()

subroutine, public mod_da_param_estimation::da_param_estimation_update

Data Assimilation.

Definition at line 158 of file mod_da_param_estimation.F90.

158  use scale_comm_ensemble, only: &
159  ensemble_nprocs => comm_ensemble_nprocs
160  use scale_letkf, only: &
162  implicit none
163 
164  integer :: n, v
165  !---------------------------------------------------------------------------
166 
167  if( .NOT. do_param_estimation ) return
168 
169  !--- get parameters for estimation
170  call estimation_getvar
171 
172  do v = 1, num_param_estimation
173  do n = 1, ensemble_nprocs
174  if( pest_translation(v) ) then ! encoding function by Kotsuki (2015)
175  param_array(n,v) = phys2func( v, param_array(n,v) )
176  end if
177  end do
178  end do
179 
180  !--- execute parameter estimation
181  call letkf_param_estimation_system( num_param_estimation, &
182  param_array(:,:) )
183 
184  do v = 1, num_param_estimation
185  do n = 1, ensemble_nprocs
186  if( pest_translation(v) ) then ! decoding function by Kotsuki (2015)
187  param_array(n,v) = func2phys( v, param_array(n,v) )
188  end if
189  end do
190  end do
191 
192  !--- overwrite parameters
193  call estimation_putvar
194  call estimation_log
195 
196  return

References scale_atmos_phy_cp_kf::atmos_phy_cp_kf_getvar(), scale_atmos_phy_cp_kf::atmos_phy_cp_kf_putvar(), scale_atmos_phy_mp_tomita08::atmos_phy_mp_tomita08_getvar(), scale_atmos_phy_mp_tomita08::atmos_phy_mp_tomita08_putvar(), scale_comm_ensemble::comm_ensemble_myrank, scale_comm_ensemble::comm_ensemble_nprocs, scale_comm_ensemble::comm_ensemble_world, scale_const::const_undef, scale_letkf::letkf_param_estimation_system(), scale_prc::prc_abort(), and scale_time::time_nowdate.

Referenced by mod_da_driver::da_driver_update().

Here is the call graph for this function:
Here is the caller graph for this function:
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_comm_ensemble
module Communication for Ensemble system
Definition: scale_comm_ensemble.F90:12
scale_letkf
module LETKF for Data-Assimilation
Definition: scale_letkf.F90:12
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_comm_ensemble::comm_ensemble_nprocs
integer, public comm_ensemble_nprocs
Definition: scale_comm_ensemble.F90:37
mod_atmos_vars::v
real(rp), dimension(:,:,:), allocatable, target, public v
Definition: mod_atmos_vars.F90:131
scale_letkf::letkf_param_estimation_system
subroutine, public letkf_param_estimation_system(PEST_PMAX, PEST_VAR0)
Definition: scale_letkf.F90:2873
scale_comm_ensemble::comm_ensemble_myrank
integer, public comm_ensemble_myrank
Definition: scale_comm_ensemble.F90:36