Changeset 19682


Ignore:
Timestamp:
10/28/15 12:48:57 (9 years ago)
Author:
Eric.Larour
Message:

CHG: added esmfbinders to return surface output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/main/esmfbinders.cpp

    r19527 r19682  
    99const int GCMForcingNumTerms = 1;
    1010const int GCMForcingTerms[GCMForcingNumTerms]= { SMBgcmEnum};
     11
     12const int ISSMOutputNumTerms = 1;
     13const int ISSMOutputTerms[ISSMOutputNumTerms]= { SurfaceEnum };
    1114
    1215extern "C" {
     
    9699                /*}}}*/
    97100
     101                /*Retrieve ISSM outputs and pass them back to the Gcm : {{{*/
     102                for (int f=0;f<ISSMOutputNumTerms;f++){
     103
     104                        int output_type=ISSMOutputTerms[f];
     105
     106                        for (int i=0;i<femmodel->elements->Size();i++){
     107                                Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
     108
     109                                switch(output_type){
     110                                        case SurfaceEnum:
     111                                                /*{{{*/
     112                                                {
     113
     114                                                IssmDouble surface;
     115                                               
     116                                                /*Recover surface from the ISSM element: */
     117                                                Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input);
     118                                                surface_input->GetInputAverage(&surface);
     119                       
     120                                                *(issmoutputs+f*numberofelements+i) = surface;
     121
     122                                                }
     123                                                /*}}}*/
     124                                                break;
     125                                        default:
     126                                                { _error_("Unknown output type " << output_type << "\n"); }
     127                                                break;
     128                                }
     129                        }
     130                }
     131
     132                /*}}}*/
     133
    98134                /*Before running, setup the time interval: */
    99135                femmodel->parameters->FindParam(&start_time,TimesteppingStartTimeEnum);
Note: See TracChangeset for help on using the changeset viewer.