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

Changeset 1200 for trunk/NEMO/OPA_SRC


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)

Location:
trunk/NEMO/OPA_SRC
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DOM/dom_oce.F90

    r1161 r1200  
    188188 
    189189   !!---------------------------------------------------------------------- 
     190   !! agrif domain 
     191   !!---------------------------------------------------------------------- 
     192#if defined key_agrif 
     193   LOGICAL, PUBLIC, PARAMETER ::   lk_agrif = .TRUE.    !: agrif flag 
     194#else 
     195   LOGICAL, PUBLIC, PARAMETER ::   lk_agrif = .FALSE.   !: agrif flag 
     196#endif 
     197 
     198 
     199   !!---------------------------------------------------------------------- 
    190200   !! time domain 
    191201   !!---------------------------------------------------------------------- 
  • trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90

    r1158 r1200  
    141141 
    142142         ! read filtered free surface arrays in restart file 
    143          CALL flt_rst( nit000, 'READ' )       ! read or initialize the following fields: 
    144          !                                    ! gcx, gcxb, sshb, sshn 
     143         ! when using agrif, sshn, gcx have to be read in istate 
     144         IF (.NOT. lk_agrif) CALL flt_rst( nit000, 'READ' )       ! read or initialize the following fields: 
     145         !                                                        ! gcx, gcxb, sshb, sshn 
    145146      ENDIF 
    146147 
  • 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) 
  • trunk/NEMO/OPA_SRC/SBC/fldread.F90

    r1192 r1200  
    4242      REAL(wp) , DIMENSION(2)         ::   rec_b        ! before record (1: index, 2: second since Jan. 1st 00h of nit000 year 
    4343      REAL(wp) , DIMENSION(2)         ::   rec_a        ! after  record (1: index, 2: second since Jan. 1st 00h of nit000 year 
    44       REAL(wp) , DIMENSION(jpi,jpj)   ::   fnow         ! input fields interpolated to now time step 
    45       REAL(wp) , DIMENSION(jpi,jpj,2) ::   fdta         ! 2 consecutive record of input fields 
     44      REAL(wp) , ALLOCATABLE, DIMENSION(:,:)   ::   fnow         ! input fields interpolated to now time step 
     45      REAL(wp) , ALLOCATABLE, DIMENSION(:,:,:) ::   fdta         ! 2 consecutive record of input fields 
    4646   END TYPE FLD 
    4747 
  • trunk/NEMO/OPA_SRC/SBC/sbcblk_clio.F90

    r1171 r1200  
    163163            CALL ctl_stop( 'sbc_blk_clio: unable to allocate sf structure' )   ;   RETURN 
    164164         ENDIF 
     165 
     166         DO ifpr= 1, jpfld 
     167            ALLOCATE( sf(ifpr)%fnow(jpi,jpj) ) 
     168            ALLOCATE( sf(ifpr)%fdta(jpi,jpj,2) ) 
     169         END DO 
     170 
    165171 
    166172         ! fill sf with slf_i and control print 
  • trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90

    r1156 r1200  
    108108      !! 
    109109      INTEGER  ::   ierror   ! return error code 
     110      INTEGER  ::   ifpr     ! dummy loop indice 
    110111      !! 
    111112      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files 
     
    149150            CALL ctl_stop( 'sbc_blk_core: unable to allocate sf structure' )   ;   RETURN 
    150151         ENDIF 
     152 
     153         DO ifpr= 1, jpfld 
     154            ALLOCATE( sf(ifpr)%fnow(jpi,jpj) ) 
     155            ALLOCATE( sf(ifpr)%fdta(jpi,jpj,2) ) 
     156         END DO 
    151157 
    152158         ! fill sf with slf_i and control print 
  • trunk/NEMO/OPA_SRC/SBC/sbcflx.F90

    r1169 r1200  
    133133            CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' )   ;   RETURN   
    134134         ENDIF 
     135         DO ji= 1, jpfld 
     136            ALLOCATE( sf(ji)%fnow(jpi,jpj) ) 
     137            ALLOCATE( sf(ji)%fdta(jpi,jpj,2) ) 
     138         END DO 
     139 
    135140 
    136141         ! fill sf with slf_i and control print 
  • trunk/NEMO/OPA_SRC/SBC/sbcice_if.F90

    r1152 r1200  
    8080            CALL ctl_stop( 'sbc_ice_if: unable to allocate sf_ice structure' )   ;   RETURN 
    8181         ENDIF 
     82         ALLOCATE( sf_ice(1)%fnow(jpi,jpj) ) 
     83         ALLOCATE( sf_ice(1)%fdta(jpi,jpj,2) ) 
     84 
    8285 
    8386         ! fill sf_ice with sn_ice and control print 
  • trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r1164 r1200  
    152152            CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN 
    153153         ENDIF 
     154         ALLOCATE( sf_rnf(1)%fnow(jpi,jpj) ) 
     155         ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,2) ) 
    154156 
    155157         ! fill sf_rnf with sn_rnf and control print 
  • trunk/NEMO/OPA_SRC/SBC/sbcssr.F90

    r1156 r1200  
    111111               CALL ctl_stop( 'sbc_ssr: unable to allocate sf_sst structure' )   ;   RETURN 
    112112            ENDIF 
     113            ALLOCATE( sf_sst(1)%fnow(jpi,jpj) ) 
     114            ALLOCATE( sf_sst(1)%fdta(jpi,jpj,2) ) 
     115 
    113116            ! fill sf_sst with sn_sst and control print 
    114117            CALL fld_fill( sf_sst, (/ sn_sst /), cn_dir, 'sbc_ssr', 'SST restoring term toward SST data', 'namsbc_ssr' ) 
     
    122125               CALL ctl_stop( 'sbc_ssr: unable to allocate sf_sss structure' )   ;   RETURN 
    123126            ENDIF 
     127            ALLOCATE( sf_sss(1)%fnow(jpi,jpj) ) 
     128            ALLOCATE( sf_sss(1)%fdta(jpi,jpj,2) ) 
     129 
    124130            ! fill sf_sss with sn_sss and control print 
    125131            CALL fld_fill( sf_sss, (/ sn_sss /), cn_dir, 'sbc_ssr', 'SSS restoring term toward SSS data', 'namsbc_ssr' ) 
  • trunk/NEMO/OPA_SRC/istate.F90

    r1146 r1200  
    133133      ENDIF 
    134134 
    135       IF( lk_vvl ) THEN 
     135      IF( lk_vvl .OR. lk_agrif ) THEN 
    136136         ! read free surface arrays in restart file 
    137137         IF( ln_rstart ) THEN 
     
    143143            !                                                         ! sshb, sshn 
    144144         ENDIF 
     145      ENDIF 
     146 
     147      IF( lk_vvl ) THEN 
     148 
    145149         ! 
    146150         IF( .NOT. lk_dynspg_flt ) sshbb(:,:) = sshb(:,:) 
Note: See TracChangeset for help on using the changeset viewer.