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 14976 for NEMO/trunk/tests/ICE_AGRIF/MY_SRC – NEMO

Ignore:
Timestamp:
2021-06-11T11:14:27+02:00 (3 years ago)
Author:
jchanut
Message:

#2638, merge dev_14608_AGRIF_domcfg branch into trunk

Location:
NEMO/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r14608_AGRIF_domcfg@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
  • NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90

    r14223 r14976  
    2323   IMPLICIT NONE 
    2424   PRIVATE 
     25 
     26   REAL(wp) :: roffsetx, roffsety ! Offset in km to first f-point 
    2527 
    2628   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
     
    5052      !!                without Coriolis force (f=0) 
    5153      !! 
    52       !! ** Action  : - define longitude & latitude of t-, u-, v- and f-points (in degrees)  
     54      !! ** Action  : - define longitude & latitude of t-, u-, v- and f-points (in kms)  
    5355      !!              - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane) 
    5456      !!              - define i- & j-scale factors at t-, u-, v- and f-points (in meters) 
     
    6567      ! 
    6668      INTEGER  ::   ji, jj     ! dummy loop indices 
    67       REAL(wp) ::   zphi0, zlam0, zbeta, zf0 
     69      REAL(wp) ::   zbeta, zf0 
    6870      REAL(wp) ::   zti, ztj   ! local scalars 
    6971      !!------------------------------------------------------------------------------- 
     
    7476      IF(lwp) WRITE(numout,*) '          f-plane with irregular grid-spacing (+- 10%)' 
    7577      IF(lwp) WRITE(numout,*) '          the max is given by rn_dx and rn_dy'  
     78      ! 
     79      ! 
     80      ! Position coordinates (in kilometers) 
     81      !                          ========== 
     82      ! Offset is given at first f-point, i.e. at (i,j) = (nn_hls+1, nn_hls+1) 
     83      ! Here we assume the grid is centred around a T-point at the middle of 
     84      ! of the domain (hence domain size is odd) 
     85      roffsetx = (-REAL(Ni0glo-1, wp) + 1._wp) * 0.5 * 1.e-3 * rn_dx 
     86      roffsety = (-REAL(Nj0glo-1, wp) + 1._wp) * 0.5 * 1.e-3 * rn_dy 
     87#if defined key_agrif 
     88      IF( .NOT.Agrif_Root() ) THEN 
     89         ! deduce offset from parent: 
     90         roffsetx = Agrif_Parent(roffsetx) & 
     91            & + (-(nbghostcells_x   - 1) + (Agrif_Parent(nbghostcells_x  ) & 
     92            & + Agrif_Ix()-2)*Agrif_Rhox()) * 1.e-3 * rn_dx 
     93         roffsety = Agrif_Parent(roffsety) & 
     94            & + (-(nbghostcells_y_s - 1) + (Agrif_Parent(nbghostcells_y_s) & 
     95            & + Agrif_Iy()-2)*Agrif_Rhoy()) * 1.e-3 * rn_dy 
     96      ENDIF 
     97#endif 
     98      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
     99         zti = REAL( mig0(ji)-1, wp )  ! start at i=0 in the global grid without halos 
     100         ztj = REAL( mjg0(jj)-1, wp )  ! start at j=0 in the global grid without halos 
    76101 
    77       !                          ========== 
    78 #if defined key_agrif  
    79       IF( Agrif_Root() ) THEN 
    80 #endif 
    81          zlam0 = -REAL(Ni0glo, wp) * 0.5 * 1.e-3 * rn_dx 
    82          zphi0 = -REAL(Nj0glo, wp) * 0.5 * 1.e-3 * rn_dy 
    83 #if defined key_agrif  
    84       ELSE 
    85          ! ! let lower left longitude and latitude from parent 
    86 !clem         zlam0  = Agrif_Parent(zlam0) + (Agrif_ix())*Agrif_Parent(rn_dx) * 1.e-5 
    87 !clem         zphi0  = Agrif_Parent(zphi0) + (Agrif_iy())*Agrif_Parent(rn_dy) * 1.e-5 
    88          zlam0 = ( 0.5_wp - REAL(Ni0glo, wp) * 0.5 ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
    89             &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3 
    90          zphi0 = ( 0.5_wp - REAL(Nj0glo, wp) * 0.5 ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
    91             &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3 
    92       ENDIF 
    93 #endif          
     102         plamt(ji,jj) = roffsetx + rn_dx * 1.e-3 * ( zti - 0.5_wp ) 
     103         plamu(ji,jj) = roffsetx + rn_dx * 1.e-3 *   zti 
     104         plamv(ji,jj) = plamt(ji,jj) 
     105         plamf(ji,jj) = plamu(ji,jj) 
    94106 
    95       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    96          zti = REAL( mig0(ji), wp ) - 0.5_wp  ! start at i=0.5 in the global grid without halos 
    97          ztj = REAL( mjg0(jj), wp ) - 0.5_wp  ! start at j=0.5 in the global grid without halos 
    98            
    99          plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti 
    100          plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * ( zti + 0.5_wp ) 
    101          plamv(ji,jj) = plamt(ji,jj)  
    102          plamf(ji,jj) = plamu(ji,jj)  
    103           
    104          pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 *   ztj 
    105          pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * ( ztj + 0.5_wp ) 
    106          pphiu(ji,jj) = pphit(ji,jj)  
    107          pphif(ji,jj) = pphiv(ji,jj)  
     107         pphit(ji,jj) = roffsety + rn_dy * 1.e-3 * ( ztj - 0.5_wp ) 
     108         pphiv(ji,jj) = roffsety + rn_dy * 1.e-3 *   ztj 
     109         pphiu(ji,jj) = pphit(ji,jj) 
     110         pphif(ji,jj) = pphiv(ji,jj) 
    108111      END_2D 
    109           
    110          ! Horizontal scale factors (in meters) 
    111          !                              ====== 
     112      ! 
     113      ! Horizontal scale factors (in meters) 
     114      !                              ====== 
    112115!! ==> EITHER 1) variable scale factors 
    113116!! clem: This can be used with a 1proc simulation but I think it breaks repro when >1procs are used       
  • NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90

    r14433 r14976  
    8888         kpj = NINT( 300.e3 / rn_dy ) - 3 
    8989      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side 
    90          kpi  = nbcellsx + 2 * ( nbghostcells + 1 ) 
    91          kpj  = nbcellsy + 2 * ( nbghostcells + 1 ) 
     90         kpi  = nbcellsx + 2 * nbghostcells 
     91         kpj  = nbcellsy + 2 * nbghostcells 
     92!! JC: number of ghosts unknown at this tage 
    9293!!$         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2 
    9394!!$         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2 
Note: See TracChangeset for help on using the changeset viewer.