New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 5928 for branches/2015 – NEMO

Changeset 5928 for branches/2015


Ignore:
Timestamp:
2015-11-26T14:06:35+01:00 (8 years ago)
Author:
cetlod
Message:

NEMO-XIOS2 : XIOS1 by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5918_nemo_v3_6_STABLE_XIOS2/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r5923 r5928  
    9494      CHARACTER(len=*), INTENT(in)  :: cdname 
    9595#if defined key_iomput 
    96 #if defined XIOS1 
    97       TYPE(xios_time)   :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
    98       CHARACTER(len=19) :: cldate  
    99 #else 
    100       TYPE(xios_duration)   :: dtime    = xios_duration(0, 0, 0, 0, 0, 0) 
    101       TYPE(xios_date) :: start_date 
    102 #endif 
    103       CHARACTER(len=10) :: clname 
    104       INTEGER           ::  ji 
     96#if ! defined key_xios2 
     97      TYPE(xios_time)     :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
     98      CHARACTER(len=19)   :: cldate  
     99#else 
     100      TYPE(xios_duration) :: dtime    = xios_duration(0, 0, 0, 0, 0, 0) 
     101      TYPE(xios_date)     :: start_date 
     102#endif 
     103      CHARACTER(len=10)   :: clname 
     104      INTEGER             :: ji 
    105105      ! 
    106106      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_bnds 
    107107      !!---------------------------------------------------------------------- 
    108 #if defined XIOS1 
     108#if ! defined key_xios2 
    109109      ALLOCATE( z_bnds(jpk,2) ) 
    110110#else 
     
    118118 
    119119      ! calendar parameters 
    120 #if defined XIOS1 
     120#if ! defined key_xios2 
    121121      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
    122122      CASE ( 1)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "Gregorian") 
     
    129129      ! Calendar type is now defined in xml file  
    130130      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
    131       CASE ( 1)   ; CALL xios_define_calendar(TYPE="Gregorian", time_origin=xios_date(1900,01,01,00,00,00),start_date = xios_date(nyear,nmonth,nday,0,0,0)) 
    132       CASE ( 0)   ; CALL xios_define_calendar(TYPE="NoLeap", time_origin=xios_date(1900,01,01,00,00,00),start_date = xios_date(nyear,nmonth,nday,0,0,0)) 
    133       CASE (30)   ; CALL xios_define_calendar(TYPE="D360", time_origin=xios_date(1900,01,01,00,00,00),start_date = xios_date(nyear,nmonth,nday,0,0,0)) 
     131      CASE ( 1)   ; CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(1900,01,01,00,00,00), & 
     132          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     133      CASE ( 0)   ; CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(1900,01,01,00,00,00), & 
     134          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     135      CASE (30)   ; CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(1900,01,01,00,00,00), & 
     136          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
    134137      END SELECT 
    135138#endif 
    136139      ! horizontal grid definition 
    137140 
    138 #if defined XIOS1 
     141#if ! defined key_xios2 
    139142      CALL set_scalar 
    140143#endif 
     
    189192 
    190193      ! Add vertical grid bounds 
    191 #if defined XIOS1 
     194#if ! defined key_xios2 
    192195      z_bnds(:      ,1) = gdepw_1d(:) 
    193196      z_bnds(1:jpkm1,2) = gdepw_1d(2:jpk) 
     
    196199      z_bnds(1      ,:) = gdepw_1d(:) 
    197200      z_bnds(2,1:jpkm1) = gdepw_1d(2:jpk) 
    198       z_bnds(2,jpk:) = gdepw_1d(jpk) + e3t_1d(jpk) 
     201      z_bnds(2,jpk:   ) = gdepw_1d(jpk) + e3t_1d(jpk) 
    199202#endif 
    200203 
     
    202205      CALL iom_set_axis_attr( "depthu", bounds=z_bnds ) 
    203206      CALL iom_set_axis_attr( "depthv", bounds=z_bnds ) 
    204 #if defined XIOS1 
    205       z_bnds(:    ,2) = gdept_1d(:) 
    206       z_bnds(2:jpk,1) = gdept_1d(1:jpkm1) 
    207       z_bnds(1    ,1) = gdept_1d(1) - e3w_1d(1) 
    208 #else 
    209       z_bnds(2,:) = gdept_1d(:) 
    210       z_bnds(1,2:jpk) = gdept_1d(1:jpkm1) 
    211       z_bnds(1,1) = gdept_1d(1) - e3w_1d(1) 
     207 
     208#if ! defined key_xios2 
     209      z_bnds(:    ,2)  = gdept_1d(:) 
     210      z_bnds(2:jpk,1)  = gdept_1d(1:jpkm1) 
     211      z_bnds(1    ,1)  = gdept_1d(1) - e3w_1d(1) 
     212#else 
     213      z_bnds(2,:    )  = gdept_1d(:) 
     214      z_bnds(1,2:jpk)  = gdept_1d(1:jpkm1) 
     215      z_bnds(1,1    )  = gdept_1d(1) - e3w_1d(1) 
    212216#endif 
    213217      CALL iom_set_axis_attr( "depthw", bounds=z_bnds ) 
     218 
    214219 
    215220# if defined key_floats 
     
    11901195      LOGICAL,  DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   mask 
    11911196 
    1192 #if defined XIOS1 
     1197#if ! defined key_xios2 
    11931198      IF ( xios_is_valid_domain     (cdid) ) THEN 
    11941199         CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     
    12241229   END SUBROUTINE iom_set_domain_attr 
    12251230 
    1226 #if ! defined XIOS1 
     1231#if defined key_xios2 
    12271232  SUBROUTINE iom_set_zoom_domain_attr( cdid, ibegin, jbegin, ni, nj) 
    12281233     CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
     
    12421247      REAL(wp), DIMENSION(:,:), OPTIONAL, INTENT(in) ::   bounds 
    12431248      IF ( PRESENT(paxis) ) THEN 
    1244 #if defined XIOS1  
     1249#if ! defined key_xios2 
    12451250         IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, size=SIZE(paxis), value=paxis ) 
    12461251         IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, size=SIZE(paxis), value=paxis ) 
     
    12571262   SUBROUTINE iom_set_field_attr( cdid, freq_op, freq_offset ) 
    12581263      CHARACTER(LEN=*)          , INTENT(in) ::   cdid 
    1259 #if defined XIOS1  
    1260       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_op 
    1261       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_offset 
    1262 #else 
    1263       TYPE(xios_duration)   ,OPTIONAL , INTENT(in) ::   freq_op 
    1264       TYPE(xios_duration)   ,OPTIONAL , INTENT(in) ::   freq_offset 
     1264#if ! defined key_xios2 
     1265      CHARACTER(LEN=*)   ,OPTIONAL , INTENT(in) ::   freq_op 
     1266      CHARACTER(LEN=*)   ,OPTIONAL , INTENT(in) ::   freq_offset 
     1267#else 
     1268      TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_op 
     1269      TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_offset 
    12651270#endif 
    12661271      IF ( xios_is_valid_field     (cdid) )   CALL xios_set_field_attr     ( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
     
    12811286      CHARACTER(LEN=*)          , INTENT(in ) ::   cdid 
    12821287      CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix 
    1283 #if defined XIOS1  
     1288#if ! defined key_xios2 
    12841289      CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::    output_freq 
    12851290#else 
     
    12901295      IF( PRESENT( name        ) )   name = ''          ! default values 
    12911296      IF( PRESENT( name_suffix ) )   name_suffix = '' 
    1292 #if defined XIOS1  
     1297#if ! defined key_xios2 
    12931298      IF( PRESENT( output_freq ) )   output_freq = '' 
    12941299#else 
     
    13151320      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
    13161321      LOGICAL, DIMENSION(:,:,:), OPTIONAL, INTENT(in) ::   mask 
    1317 #if defined XIOS1  
     1322#if ! defined key_xios2 
    13181323      IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask=mask ) 
    13191324      IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask=mask ) 
     
    13631368      ni=nlei-nldi+1 ; nj=nlej-nldj+1 
    13641369 
    1365 #if defined XIOS1 
     1370#if ! defined key_xios2 
    13661371     CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 
    13671372#else 
     
    15161521 
    15171522      CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
    1518 #if defined XIOS1 
     1523#if ! defined key_xios2 
    15191524      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 
    15201525      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
     
    15741579      REAL(wp)        ,DIMENSION( 3) ::   zlonpira                 ! longitudes of pirata moorings 
    15751580      REAL(wp)        ,DIMENSION( 9) ::   zlatpira                 ! latitudes  of pirata moorings 
    1576 #if ! defined XIOS1 
     1581#if  defined key_xios2 
    15771582      TYPE(xios_duration)   ::   freq_op, freq_offset 
    15781583#endif 
     
    15811586      !  
    15821587      ! frequency of the call of iom_put (attribut: freq_op) 
    1583 #if defined XIOS1 
     1588#if ! defined key_xios2 
    15841589      WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op = cl1//'ts', freq_offset='0ts') 
    15851590      WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op = cl1//'ts', freq_offset='0ts') 
     
    15891594#else 
    15901595      freq_op%timestep=1         ; freq_offset%timestep=0 ; CALL iom_set_field_attr('field_definition', freq_op = freq_op, freq_offset=freq_offset) 
    1591       freq_op%timestep=nn_fsbc   ; freq_offset%timestep=0 ; CALL iom_set_field_attr('SBC', freq_op = freq_op, freq_offset=freq_offset) 
    1592       freq_op%timestep=nn_fsbc   ; freq_offset%timestep=0 ; CALL iom_set_field_attr('SBC_scalar', freq_op = freq_op, freq_offset=freq_offset) 
    1593       freq_op%timestep=nn_dttrc  ; freq_offset%timestep=0 ; CALL iom_set_field_attr('ptrc_T', freq_op = freq_op, freq_offset=freq_offset) 
    1594       freq_op%timestep=nn_dttrc  ; freq_offset%timestep=0 ; CALL iom_set_field_attr('diad_T', freq_op = freq_op, freq_offset=freq_offset) 
     1596      freq_op%timestep=nn_fsbc   ; freq_offset%timestep=0 ; CALL iom_set_field_attr('SBC'             , freq_op = freq_op, freq_offset=freq_offset) 
     1597      freq_op%timestep=nn_fsbc   ; freq_offset%timestep=0 ; CALL iom_set_field_attr('SBC_scalar'      , freq_op = freq_op, freq_offset=freq_offset) 
     1598      freq_op%timestep=nn_dttrc  ; freq_offset%timestep=0 ; CALL iom_set_field_attr('ptrc_T'          , freq_op = freq_op, freq_offset=freq_offset) 
     1599      freq_op%timestep=nn_dttrc  ; freq_offset%timestep=0 ; CALL iom_set_field_attr('diad_T'          , freq_op = freq_op, freq_offset=freq_offset) 
    15951600#endif 
    15961601        
     
    16151620         ! Equatorial section (attributs: jbegin, ni, name_suffix) 
    16161621         CALL dom_ngb( 0., 0., ix, iy, cl1 ) 
    1617 #if defined XIOS1          
     1622#if ! defined key_xios2 
    16181623         CALL iom_set_domain_attr ('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo) 
    16191624#else 
     
    16991704               ENDIF 
    17001705               clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon)) 
    1701 #if defined XIOS1 
     1706#if ! defined key_xios2 
    17021707               CALL iom_set_domain_attr (TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy) 
    17031708#else 
     
    17321737      REAL(wp)           ::   zsec 
    17331738      LOGICAL            ::   llexist 
    1734 #if ! defined XIOS1 
     1739#if  defined key_xios2 
    17351740      TYPE(xios_duration)   ::   output_freq  
    17361741#endif       
     
    17391744 
    17401745      DO jn = 1,2 
    1741 #if defined XIOS1 
     1746#if ! defined key_xios2 
    17421747         IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = clfreq ) 
    17431748#else 
     
    17551760            END DO 
    17561761 
    1757 #if defined XIOS1 
     1762#if ! defined key_xios2 
    17581763            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    17591764            DO WHILE ( idx /= 0 )  
Note: See TracChangeset for help on using the changeset viewer.