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

Ignore:
Timestamp:
2008-09-24T15:05:20+02:00 (16 years ago)
Author:
rblod
Message:

Adapt Agrif to the new SBC and correct several bugs for agrif (restart writing and reading), see ticket #133
Note : this fix does not work yet on NEC computerq (sxf90/360)

File:
1 edited

Legend:

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

    r1191 r1200  
    6969      LOGICAL               ::   llok      ! check the existence  
    7070      LOGICAL               ::   llwrt     ! local definition of ldwrt 
     71      LOGICAL               ::   llnoov    ! local definition to read overlap 
    7172      LOGICAL               ::   llstop    ! local definition of ldstop 
    7273      INTEGER               ::   iolib     ! library do we use to open the file 
     
    104105      ELSE                         ;   iolib = jpnf90 
    105106      ENDIF 
     107      ! do we read the overlap  
     108      ! ugly patch SM+JMM+RB to overwrite global definition in some cases 
     109      llnoov = (jpni * jpnj ) == jpni .AND. .NOT. lk_agrif  
    106110      ! create the file name by added, if needed, TRIM(Agrif_CFixed()) and TRIM(clsuffix) 
    107111      ! ============= 
    108112      clname   = trim(cdname) 
    109113#if defined key_agrif 
    110       if ( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
     114      IF ( .NOT. Agrif_Root() ) THEN 
     115         iln    = INDEX(clname,'/')  
     116         cltmpn = clname(1:iln) 
     117         clname = clname(iln+1:LEN_TRIM(clname)) 
     118         clname=TRIM(cltmpn)//TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
     119      ENDIF 
    111120#endif     
    112121      ! which suffix should we use? 
     
    149158! JMM + SM: ugly patch before getting the new version of lib_mpp) 
    150159!         idom = jpdom_local_noovlap   ! default definition 
    151          IF( jpni*jpnj == jpnij ) THEN   ;   idom = jpdom_local_noovlap   ! default definition 
    152          ELSE                            ;   idom = jpdom_local_full      ! default definition 
     160         IF( llnoov ) THEN   ;   idom = jpdom_local_noovlap   ! default definition 
     161         ELSE                ;   idom = jpdom_local_full      ! default definition 
    153162         ENDIF 
    154163         IF( PRESENT(kdom) )   idom = kdom 
     
    411420      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount     ! number of points to be read in each axis 
    412421      ! 
     422      LOGICAL                        ::   llnoov      ! local definition to read overlap 
    413423      INTEGER                        ::   jl          ! loop on number of dimension  
    414424      INTEGER                        ::   idom        ! type of domain 
     
    437447      ! local definition of the domain ? 
    438448      idom = kdom 
     449      ! do we read the overlap  
     450      ! ugly patch SM+JMM+RB to overwrite global definition in some cases 
     451      llnoov = (jpni * jpnj ) == jpni .AND. .NOT. lk_agrif  
    439452      ! check kcount and kstart optionals parameters... 
    440453      IF( PRESENT(kcount) .AND. (.NOT. PRESENT(kstart)) ) CALL ctl_stop(trim(clinfo), 'kcount present needs kstart present') 
     
    520533! JMM + SM: ugly patch before getting the new version of lib_mpp) 
    521534!                  IF( idom /= jpdom_local_noovlap )   istart(1:2) = istart(1:2) + (/ nldi - 1, nldj - 1 /) 
    522                   IF( jpni*jpnj == jpnij .AND. idom /= jpdom_local_noovlap ) istart(1:2) = istart(1:2) + (/ nldi - 1, nldj - 1 /) 
     535                  IF( llnoov .AND. idom /= jpdom_local_noovlap ) istart(1:2) = istart(1:2) + (/ nldi - 1, nldj - 1 /) 
    523536                  ! we do not read the overlap and the extra-halos -> from nldi to nlei and from nldj to nlej  
    524537! JMM + SM: ugly patch before getting the new version of lib_mpp) 
    525538!                  icnt(1:2) = (/ nlei - nldi + 1, nlej - nldj + 1 /) 
    526                   IF( jpni*jpnj == jpnij ) THEN   ;   icnt(1:2) = (/ nlei - nldi + 1, nlej - nldj + 1 /) 
    527                   ELSE                            ;   icnt(1:2) = (/ nlci           , nlcj            /) 
     539                  IF( llnoov ) THEN   ;   icnt(1:2) = (/ nlei - nldi + 1, nlej - nldj + 1 /) 
     540                  ELSE                ;   icnt(1:2) = (/ nlci           , nlcj            /) 
    528541                  ENDIF 
    529542                  IF( PRESENT(pv_r3d) ) THEN 
     
    558571! JMM + SM: ugly patch before getting the new version of lib_mpp) 
    559572!               ishape(1:2) = SHAPE(pv_r2d(nldi:nlei,nldj:nlej  ))   ;   ctmp1 = 'd(nldi:nlei,nldj:nlej)' 
    560                IF( jpni*jpnj == jpnij ) THEN ; ishape(1:2)=SHAPE(pv_r2d(nldi:nlei,nldj:nlej  )) ; ctmp1='d(nldi:nlei,nldj:nlej)' 
    561                ELSE                          ; ishape(1:2)=SHAPE(pv_r2d(1   :nlci,1   :nlcj  )) ; ctmp1='d(1:nlci,1:nlcj)' 
     573               IF( llnoov ) THEN ; ishape(1:2)=SHAPE(pv_r2d(nldi:nlei,nldj:nlej  )) ; ctmp1='d(nldi:nlei,nldj:nlej)' 
     574               ELSE              ; ishape(1:2)=SHAPE(pv_r2d(1   :nlci,1   :nlcj  )) ; ctmp1='d(1:nlci,1:nlcj)' 
    562575               ENDIF 
    563576            ENDIF 
     
    565578! JMM + SM: ugly patch before getting the new version of lib_mpp) 
    566579!               ishape(1:3) = SHAPE(pv_r3d(nldi:nlei,nldj:nlej,:))   ;   ctmp1 = 'd(nldi:nlei,nldj:nlej,:)' 
    567                IF( jpni*jpnj == jpnij ) THEN ; ishape(1:3)=SHAPE(pv_r3d(nldi:nlei,nldj:nlej,:)) ; ctmp1='d(nldi:nlei,nldj:nlej,:)' 
    568                ELSE                          ; ishape(1:3)=SHAPE(pv_r3d(1   :nlci,1   :nlcj,:)) ; ctmp1='d(1:nlci,1:nlcj,:)' 
     580               IF( llnoov ) THEN ; ishape(1:3)=SHAPE(pv_r3d(nldi:nlei,nldj:nlej,:)) ; ctmp1='d(nldi:nlei,nldj:nlej,:)' 
     581               ELSE              ; ishape(1:3)=SHAPE(pv_r3d(1   :nlci,1   :nlcj,:)) ; ctmp1='d(1:nlci,1:nlcj,:)' 
    569582               ENDIF 
    570583            ENDIF 
     
    587600!         ELSE                               ;   ix1 = 1      ;   ix2 = icnt(1)   ;   iy1 = 1      ;   iy2 = icnt(2) 
    588601!         ENDIF 
    589          IF( jpni*jpnj == jpnij ) THEN 
     602         IF( llnoov ) THEN 
    590603            IF( idom /= jpdom_unknown ) THEN   ;   ix1 = nldi   ;   ix2 = nlei      ;   iy1 = nldj   ;   iy2 = nlej 
    591604            ELSE                               ;   ix1 = 1      ;   ix2 = icnt(1)   ;   iy1 = 1      ;   iy2 = icnt(2) 
Note: See TracChangeset for help on using the changeset viewer.