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 7646 for trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90 – NEMO

Ignore:
Timestamp:
2017-02-06T10:25:03+01:00 (7 years ago)
Author:
timgraham
Message:

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r6519 r7646  
    99   !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add C1D case   
    1010   !!            3.6  ! 2014-15  DIMG format removed 
     11   !!            3.6  ! 2015-15  (J. Harle) Added procedure to read REAL attributes 
    1112   !!-------------------------------------------------------------------- 
    1213 
     
    5253   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .FALSE.       !: iom_put flag 
    5354#endif 
    54    PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 
    55    PUBLIC iom_getatt, iom_use, iom_context_finalize 
     55   PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get 
     56   PUBLIC iom_getatt, iom_putatt, iom_gettime, iom_rstput, iom_put 
     57   PUBLIC iom_use, iom_context_finalize 
    5658 
    5759   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    6769   END INTERFACE 
    6870   INTERFACE iom_getatt 
    69       MODULE PROCEDURE iom_g0d_intatt 
     71      MODULE PROCEDURE iom_g0d_iatt, iom_g0d_ratt, iom_g0d_catt 
     72   END INTERFACE 
     73   INTERFACE iom_putatt 
     74      MODULE PROCEDURE iom_p0d_iatt, iom_p0d_ratt, iom_p0d_catt 
    7075   END INTERFACE 
    7176   INTERFACE iom_rstput 
     
    9398      CHARACTER(len=*), INTENT(in)  :: cdname 
    9499#if defined key_iomput 
    95       TYPE(xios_time)   :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
    96       CHARACTER(len=19) :: cldate  
     100 
     101      TYPE(xios_duration) :: dtime    = xios_duration(0, 0, 0, 0, 0, 0) 
     102      TYPE(xios_date)     :: start_date 
    97103      CHARACTER(len=10) :: clname 
    98       INTEGER           ::   ji 
    99       ! 
    100       REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_bnds 
    101       !!---------------------------------------------------------------------- 
    102  
    103       ALLOCATE( z_bnds(jpk,2) ) 
     104      INTEGER           :: ji, jkmin 
     105      ! 
     106      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zt_bnds, zw_bnds 
     107      !!---------------------------------------------------------------------- 
     108 
     109      ALLOCATE( zt_bnds(2,jpk), zw_bnds(2,jpk) ) 
    104110 
    105111      clname = cdname 
     
    108114      CALL iom_swap( cdname ) 
    109115 
    110       ! calendar parameters 
     116 
     117      ! Calendar type is now defined in xml file  
    111118      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
    112       CASE ( 1)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "Gregorian") 
    113       CASE ( 0)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "NoLeap") 
    114       CASE (30)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "D360") 
     119      CASE ( 1)   ; CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(1900,01,01,00,00,00), & 
     120          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     121      CASE ( 0)   ; CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(1900,01,01,00,00,00), & 
     122          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     123      CASE (30)   ; CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(1900,01,01,00,00,00), & 
     124          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
    115125      END SELECT 
    116       WRITE(cldate,"(i4.4,'-',i2.2,'-',i2.2,' ',i2.2,':',i2.2,':00')") nyear,nmonth,nday,nhour,nminute 
    117       CALL xios_set_context_attr(TRIM(clname), start_date=cldate ) 
    118126 
    119127      ! horizontal grid definition 
     
    169177 
    170178      ! Add vertical grid bounds 
    171       z_bnds(:      ,1) = gdepw_1d(:) 
    172       z_bnds(1:jpkm1,2) = gdepw_1d(2:jpk) 
    173       z_bnds(jpk:   ,2) = gdepw_1d(jpk) + e3t_1d(jpk) 
    174       CALL iom_set_axis_attr( "deptht", bounds=z_bnds ) 
    175       CALL iom_set_axis_attr( "depthu", bounds=z_bnds ) 
    176       CALL iom_set_axis_attr( "depthv", bounds=z_bnds ) 
    177       z_bnds(:    ,2) = gdept_1d(:) 
    178       z_bnds(2:jpk,1) = gdept_1d(1:jpkm1) 
    179       z_bnds(1    ,1) = gdept_1d(1) - e3w_1d(1) 
    180       CALL iom_set_axis_attr( "depthw", bounds=z_bnds ) 
     179      jkmin = MIN(2,jpk)  ! in case jpk=1 (i.e. sas2D) 
     180      zt_bnds(2,:        ) = gdept_1d(:) 
     181      zt_bnds(1,jkmin:jpk) = gdept_1d(1:jpkm1) 
     182      zt_bnds(1,1        ) = gdept_1d(1) - e3w_1d(1) 
     183      zw_bnds(1,:        ) = gdepw_1d(:) 
     184      zw_bnds(2,1:jpkm1  ) = gdepw_1d(jkmin:jpk) 
     185      zw_bnds(2,jpk:     ) = gdepw_1d(jpk) + e3t_1d(jpk) 
     186      CALL iom_set_axis_attr( "deptht", bounds=zt_bnds ) 
     187      CALL iom_set_axis_attr( "depthu", bounds=zt_bnds ) 
     188      CALL iom_set_axis_attr( "depthv", bounds=zt_bnds ) 
     189      CALL iom_set_axis_attr( "depthw", bounds=zw_bnds ) 
     190 
    181191 
    182192# if defined key_floats 
     
    200210      CALL xios_update_calendar(0) 
    201211 
    202       DEALLOCATE( z_bnds ) 
     212      DEALLOCATE( zt_bnds, zw_bnds ) 
    203213 
    204214#endif 
     
    789799                  ENDIF 
    790800                  IF( PRESENT(pv_r3d) ) THEN 
    791                      IF( idom == jpdom_data ) THEN                                  ; icnt(3) = jpkdta 
     801                     IF( idom == jpdom_data ) THEN                                  ; icnt(3) = jpkglo 
    792802                     ELSE IF( ll_depth_spec .AND. PRESENT(kstart) ) THEN            ; istart(3) = kstart(3); icnt(3) = kcount(3) 
    793803                     ELSE                                                           ; icnt(3) = jpk 
     
    971981   !!                   INTERFACE iom_getatt 
    972982   !!---------------------------------------------------------------------- 
    973    SUBROUTINE iom_g0d_intatt( kiomid, cdatt, pvar ) 
     983   SUBROUTINE iom_g0d_iatt( kiomid, cdatt, pvar, cdvar ) 
    974984      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
    975985      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
    976986      INTEGER         , INTENT(  out)                 ::   pvar      ! read field 
     987      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
    977988      ! 
    978989      IF( kiomid > 0 ) THEN 
    979990         IF( iom_file(kiomid)%nfid > 0 ) THEN 
    980991            SELECT CASE (iom_file(kiomid)%iolib) 
    981             CASE (jpnf90   )   ;   CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 
     992            CASE (jpnf90   )   ;   IF( PRESENT(cdvar) ) THEN 
     993                                      CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 
     994                                   ELSE 
     995                                      CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 
     996                                   ENDIF 
    982997            CASE DEFAULT 
    983                CALL ctl_stop( 'iom_g0d_att: accepted IO library is only jpnf90' ) 
     998               CALL ctl_stop( 'iom_g0d_iatt: accepted IO library is only jpnf90' ) 
    984999            END SELECT 
    9851000         ENDIF 
    9861001      ENDIF 
    987    END SUBROUTINE iom_g0d_intatt 
    988  
     1002   END SUBROUTINE iom_g0d_iatt 
     1003 
     1004   SUBROUTINE iom_g0d_ratt( kiomid, cdatt, pvar, cdvar ) 
     1005      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     1006      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     1007      REAL(wp)        , INTENT(  out)                 ::   pvar      ! written field 
     1008      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
     1009      ! 
     1010      IF( kiomid > 0 ) THEN 
     1011         IF( iom_file(kiomid)%nfid > 0 ) THEN 
     1012            SELECT CASE (iom_file(kiomid)%iolib) 
     1013            CASE (jpnf90   )   ;   IF( PRESENT(cdvar) ) THEN 
     1014                                      CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 
     1015                                   ELSE 
     1016                                      CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 
     1017                                   ENDIF 
     1018            CASE DEFAULT     
     1019               CALL ctl_stop( 'iom_g0d_ratt: accepted IO library is only jpnf90' ) 
     1020            END SELECT 
     1021         ENDIF 
     1022      ENDIF 
     1023   END SUBROUTINE iom_g0d_ratt 
     1024 
     1025   SUBROUTINE iom_g0d_catt( kiomid, cdatt, pvar, cdvar ) 
     1026      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     1027      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     1028      CHARACTER(len=*), INTENT(  out)                 ::   pvar      ! written field 
     1029      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
     1030      ! 
     1031      IF( kiomid > 0 ) THEN 
     1032         IF( iom_file(kiomid)%nfid > 0 ) THEN 
     1033            SELECT CASE (iom_file(kiomid)%iolib) 
     1034            CASE (jpnf90   )   ;   IF( PRESENT(cdvar) ) THEN 
     1035                                      CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 
     1036                                   ELSE 
     1037                                      CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 
     1038                                   ENDIF 
     1039            CASE DEFAULT 
     1040               CALL ctl_stop( 'iom_g0d_ratt: accepted IO library is only jpnf90' ) 
     1041            END SELECT 
     1042         ENDIF 
     1043      ENDIF 
     1044   END SUBROUTINE iom_g0d_catt 
     1045 
     1046   !!---------------------------------------------------------------------- 
     1047   !!                   INTERFACE iom_putatt 
     1048   !!---------------------------------------------------------------------- 
     1049   SUBROUTINE iom_p0d_iatt( kiomid, cdatt, pvar, cdvar ) 
     1050      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     1051      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     1052      INTEGER         , INTENT(in   )                 ::   pvar      ! write field 
     1053      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
     1054      ! 
     1055      IF( kiomid > 0 ) THEN 
     1056         IF( iom_file(kiomid)%nfid > 0 ) THEN 
     1057            SELECT CASE (iom_file(kiomid)%iolib) 
     1058            CASE (jpnf90   )   ;   IF( PRESENT(cdvar) ) THEN 
     1059                                      CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 
     1060                                   ELSE 
     1061                                      CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 
     1062                                   ENDIF 
     1063            CASE DEFAULT 
     1064               CALL ctl_stop( 'iom_p0d_iatt: accepted IO library is only jpnf90' ) 
     1065            END SELECT 
     1066         ENDIF 
     1067      ENDIF 
     1068   END SUBROUTINE iom_p0d_iatt 
     1069 
     1070   SUBROUTINE iom_p0d_ratt( kiomid, cdatt, pvar, cdvar ) 
     1071      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     1072      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     1073      REAL(wp)        , INTENT(in   )                 ::   pvar      ! write field 
     1074      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
     1075      ! 
     1076      IF( kiomid > 0 ) THEN 
     1077         IF( iom_file(kiomid)%nfid > 0 ) THEN 
     1078            SELECT CASE (iom_file(kiomid)%iolib) 
     1079            CASE (jpnf90   )   ;   IF( PRESENT(cdvar) ) THEN 
     1080                                      CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 
     1081                                   ELSE 
     1082                                      CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 
     1083                                   ENDIF 
     1084            CASE DEFAULT     
     1085               CALL ctl_stop( 'iom_p0d_ratt: accepted IO library is only jpnf90' ) 
     1086            END SELECT 
     1087         ENDIF 
     1088      ENDIF 
     1089   END SUBROUTINE iom_p0d_ratt 
     1090 
     1091   SUBROUTINE iom_p0d_catt( kiomid, cdatt, pvar, cdvar ) 
     1092      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     1093      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     1094      CHARACTER(len=*), INTENT(in   )                 ::   pvar      ! write field 
     1095      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
     1096      ! 
     1097      IF( kiomid > 0 ) THEN 
     1098         IF( iom_file(kiomid)%nfid > 0 ) THEN 
     1099            SELECT CASE (iom_file(kiomid)%iolib) 
     1100            CASE (jpnf90   )   ;   IF( PRESENT(cdvar) ) THEN 
     1101                                      CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 
     1102                                   ELSE 
     1103                                      CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 
     1104                                   ENDIF 
     1105            CASE DEFAULT 
     1106               CALL ctl_stop( 'iom_p0d_ratt: accepted IO library is only jpnf90' ) 
     1107            END SELECT 
     1108         ENDIF 
     1109      ENDIF 
     1110   END SUBROUTINE iom_p0d_catt 
    9891111 
    9901112   !!---------------------------------------------------------------------- 
     
    11301252      REAL(wp), DIMENSION(:)   , OPTIONAL, INTENT(in) ::   lonvalue, latvalue 
    11311253      REAL(wp), DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   bounds_lon, bounds_lat, area 
    1132       LOGICAL,  DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   mask 
     1254      LOGICAL, DIMENSION(:)   , OPTIONAL, INTENT(in) ::   mask 
     1255 
    11331256 
    11341257      IF ( xios_is_valid_domain     (cdid) ) THEN 
    11351258         CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
    11361259            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
    1137             &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                       & 
    1138             &    lonvalue=lonvalue, latvalue=latvalue, mask=mask, nvertex=nvertex, bounds_lon=bounds_lon,                  & 
    1139             &    bounds_lat=bounds_lat, area=area ) 
    1140       ENDIF 
    1141  
     1260            &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,      & 
     1261            &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear') 
     1262     ENDIF 
    11421263      IF ( xios_is_valid_domaingroup(cdid) ) THEN 
    11431264         CALL xios_set_domaingroup_attr( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
    11441265            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
    1145             &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                       & 
    1146             &    lonvalue=lonvalue, latvalue=latvalue, mask=mask, nvertex=nvertex, bounds_lon=bounds_lon,                  & 
    1147             &    bounds_lat=bounds_lat, area=area ) 
    1148       ENDIF 
     1266            &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,      & 
     1267            &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear' ) 
     1268      ENDIF 
     1269 
    11491270      CALL xios_solve_inheritance() 
    11501271 
    11511272   END SUBROUTINE iom_set_domain_attr 
     1273 
     1274 
     1275   SUBROUTINE iom_set_zoom_domain_attr( cdid, ibegin, jbegin, ni, nj) 
     1276      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
     1277      INTEGER                  , OPTIONAL, INTENT(in) ::   ibegin, jbegin, ni, nj 
     1278 
     1279      IF ( xios_is_valid_zoom_domain     (cdid) ) THEN 
     1280          CALL xios_set_zoom_domain_attr     ( cdid, ibegin=ibegin, jbegin=jbegin, ni=ni,    & 
     1281            &   nj=nj) 
     1282     ENDIF 
     1283   END SUBROUTINE iom_set_zoom_domain_attr 
    11521284 
    11531285 
     
    11561288      REAL(wp), DIMENSION(:)  , OPTIONAL, INTENT(in) ::   paxis 
    11571289      REAL(wp), DIMENSION(:,:), OPTIONAL, INTENT(in) ::   bounds 
     1290 
    11581291      IF ( PRESENT(paxis) ) THEN 
    1159          IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, size=SIZE(paxis), value=paxis ) 
    1160          IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, size=SIZE(paxis), value=paxis ) 
     1292         IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, n_glo=SIZE(paxis), value=paxis ) 
     1293         IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, n_glo=SIZE(paxis), value=paxis ) 
    11611294      ENDIF 
    11621295      IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, bounds=bounds ) 
     
    11681301   SUBROUTINE iom_set_field_attr( cdid, freq_op, freq_offset ) 
    11691302      CHARACTER(LEN=*)          , INTENT(in) ::   cdid 
    1170       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_op 
    1171       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_offset 
     1303      TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_op 
     1304      TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_offset 
    11721305      IF ( xios_is_valid_field     (cdid) )   CALL xios_set_field_attr       & 
    11731306    &     ( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
     
    11891322   SUBROUTINE iom_get_file_attr( cdid, name, name_suffix, output_freq ) 
    11901323      CHARACTER(LEN=*)          , INTENT(in ) ::   cdid 
    1191       CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix, output_freq 
     1324      CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix 
     1325      TYPE(xios_duration), OPTIONAL , INTENT(out) :: output_freq 
    11921326      LOGICAL                                 ::   llexist1,llexist2,llexist3 
    11931327      !--------------------------------------------------------------------- 
    11941328      IF( PRESENT( name        ) )   name = ''          ! default values 
    11951329      IF( PRESENT( name_suffix ) )   name_suffix = '' 
    1196       IF( PRESENT( output_freq ) )   output_freq = '' 
     1330      IF( PRESENT( output_freq ) )   output_freq = xios_duration(0,0,0,0,0,0) 
    11971331      IF ( xios_is_valid_file     (cdid) ) THEN 
    11981332         CALL xios_solve_inheritance() 
     
    12151349      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
    12161350      LOGICAL, DIMENSION(:,:,:), OPTIONAL, INTENT(in) ::   mask 
    1217       IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask=mask ) 
    1218       IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask=mask ) 
     1351      IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask_3D=mask ) 
     1352      IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask_3D=mask ) 
    12191353      CALL xios_solve_inheritance() 
    12201354   END SUBROUTINE iom_set_grid_attr 
     
    12581392      ni=nlei-nldi+1 ; nj=nlej-nldj+1 
    12591393 
    1260       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) 
     1394      CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
    12611395      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
    12621396      CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)),   & 
     
    12721406         END SELECT 
    12731407         ! 
    1274          CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni,nj    /)) /= 0. ) 
     1408         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni*nj    /)) /= 0. ) 
    12751409         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,:),(/ni,nj,jpk/)) /= 0. ) 
    12761410      ENDIF 
     
    14061540      ALLOCATE( zlon(ni*nj) )       ;       zlon(:) = 0. 
    14071541 
    1408       CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 
     1542      CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
     1543      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
    14091544      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
    14101545      CALL iom_set_domain_attr("gznl", lonvalue = zlon,   & 
    14111546         &                             latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))   
    1412       ! 
    1413       CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
    1414       CALL iom_set_domain_attr ('ptr', zoom_ibegin=ix, zoom_nj=jpjglo) 
     1547      CALL iom_set_zoom_domain_attr ("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=jpjglo) 
     1548      ! 
    14151549      CALL iom_update_file_name('ptr') 
    14161550      ! 
     
    14261560      REAL(wp), DIMENSION(1)   ::   zz = 1. 
    14271561      !!---------------------------------------------------------------------- 
    1428       CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea, jbegin=1, ni=1, nj=1) 
     1562 
     1563      CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea-1, jbegin=0, ni=1, nj=1) 
    14291564      CALL iom_set_domain_attr('scalarpoint', data_dim=2, data_ibegin = 1, data_ni = 1, data_jbegin = 1, data_nj = 1) 
    14301565       
     
    14551590      REAL(wp)        ,DIMENSION( 3) ::   zlonpira                 ! longitudes of pirata moorings 
    14561591      REAL(wp)        ,DIMENSION( 9) ::   zlatpira                 ! latitudes  of pirata moorings 
     1592      TYPE(xios_duration)            ::   f_op, f_of 
    14571593      !!---------------------------------------------------------------------- 
    14581594      !  
    14591595      ! frequency of the call of iom_put (attribut: freq_op) 
    1460       WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op = cl1//'ts', freq_offset='0ts') 
    1461       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op = cl1//'ts', freq_offset='0ts') 
    1462       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC_scalar'      , freq_op = cl1//'ts', freq_offset='0ts') 
    1463       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('ptrc_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
    1464       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('diad_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
    1465         
     1596      f_op%timestep = 1        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 
     1597      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC'             , freq_op=f_op, freq_offset=f_of) 
     1598      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC_scalar'      , freq_op=f_op, freq_offset=f_of) 
     1599      f_op%timestep = nn_dttrc ;  f_of%timestep = 0  ; CALL iom_set_field_attr('ptrc_T'          , freq_op=f_op, freq_offset=f_of) 
     1600      f_op%timestep = nn_dttrc ;  f_of%timestep = 0  ; CALL iom_set_field_attr('diad_T'          , freq_op=f_op, freq_offset=f_of) 
     1601 
    14661602      ! output file names (attribut: name) 
    14671603      DO ji = 1, 9 
     
    14841620         ! Equatorial section (attributs: jbegin, ni, name_suffix) 
    14851621         CALL dom_ngb( 0., 0., ix, iy, cl1 ) 
    1486          CALL iom_set_domain_attr ('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo) 
     1622         CALL iom_set_zoom_domain_attr ('Eq'//cl1, jbegin=iy-1, ni=jpiglo) 
    14871623         CALL iom_get_file_attr   ('Eq'//cl1, name_suffix = clsuff             ) 
    14881624         CALL iom_set_file_attr   ('Eq'//cl1, name_suffix = TRIM(clsuff)//'_Eq') 
     
    15641700               ENDIF 
    15651701               clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon)) 
    1566                CALL iom_set_domain_attr (TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy) 
     1702               CALL iom_set_zoom_domain_attr  (TRIM(clname)//cl1, ibegin= ix-1, jbegin= iy-1) 
     1703 
    15671704               CALL iom_get_file_attr   (TRIM(clname)//cl1, name_suffix = clsuff                         ) 
    15681705               CALL iom_set_file_attr   (TRIM(clname)//cl1, name_suffix = TRIM(clsuff)//'_'//TRIM(clname)) 
     
    15931730      REAL(wp)           ::   zsec 
    15941731      LOGICAL            ::   llexist 
     1732      TYPE(xios_duration)   ::   output_freq  
    15951733      !!---------------------------------------------------------------------- 
    15961734 
    15971735      DO jn = 1,2 
    15981736 
    1599          IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = clfreq ) 
     1737         output_freq = xios_duration(0,0,0,0,0,0) 
     1738         IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = output_freq ) 
    16001739         IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname ) 
    16011740 
     
    16101749            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    16111750            DO WHILE ( idx /= 0 )  
    1612                IF ( TRIM(clfreq) /= '' ) THEN 
    1613                   itrlen = LEN_TRIM(clfreq) 
    1614                   IF ( clfreq(itrlen-1:itrlen) == 'mo' ) clfreq = clfreq(1:itrlen-1) 
    1615                   clname = clname(1:idx-1)//TRIM(clfreq)//clname(idx+6:LEN_TRIM(clname)) 
    1616                ELSE 
     1751              IF ( output_freq%timestep /= 0) THEN 
     1752                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts'  
     1753                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1754              ELSE IF ( output_freq%hour /= 0 ) THEN 
     1755                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h'  
     1756                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1757              ELSE IF ( output_freq%day /= 0 ) THEN 
     1758                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d'  
     1759                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1760              ELSE IF ( output_freq%month /= 0 ) THEN    
     1761                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m'  
     1762                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1763              ELSE IF ( output_freq%year /= 0 ) THEN    
     1764                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y'  
     1765                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1766              ELSE 
    16171767                  CALL ctl_stop('error in the name of file id '//TRIM(cdid),   & 
    16181768                     & ' attribute output_freq is undefined -> cannot replace @freq@ in '//TRIM(clname) ) 
    1619                ENDIF 
    1620                idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
     1769              ENDIF 
     1770              clname = clname(1:idx-1)//TRIM(ADJUSTL(clfreq))//clname(idx+6:LEN_TRIM(clname)) 
     1771              idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    16211772            END DO 
    16221773 
Note: See TracChangeset for help on using the changeset viewer.