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 8708 for branches/2017/dev_rev8689_LIM3_RST/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90 – NEMO

Ignore:
Timestamp:
2017-11-15T12:39:36+01:00 (6 years ago)
Author:
andmirek
Message:

#1976 improvements in LIM3 restart. Working version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_rev8689_LIM3_RST/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90

    r7753 r8708  
    351351      !! 
    352352      !!---------------------------------------------------------------------- 
    353       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied 
     353      REAL(wp), DIMENSION(:,:,:)      , INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied 
    354354      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points 
    355355      !                                                             ! = T , U , V , F , W points 
     
    359359      REAL(wp)        , OPTIONAL      , INTENT(in   ) ::   pval     ! background value (used at closed boundaries) 
    360360      ! 
    361       INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices 
     361      INTEGER  ::   ji, jj, jk, jl, ilev       ! dummy loop indices 
    362362      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
    363363      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
     
    367367      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ew, zt3we   ! 3d for east-west & west-east 
    368368      !!---------------------------------------------------------------------- 
    369        
    370       ALLOCATE( zt3ns(jpi,jprecj,jpk,2), zt3sn(jpi,jprecj,jpk,2),   & 
    371          &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  ) 
     369      ilev = SIZE(ptab, 3)  
     370      ALLOCATE( zt3ns(jpi,jprecj,ilev,2), zt3sn(jpi,jprecj,ilev,2),   & 
     371         &      zt3ew(jpj,jpreci,ilev,2), zt3we(jpj,jpreci,ilev,2)  ) 
    372372 
    373373      ! 
     
    381381         ! 
    382382         ! WARNING ptab is defined only between nld and nle 
    383          DO jk = 1, jpk 
     383         DO jk = 1, ilev 
    384384            DO jj = nlcj+1, jpj                 ! added line(s)   (inner only) 
    385385               ptab(nldi  :nlei  , jj          ,jk) = ptab(nldi:nlei,     nlej,jk) 
     
    430430      ! 
    431431      !                           ! Migrations 
    432       imigr = jpreci * jpj * jpk 
     432      imigr = jpreci * jpj * ilev 
    433433      ! 
    434434      SELECT CASE ( nbondi ) 
     
    482482      ! 
    483483      !                           ! Migrations 
    484       imigr = jprecj * jpi * jpk 
     484      imigr = jprecj * jpi * ilev 
    485485      ! 
    486486      SELECT CASE ( nbondj ) 
     
    10551055      !! 
    10561056      !!---------------------------------------------------------------------- 
    1057       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab1     ! first and second 3D array on which 
    1058       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab2     ! the boundary condition is applied 
     1057      REAL(wp), DIMENSION(:,:,:)      , INTENT(inout) ::   ptab1     ! first and second 3D array on which 
     1058      REAL(wp), DIMENSION(:,:,:)      , INTENT(inout) ::   ptab2     ! the boundary condition is applied 
    10591059      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type1  ! nature of ptab1 and ptab2 arrays 
    10601060      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type2  ! i.e. grid-points = T , U , V , F or W points 
    10611061      REAL(wp)                        , INTENT(in   ) ::   psgn      ! =-1 the sign change across the north fold boundary 
    10621062      !!                                                             ! =  1. , the sign is kept 
    1063       INTEGER  ::   jl   ! dummy loop indices 
     1063      INTEGER  ::   jl, ilev                   ! dummy loop indices 
    10641064      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
    10651065      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
     
    10691069      !!---------------------------------------------------------------------- 
    10701070      ! 
    1071       ALLOCATE( zt4ns(jpi,jprecj,jpk,2,2), zt4sn(jpi,jprecj,jpk,2,2) ,    & 
    1072          &      zt4ew(jpj,jpreci,jpk,2,2), zt4we(jpj,jpreci,jpk,2,2) ) 
     1071      ilev = SIZE(ptab1, 3) 
     1072      ALLOCATE( zt4ns(jpi,jprecj,ilev,2,2), zt4sn(jpi,jprecj,ilev,2,2) ,    & 
     1073         &      zt4ew(jpj,jpreci,ilev,2,2), zt4we(jpj,jpreci,ilev,2,2) ) 
    10731074      ! 
    10741075      ! 1. standard boundary treatment 
     
    11171118      ! 
    11181119      !                           ! Migrations 
    1119       imigr = jpreci * jpj * jpk *2 
     1120      imigr = jpreci * jpj * ilev *2 
    11201121      ! 
    11211122      SELECT CASE ( nbondi ) 
     
    11761177      ! 
    11771178      !                           ! Migrations 
    1178       imigr = jprecj * jpi * jpk * 2 
     1179      imigr = jprecj * jpi * ilev * 2 
    11791180      ! 
    11801181      SELECT CASE ( nbondj ) 
     
    14511452      !! 
    14521453      !!---------------------------------------------------------------------- 
    1453       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied 
     1454      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptab     ! 3D array on which the boundary condition is applied 
    14541455      CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points 
    14551456      !                                                             ! = T , U , V , F , W points 
     
    14591460      REAL(wp)        , OPTIONAL      , INTENT(in   ) ::   pval     ! background value (used at closed boundaries) 
    14601461      !! 
    1461       INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices 
     1462      INTEGER  ::   ji, jj, jk, jl,ilev        ! dummy loop indices 
    14621463      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
    14631464      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
     
    14691470 
    14701471      !!---------------------------------------------------------------------- 
    1471        
    1472       ALLOCATE( zt3ns(jpi,jprecj,jpk,2), zt3sn(jpi,jprecj,jpk,2),   & 
    1473          &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  ) 
     1472      ilev = SIZE(ptab, 3)  
     1473      ALLOCATE( zt3ns(jpi,jprecj,ilev,2), zt3sn(jpi,jprecj,ilev,2),   & 
     1474         &      zt3ew(jpj,jpreci,ilev,2), zt3we(jpj,jpreci,ilev,2)  ) 
    14741475 
    14751476      ! 
     
    14941495      ! 
    14951496      !                           ! Migrations 
    1496       imigr = jpreci * jpj * jpk 
     1497      imigr = jpreci * jpj * ilev 
    14971498      ! 
    14981499      SELECT CASE ( nbondi ) 
     
    15471548      ! 
    15481549      !                           ! Migrations 
    1549       imigr = jprecj * jpi * jpk 
     1550      imigr = jprecj * jpi * ilev 
    15501551      ! 
    15511552      SELECT CASE ( nbondj ) 
Note: See TracChangeset for help on using the changeset viewer.