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 14433 for NEMO/trunk/tests/TSUNAMI/MY_SRC/usrdef_hgr.F90 – NEMO

Ignore:
Timestamp:
2021-02-11T09:06:49+01:00 (3 years ago)
Author:
smasson
Message:

trunk: merge dev_r14312_MPI_Interface into the trunk, #2598

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/tests/TSUNAMI/MY_SRC/usrdef_hgr.F90

    r14225 r14433  
    6464      ! 
    6565      INTEGER  ::   ji, jj     ! dummy loop indices 
    66       REAL(wp) ::   zphi0, zlam0, zbeta, zf0 
     66      INTEGER  ::   ii0, ij0   ! dummy loop indices 
     67      REAL(wp) ::   zbeta, zf0 
    6768      REAL(wp) ::   zti, ztj   ! local scalars 
    6869      !!------------------------------------------------------------------------------- 
     
    7778      ! Position coordinates (in kilometers) 
    7879      !                          ========== 
    79       zlam0 = -REAL(Ni0glo, wp) * rn_0xratio * rn_dx 
    80       zphi0 = -REAL(Nj0glo, wp) * rn_0yratio * rn_dy 
     80      ii0 = NINT( REAL(Ni0glo, wp) * rn_0xratio ) 
     81      ij0 = NINT( REAL(Nj0glo, wp) * rn_0yratio ) 
    8182 
    8283#if defined key_agrif 
    8384      ! ! let lower left longitude and latitude from parent 
    8485      IF (.NOT.Agrif_root()) THEN 
    85           zlam0 = (0.5_wp-(Agrif_parent(jpiglo)-1)/2)*Agrif_irhox()*rn_dx & 
    86              &+(Agrif_Ix()+nbghostcells-1)*Agrif_irhox()*rn_dx-(0.5_wp+nbghostcells)*rn_dx 
    87           zphi0 = (0.5_wp-(Agrif_parent(jpjglo)-1)/2)*Agrif_irhoy()*rn_dy & 
    88              &+(Agrif_Iy()+nbghostcells-1)*Agrif_irhoy()*rn_dy-(0.5_wp+nbghostcells)*rn_dy 
     86          to be coded... 
    8987      ENDIF  
    9088#endif 
    9189          
    9290      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )          
    93          zti = REAL( mig0(ji), wp ) - 0.5_wp  ! start at i=0.5 in the global grid without halos 
    94          ztj = REAL( mjg0(jj), wp ) - 0.5_wp  ! start at j=0.5 in the global grid without halos 
     91         zti = REAL( mig0(ji)-ii0, wp )   ! =0 at i=ii0 in the global grid without halos 
     92         ztj = REAL( mjg0(jj)-ij0, wp )   ! =0 at i=ij0 in the global grid without halos 
    9593          
    96          plamt(ji,jj) = zlam0 + rn_dx *   zti 
    97          plamu(ji,jj) = zlam0 + rn_dx * ( zti + 0.5_wp )  
     94         plamt(ji,jj) = rn_dx *   zti 
     95         plamu(ji,jj) = rn_dx * ( zti + 0.5_wp )  
    9896         plamv(ji,jj) = plamt(ji,jj)  
    9997         plamf(ji,jj) = plamu(ji,jj)  
    10098          
    101          pphit(ji,jj) = zphi0 + rn_dy *   ztj 
    102          pphiv(ji,jj) = zphi0 + rn_dy * ( ztj + 0.5_wp )  
     99         pphit(ji,jj) = rn_dy *   ztj 
     100         pphiv(ji,jj) = rn_dy * ( ztj + 0.5_wp )  
    103101         pphiu(ji,jj) = pphit(ji,jj)  
    104102         pphif(ji,jj) = pphiv(ji,jj)  
Note: See TracChangeset for help on using the changeset viewer.