00001 /* 00002 COSTA: Problem solving environment for data assimilation 00003 Copyright (C) 2005 Nils van Velzen 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 /** 00021 \file cta_model.h 00022 \brief Interface description of the COSTA default model component. For user implementation see cta_usr_model.h. 00023 00024 Functions for creating and working with models. CTA_Model is the default class implementation for models. 00025 */ 00026 00027 #ifndef CTA_MODEL_FACTORY_H 00028 #define CTA_MODEL_FACTORY_H 00029 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 00036 /** \brief Create a COSTA modell class from XML input file 00037 * (load from methods from dynamic load library) 00038 * 00039 * \param fName I XML-configuration file 00040 * \param modelClass O Class of new model Factory 00041 * \return Model class handle 00042 */ 00043 CTAEXPORT int CTA_ModelFactory_New(const char *fName, CTA_ModelClass* modelClass ); 00044 00045 00046 /** \brief Create a COSTA modell class from XML 00047 * (load from methods from dynamic load library). 00048 * 00049 * \param cur_node I Current XML node 00050 * \return Handle to create or CTA_NULL in case of an error. 00051 */ 00052 CTAEXPORT CTA_ModelClass CTAI_XML_CreateModelClass(xmlNode *cur_node); 00053 00054 /** \brief Define a new class (=implementation) of a COSTA model component 00055 * 00056 * \param name I name of the new model class 00057 * \param h_func I COSTA function handles for functions that implement class, 00058 * missing functions must have value CTA_NULL 00059 * \param hmodcl O receives handle of new model class 00060 * \return error status: CTA_OK if successful 00061 */ 00062 CTAEXPORT int CTA_Model_DefineClass(const char *name, const CTA_Func h_func[CTA_MODEL_NUMFUNC], CTA_ModelClass *hmodcl); 00063 00064 const char *CTAI_ModelFac_GetImplements(CTA_ModelClass hmodcl); 00065 00066 int CTAI_ModelFac_GetParallelData(CTA_ModelClass hmodcl, char **implements, char **parallel_type, 00067 char **spawn_workers, char **nproc, char **ntimes, char **dumProcs); 00068 00069 00070 int CTAI_ModelFac_GetBlock(CTA_ModelClass hmodcl, CTA_Model hmodel); 00071 int CTAI_ModelFac_GetBarrierData(CTA_ModelClass hmodcl, char **flag_barrier, double *t_step ); 00072 int CTAI_ModelFac_AddModelInstance(CTA_ModelClass hmodcl, CTA_Model hmodel); 00073 int CTAI_ModelFac_SetBlock(CTA_ModelClass hmodcl, CTA_Model hmodel); 00074 int CTAI_ModelFac_TimeStepAllModels(CTA_ModelClass hmodcl, CTA_Function *function, double tstart, double tstop); 00075 00076 00077 00078 #ifdef __cplusplus 00079 } 00080 #endif 00081 00082 00083 #endif 00084