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 4792 for branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90 – NEMO

Ignore:
Timestamp:
2014-09-26T13:04:47+02:00 (10 years ago)
Author:
jamesharle
Message:

Updates to code after first successful test + merge with HEAD of trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r4292 r4792  
    3232   USE trc_oce, ONLY :   nn_dttrc        !  !: frequency of step on passive tracers 
    3333   USE icb_oce, ONLY :   nclasses, class_num       !  !: iceberg classes 
     34#if defined key_lim3 
     35   USE par_ice 
     36#elif defined key_lim2 
     37   USE par_ice_2 
     38#endif 
    3439   USE domngb          ! ocean space and time domain 
    3540   USE phycst          ! physical constants 
     
    4954#endif 
    5055   PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 
    51    PUBLIC iom_getatt, iom_context_finalize 
     56   PUBLIC iom_getatt, iom_use, iom_context_finalize 
    5257 
    5358   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    6368   END INTERFACE 
    6469   INTERFACE iom_getatt 
    65       MODULE PROCEDURE iom_g0d_intatt 
     70      MODULE PROCEDURE iom_g0d_intatt, iom_g0d_ratt 
    6671   END INTERFACE 
    6772   INTERFACE iom_rstput 
     
    143148      CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,nfloat) /) ) 
    144149# endif 
     150#if defined key_lim3 || defined key_lim2 
     151      CALL iom_set_axis_attr( "ncatice", (/ (REAL(ji,wp), ji=1,jpl) /) ) 
     152#endif 
    145153      CALL iom_set_axis_attr( "icbcla", class_num ) 
    146154       
     
    344352            CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' ) 
    345353            istop = nstop + 1                      ! make sure that istop /= nstop so we don't open the file 
     354         ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to  
     355            clname = cltmpn       ! overwrite so get back the file name without the cpu number 
    346356         ENDIF 
    347357      ENDIF 
     
    896906   !!                   INTERFACE iom_getatt 
    897907   !!---------------------------------------------------------------------- 
    898    SUBROUTINE iom_g0d_intatt( kiomid, cdatt, pvar ) 
     908   SUBROUTINE iom_g0d_intatt( kiomid, cdatt, pvar, cdvar ) 
    899909      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
    900910      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
    901       INTEGER         , INTENT(  out)                 ::   pvar      ! read field 
     911      INTEGER         , INTENT(  out)                 ::   pvar      ! written field 
     912      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
    902913      ! 
    903914      IF( kiomid > 0 ) THEN 
     
    905916            SELECT CASE (iom_file(kiomid)%iolib) 
    906917            CASE (jpioipsl )   ;   CALL ctl_stop('iom_getatt: only nf90 available') 
    907             CASE (jpnf90   )   ;   CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 
     918            CASE (jpnf90   )   ;   CALL iom_nf90_getatt( kiomid, cdatt, pv_i0d=pvar ) 
    908919            CASE (jprstdimg)   ;   CALL ctl_stop('iom_getatt: only nf90 available') 
    909920            CASE DEFAULT     
     
    914925   END SUBROUTINE iom_g0d_intatt 
    915926 
     927   SUBROUTINE iom_g0d_ratt( kiomid, cdatt, pvar, cdvar ) 
     928      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     929      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     930      REAL(wp)        , INTENT(  out)                 ::   pvar      ! written field 
     931      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
     932      ! 
     933      IF( kiomid > 0 ) THEN 
     934         IF( iom_file(kiomid)%nfid > 0 ) THEN 
     935            SELECT CASE (iom_file(kiomid)%iolib) 
     936            CASE (jpioipsl )   ;   CALL ctl_stop('iom_getatt: only nf90 available') 
     937            CASE (jpnf90   )   ;   IF( PRESENT(cdvar) ) THEN 
     938                                      CALL iom_nf90_getatt( kiomid, cdatt, pv_r0d=pvar, cdvar=cdvar ) 
     939                                   ELSE 
     940                                      CALL iom_nf90_getatt( kiomid, cdatt, pv_r0d=pvar ) 
     941                                   ENDIF 
     942            CASE (jprstdimg)   ;   CALL ctl_stop('iom_getatt: only nf90 available') 
     943            CASE DEFAULT     
     944               CALL ctl_stop( 'iom_g0d_att: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 
     945            END SELECT 
     946         ENDIF 
     947      ENDIF 
     948   END SUBROUTINE iom_g0d_ratt 
    916949 
    917950   !!---------------------------------------------------------------------- 
     
    10131046      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    10141047      REAL(wp)        , INTENT(in) ::   pfield0d 
     1048      REAL(wp)        , DIMENSION(jpi,jpj) ::   zz     ! masson 
    10151049#if defined key_iomput 
    1016       CALL xios_send_field(cdname, (/pfield0d/)) 
     1050      zz(:,:)=pfield0d 
     1051      CALL xios_send_field(cdname, zz) 
     1052      !CALL xios_send_field(cdname, (/pfield0d/))  
    10171053#else 
    10181054      IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings 
     
    12051241      !! 
    12061242      !!---------------------------------------------------------------------- 
    1207       REAL(wp), DIMENSION(1,1) ::   zz = 1. 
     1243      REAL(wp), DIMENSION(1) ::   zz = 1. 
    12081244      !!---------------------------------------------------------------------- 
    12091245      CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea, jbegin=1, ni=1, nj=1) 
    1210       CALL iom_set_domain_attr('scalarpoint', data_dim=1) 
    1211       CALL iom_set_domain_attr('scalarpoint', lonvalue=(/ zz /), latvalue=(/ zz /)) 
     1246      CALL iom_set_domain_attr('scalarpoint', data_dim=2, data_ibegin = 1, data_ni = 1, data_jbegin = 1, data_nj = 1) 
     1247      zz=REAL(narea,wp) 
     1248      CALL iom_set_domain_attr('scalarpoint', lonvalue=zz, latvalue=zz) 
    12121249 
    12131250   END SUBROUTINE set_scalar 
     
    14971534 
    14981535#endif 
     1536 
     1537   LOGICAL FUNCTION iom_use( cdname ) 
     1538      CHARACTER(LEN=*), INTENT(in) ::   cdname 
     1539#if defined key_iomput 
     1540      iom_use = xios_field_is_active( cdname ) 
     1541#else 
     1542      iom_use = .FALSE. 
     1543#endif 
     1544   END FUNCTION iom_use 
    14991545    
    15001546   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.