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 – 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

Location:
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/IOM
Files:
4 edited

Legend:

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

    r4147 r4792  
    138138   CHARACTER(lc) ::   cform_err = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !: 
    139139   CHARACTER(lc) ::   cform_war = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !: 
    140    LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only 
     140   LOGICAL       ::   lwm      = .FALSE.    !: boolean : true on the 1st processor only (always) 
     141   LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only .OR. ln_ctl 
    141142   LOGICAL       ::   lsp_area = .TRUE.     !: to make a control print over a specific area 
    142143 
  • 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   !!====================================================================== 
  • branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90

    r4292 r4792  
    3535   END INTERFACE 
    3636   INTERFACE iom_nf90_getatt 
    37       MODULE PROCEDURE iom_nf90_intatt 
     37      MODULE PROCEDURE iom_nf90_att 
    3838   END INTERFACE 
    3939   INTERFACE iom_nf90_rstput 
     
    217217         CALL iom_nf90_check(NF90_Inquire_Variable(if90id, ivarid, dimids = idimid(1:i_nvd)), clinfo)   ! dimensions ids 
    218218         iom_file(kiomid)%luld(kiv) = .FALSE.   ! default value 
    219          iom_file(kiomid)%dimsz(:,kiv) = 0   ! reset dimsz in case previously used 
     219         iom_file(kiomid)%dimsz(:,kiv) = 0      ! reset dimsz in case previously used 
    220220         DO ji = 1, i_nvd                       ! dimensions size 
    221221            CALL iom_nf90_check(NF90_Inquire_Dimension(if90id, idimid(ji), len = iom_file(kiomid)%dimsz(ji,kiv)), clinfo)    
     
    312312 
    313313 
    314    SUBROUTINE iom_nf90_intatt( kiomid, cdatt, pvar ) 
    315       !!----------------------------------------------------------------------- 
    316       !!                  ***  ROUTINE  iom_nf90_intatt  *** 
     314   SUBROUTINE iom_nf90_att( kiomid, cdatt, pv_i0d, pv_r0d, cdvar) 
     315      !!----------------------------------------------------------------------- 
     316      !!                  ***  ROUTINE  iom_nf90_att  *** 
    317317      !! 
    318318      !! ** Purpose : read an integer attribute with NF90 
     
    320320      INTEGER         , INTENT(in   ) ::   kiomid   ! Identifier of the file 
    321321      CHARACTER(len=*), INTENT(in   ) ::   cdatt    ! attribute name 
    322       INTEGER         , INTENT(  out) ::   pvar     ! read field 
     322      INTEGER         , INTENT(  out), OPTIONAL       ::   pv_i0d    ! read field 
     323      REAL(wp),         INTENT(  out), OPTIONAL       ::   pv_r0d    ! read field  
     324      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! name of the variable 
    323325      ! 
    324326      INTEGER                         ::   if90id   ! temporary integer 
     327      INTEGER                         ::   ivarid           ! NetCDF  variable Id 
    325328      LOGICAL                         ::   llok     ! temporary logical 
    326329      CHARACTER(LEN=100)              ::   clinfo   ! info character 
     
    328331      !  
    329332      if90id = iom_file(kiomid)%nfid 
    330       llok = NF90_Inquire_attribute(if90id, NF90_GLOBAL, cdatt) == nf90_noerr 
     333      IF( PRESENT(cdvar) ) THEN 
     334         llok = NF90_INQ_VARID( if90id, TRIM(cdvar), ivarid ) == nf90_noerr   ! does the variable exist in the file 
     335         IF( llok ) THEN 
     336            llok = NF90_Inquire_attribute(if90id, ivarid, cdatt) == nf90_noerr 
     337         ELSE 
     338            CALL ctl_warn('iom_nf90_getatt: no variable '//cdvar//' found') 
     339         ENDIF 
     340      ELSE 
     341         llok = NF90_Inquire_attribute(if90id, NF90_GLOBAL, cdatt) == nf90_noerr 
     342      ENDIF  
     343! 
    331344      IF( llok) THEN 
    332345         clinfo = 'iom_nf90_getatt, file: '//TRIM(iom_file(kiomid)%name)//', att: '//TRIM(cdatt) 
    333          CALL iom_nf90_check(NF90_GET_ATT(if90id, NF90_GLOBAL, cdatt, values=pvar), clinfo) 
     346         IF(     PRESENT(pv_r0d) ) THEN 
     347            IF( PRESENT(cdvar) ) THEN 
     348               CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values=pv_r0d), clinfo) 
     349            ELSE 
     350               CALL iom_nf90_check(NF90_GET_ATT(if90id, NF90_GLOBAL, cdatt, values=pv_r0d), clinfo) 
     351            ENDIF 
     352         ELSE 
     353            IF( PRESENT(cdvar) ) THEN 
     354               CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values=pv_i0d), clinfo) 
     355            ELSE 
     356               CALL iom_nf90_check(NF90_GET_ATT(if90id, NF90_GLOBAL, cdatt, values=pv_i0d), clinfo) 
     357            ENDIF 
     358         ENDIF 
    334359      ELSE 
    335360         CALL ctl_warn('iom_nf90_getatt: no attribute '//cdatt//' found') 
    336          pvar = -999 
     361         IF(     PRESENT(pv_r0d) ) THEN 
     362            pv_r0d = -999._wp 
     363         ELSE 
     364            pv_i0d = -999 
     365         ENDIF 
    337366      ENDIF 
    338367      !  
    339    END SUBROUTINE iom_nf90_intatt 
     368   END SUBROUTINE iom_nf90_att 
    340369 
    341370 
  • branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r4334 r4792  
    120120                     CALL iom_rstput( kt, nitrst, numrow, 'hdivb'  , hdivb     ) 
    121121                     CALL iom_rstput( kt, nitrst, numrow, 'sshb'   , sshb      ) 
     122      IF( lk_lim3 )  CALL iom_rstput( kt, nitrst, numrow, 'fse3t_b', fse3t_b(:,:,:) ) 
    122123                     ! 
    123124                     CALL iom_rstput( kt, nitrst, numrow, 'un'     , un        )     ! now fields 
     
    210211         CALL iom_get( numror, jpdom_autoglo, 'hdivb'  , hdivb   ) 
    211212         CALL iom_get( numror, jpdom_autoglo, 'sshb'   , sshb    ) 
     213         IF( lk_lim3 )   CALL iom_get( numror, jpdom_autoglo, 'fse3t_b', fse3t_b(:,:,:) ) 
    212214      ELSE 
    213215         neuler = 0 
     
    245247         hdivb(:,:,:)   = hdivn(:,:,:) 
    246248         sshb (:,:)     = sshn (:,:) 
    247       ENDIF 
    248       ! 
    249       IF( lk_lim3 ) THEN  
     249         IF( lk_lim3 ) THEN 
     250            DO jk = 1, jpk 
     251               fse3t_b(:,:,jk) = fse3t_n(:,:,jk) 
     252            END DO 
     253         ENDIF 
     254      ENDIF 
     255      ! 
     256      IF( lk_lim3 ) THEN 
    250257         CALL iom_get( numror, jpdom_autoglo, 'iatte' , iatte ) ! clem modif 
    251258         CALL iom_get( numror, jpdom_autoglo, 'oatte' , oatte ) ! clem modif 
Note: See TracChangeset for help on using the changeset viewer.