Changeset 953


Ignore:
Timestamp:
09/28/16 00:45:10 (8 years ago)
Author:
ymipsl
Message:

Add gaussian grid support./n YM

Location:
XIOS/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/config/domain_attribute.conf

    r789 r953  
    5151DECLARE_ARRAY(double, 2, area) 
    5252 
    53 DECLARE_ENUM3(type,rectilinear,curvilinear,unstructured) 
     53DECLARE_ENUM4(type,rectilinear,curvilinear,unstructured, gaussian) 
    5454DECLARE_ATTRIBUTE(StdString, domain_ref) 
  • XIOS/trunk/src/node/domain.cpp

    r942 r953  
    3434      , isClientAfterTransformationChecked(false), hasLonLat(false) 
    3535      , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() 
    36       , isRedistributed_(false) 
     36      , isRedistributed_(false), hasPole(false) 
    3737   { 
    3838   } 
     
    4444      , isClientAfterTransformationChecked(false), hasLonLat(false) 
    4545      , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() 
    46       , isRedistributed_(false) 
     46      , isRedistributed_(false), hasPole(false) 
    4747   { 
    4848         } 
     
    614614             << "please define the 'type' attribute.") 
    615615     } 
    616  
     616     if (type == type_attr::gaussian)  
     617     { 
     618           hasPole=true ; 
     619           type.setValue(type_attr::unstructured) ; 
     620         } 
     621         else if (type == type_attr::rectilinear) hasPole=true ; 
     622          
    617623     if (type == type_attr::unstructured) 
    618624     { 
  • XIOS/trunk/src/node/domain.hpp

    r924 r953  
    164164         bool hasArea; 
    165165         bool hasLonLat; 
     166         bool hasPole ; 
     167 
    166168      private: 
    167169         void checkDomain(void); 
     
    206208         std::vector<int> nGlobDomain_; 
    207209         bool isUnstructed_; 
    208  
     210        
    209211       private: 
    210212         static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m); 
  • XIOS/trunk/src/test/test_unstruct_complete.f90

    r944 r953  
    204204 
    205205  CALL xios_set_axis_attr("axis_srf",n_glo=llm ,value=lval) ; 
    206   CALL xios_set_domain_attr("domain_srf", ni_glo=ncell_glo, ni=ncell, ibegin=1, i_index=i_index) 
     206  CALL xios_set_domain_attr("domain_srf", ni_glo=ncell_glo, ni=ncell, ibegin=0, i_index=i_index) 
    207207  CALL xios_set_domain_attr("domain_srf", type='unstructured', data_dim=1, data_ni=data_n_index, & 
    208208                                          data_i_index=data_i_index) 
     
    215215  dtime%second=3600 
    216216  CALL xios_set_timestep(dtime) 
     217 
     218  !CALL MSE_XIOS_GAUSS_GRID(NDGLG,NDLON,NPRGPNS ,NPRGPEW,MYSETA,MYSETB) 
     219   CALL MSE_XIOS_GAUSS_GRID(127  ,255  ,mpi_size,1      ,mpi_rank+1, 1) 
     220 
    217221  CALL xios_close_context_definition() 
    218222 
     
    228232     CALL xios_update_calendar(ts) 
    229233     CALL xios_send_field("field_A_srf",field_A_compressed) 
     234     CALL xios_send_field("field_B_srf",field_A_compressed(:,1)) 
    230235    ENDDO 
    231236 
     
    253258  CALL xios_finalize() 
    254259 
    255   END PROGRAM test_unstruct_complete 
    256  
    257  
    258  
    259  
    260  
     260CONTAINS 
     261SUBROUTINE MSE_XIOS_GAUSS_GRID(NDGLG,NDLON,NPRGPNS, NPRGPEW,MYSETA, MYSETB) 
     262!! 
     263!!     PURPOSE : declare to XIOS a distribution for a rectilinear grid 
     264!!     -------- 
     265! 
     266USE XIOS     , ONLY : XIOS_DOMAIN, XIOS_DOMAINGROUP,XIOS_GET_HANDLE, & 
     267                      XIOS_ADD_CHILD, XIOS_SET_DOMAIN_ATTR 
     268! 
     269! 
     270IMPLICIT NONE 
     271! 
     272INTEGER, INTENT(IN) :: NDGLG,NDLON,NPRGPNS, NPRGPEW,MYSETA, MYSETB 
     273! 
     274! 
     275!*       0.2   Declarations of local variables 
     276!              ------------------------------- 
     277! 
     278CHARACTER(LEN=8), PARAMETER       :: YNAMGRID="complete" 
     279INTEGER                           :: NI,NJ,I,J,IOFF,JOFF 
     280REAL                   :: ZINCR 
     281DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:)   :: ZLATI,ZLONG 
     282! 
     283TYPE(xios_domaingroup)            :: domaingroup_hdl 
     284TYPE(xios_domain)                 :: domain_hdl 
     285! 
     286! Basic XIOS declarations 
     287 CALL XIOS_GET_HANDLE("domain_definition",domaingroup_hdl) 
     288 CALL XIOS_ADD_CHILD(domaingroup_hdl,domain_hdl,YNAMGRID) 
     289 CALL XIOS_SET_DOMAIN_ATTR(YNAMGRID, type="rectilinear", data_dim=2) 
     290! 
     291! Compute domain size in longitude  
     292! 
     293IF (MOD(NDLON,NPRGPEW)==0) THEN  
     294   NI=NDLON/NPRGPEW 
     295   IOFF=(MYSETB-1)*NI 
     296ELSE 
     297   NI=NDLON/NPRGPEW+1 
     298   IOFF=(MYSETB-1)*NI 
     299   IF (MYSETB==NPRGPEW) NI=MOD(NDLON,NI) 
     300ENDIF 
     301! 
     302! Compute evenly spaced longitudes 
     303! 
     304ALLOCATE(ZLONG(NI)) 
     305ZINCR=360./NDLON 
     306DO I=1,NI 
     307   ZLONG(I)=(IOFF+I)*ZINCR 
     308ENDDO 
     309! 
     310write(0,*) 'i=',IOFF+1,IOFF+NI 
     311CALL XIOS_SET_DOMAIN_ATTR(YNAMGRID, ni_glo=NDLON, ni=NI,ibegin=IOFF) 
     312 CALL XIOS_SET_DOMAIN_ATTR(YNAMGRID, lonvalue_1d=ZLONG(:)) 
     313! 
     314! Compute domain size in latitude  
     315! 
     316IF (MOD(NDGLG,NPRGPNS)==0) THEN  
     317   NJ=NDGLG/NPRGPNS 
     318   JOFF=(MYSETA-1)*NJ 
     319ELSE 
     320   NJ=NDGLG/NPRGPNS+1 
     321   JOFF=(MYSETA-1)*NJ 
     322   IF (MYSETA==NPRGPNS) NJ=MOD(NDGLG,NJ) 
     323ENDIF 
     324! 
     325ALLOCATE(ZLATI(NJ)) 
     326ZINCR=180./NDGLG 
     327DO J=1,NJ 
     328   ZLATI(J)=(JOFF+J)*ZINCR 
     329ENDDO 
     330! 
     331!write(0,*) 'j=',JOFF+1,JOFF+NJ ; call flush(0) 
     332 CALL XIOS_SET_DOMAIN_ATTR(YNAMGRID, nj_glo=NDGLG, nj=NJ, jbegin=JOFF) 
     333 CALL XIOS_SET_DOMAIN_ATTR(YNAMGRID,latvalue_1d=ZLATI(:)-90.) 
     334! 
     335 DEALLOCATE(ZLATI,ZLONG)!,ZLATIC,ZLONGC) 
     336END SUBROUTINE MSE_XIOS_GAUSS_GRID 
     337 
     338END PROGRAM test_unstruct_complete 
     339 
     340 
     341 
     342 
     343 
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r949 r953  
    8484  CArray<double,2> boundsLatSrc(nVertexSrc,localDomainSrcSize); 
    8585 
    86   if (CDomain::type_attr::rectilinear == domainSrc_->type) srcPole[2] = 1; 
     86  if (domainSrc_->hasPole) srcPole[2] = 1; 
    8787  if (hasBoundSrc)  // Suppose that domain source is curvilinear or unstructured 
    8888  { 
     
    144144  CArray<double,2> boundsLatDest(nVertexDest,localDomainDestSize); 
    145145 
    146   if (CDomain::type_attr::rectilinear == domainDest_->type) dstPole[2] = 1; 
     146  if (domainDest_->hasPole) dstPole[2] = 1; 
    147147  if (hasBoundDest) 
    148148  { 
Note: See TracChangeset for help on using the changeset viewer.