11 #ifndef OOPS_RUNS_MAKEOBS_H_ 12 #define OOPS_RUNS_MAKEOBS_H_ 16 #include <boost/scoped_ptr.hpp> 17 #include <boost/shared_ptr.hpp> 19 #include "eckit/config/LocalConfiguration.h" 37 #include "oops/util/DateTime.h" 38 #include "oops/util/Duration.h" 39 #include "oops/util/Logger.h" 58 instantiateObsErrorFactory<MODEL>();
59 instantiateFilterFactory<MODEL>();
64 int execute(
const eckit::Configuration & fullConfig)
const {
66 const eckit::LocalConfiguration windowConf(fullConfig,
"Assimilation Window");
67 const util::DateTime bgn(windowConf.getString(
"Begin"));
68 const util::DateTime
end(windowConf.getString(
"End"));
69 const util::Duration fclen(
end - bgn);
70 Log::info() <<
"Observation window is:" << windowConf << std::endl;
73 const eckit::LocalConfiguration resolConfig(fullConfig,
"Geometry");
77 const eckit::LocalConfiguration modelConfig(fullConfig,
"Model");
81 const eckit::LocalConfiguration initialConfig(fullConfig,
"Initial Condition");
82 Log::info() <<
"Initial configuration is:" << initialConfig << std::endl;
84 Log::test() <<
"Initial state: " << xx << std::endl;
92 eckit::LocalConfiguration prtConf;
93 fullConfig.get(
"prints", prtConf);
97 eckit::LocalConfiguration biasConf;
98 fullConfig.get(
"ObsBias", biasConf);
102 const eckit::LocalConfiguration obsconf(fullConfig,
"Observations");
103 Log::info() <<
"Observation configuration is:" << obsconf << std::endl;
108 eckit::LocalConfiguration filterConf;
109 obsconf.get(
"ObsFilters", filterConf);
113 boost::shared_ptr<Observer<MODEL, State_> >
118 model.forecast(xx, moderr, fclen, post);
119 Log::test() <<
"Final state: " << xx << std::endl;
120 Log::info() <<
"MakeObs: Finished observation generation." << std::endl;
122 boost::scoped_ptr<Observations_> yobs(pobs->release());
123 Log::info() <<
"Generated observation: " << *yobs << std::endl;
126 if (obsconf.has(
"obspert")) {
130 double opert = obsconf.getDouble(
"obspert");
133 Log::info() <<
"Perturbed observation: " << *yobs << std::endl;
137 for (std::size_t jj = 0; jj < yobs->size(); ++jj) {
138 Log::test() <<
"Generated observation: " << (*yobs)[jj] << std::endl;
140 yobs->save(
"ObsVal");
153 #endif // OOPS_RUNS_MAKEOBS_H_ ObsOperators< MODEL > ObsOperator_
Departures< MODEL > Departures_
Difference between two observation vectors.
Observations< MODEL > Observations_
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call a get means do a wait to ensure put on remote PE is complete error call increase mpp_nml request_multiply call MPP_TRANSMIT end
ModelAuxControl< MODEL > ModelAux_
std::string appname() const
Encapsulates the model state.
The namespace for the main oops code.
Handles writing-out of forecast fields.
subroutine, public info(self)
int execute(const eckit::Configuration &fullConfig) const
Encapsulates the nonlinear forecast model.
ObsSpaces< MODEL > ObsSpace_
void randomize(Departures_ &) const
Generate random perturbation.
Computes observation equivalent during model run.
ObsFilters< MODEL > ObsFilters_
Geometry< MODEL > Geometry_
Control model post processing.
ObsAuxControl< MODEL > ObsAuxCtrl_
void enrollProcessor(PostBase_ *pp)