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 10370 for NEMO/trunk – NEMO

Changeset 10370 for NEMO/trunk


Ignore:
Timestamp:
2018-12-04T11:37:31+01:00 (5 years ago)
Author:
smasson
Message:

trunk: get 03 optimisation working with AGRIF in angle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/SBC/geo2ocean.F90

    r10068 r10370  
    1010   !!            3.7  !  11-2015  (G. Madec)  remove the unused repere and repcmo routines 
    1111   !!---------------------------------------------------------------------- 
    12 #if defined key_agrif 
    13 !clem: these lines do not seem necessary anymore 
    14 !!DIR$ OPTIMIZE (-O 1)  ! cray formulation 
    15 # if defined __INTEL_COMPILER 
    16 !acc: still breaks on at least one Ivybridge cluster with ifort 17.0.4 without this directive 
    17 !DIR$ OPTIMIZE:1        ! intel formulation 
    18 # endif 
    19 #endif 
    2012   !!---------------------------------------------------------------------- 
    2113   !!   rot_rep       : Rotate the Repere: geographic grid <==> stretched coordinates grid 
     
    8173         IF(lwp) WRITE(numout,*) ' ~~~~~~~~    ' 
    8274         ! 
    83          CALL angle       ! initialization of the transformation 
     75         CALL angle( glamt, gphit, glamu, gphiu, glamv, gphiv, glamf, gphif )       ! initialization of the transformation 
    8476         lmust_init = .FALSE. 
    8577      ENDIF 
     
    126118 
    127119 
    128    SUBROUTINE angle 
     120   SUBROUTINE angle( plamt, pphit, plamu, pphiu, plamv, pphiv, plamf, pphif ) 
    129121      !!---------------------------------------------------------------------- 
    130122      !!                  ***  ROUTINE angle  *** 
     
    138130      !! ** Action  : - gsint, gcost, gsinu, gcosu, gsinv, gcosv, gsinf, gcosf 
    139131      !!---------------------------------------------------------------------- 
     132      ! WARNING: for an unexplained reason, we need to pass all glam, gphi arrays as input parameters in 
     133      !          order to get AGRIF working with -03 compilation option 
     134      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: plamt, pphit, plamu, pphiu, plamv, pphiv, plamf, pphif   
     135      ! 
    140136      INTEGER  ::   ji, jj   ! dummy loop indices 
    141137      INTEGER  ::   ierr     ! local integer 
     
    167163         DO ji = fs_2, jpi   ! vector opt. 
    168164            !                   
    169             zlam = glamt(ji,jj)     ! north pole direction & modulous (at t-point) 
    170             zphi = gphit(ji,jj) 
     165            zlam = plamt(ji,jj)     ! north pole direction & modulous (at t-point) 
     166            zphi = pphit(ji,jj) 
    171167            zxnpt = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    172168            zynpt = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    173169            znnpt = zxnpt*zxnpt + zynpt*zynpt 
    174170            ! 
    175             zlam = glamu(ji,jj)     ! north pole direction & modulous (at u-point) 
    176             zphi = gphiu(ji,jj) 
     171            zlam = plamu(ji,jj)     ! north pole direction & modulous (at u-point) 
     172            zphi = pphiu(ji,jj) 
    177173            zxnpu = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    178174            zynpu = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    179175            znnpu = zxnpu*zxnpu + zynpu*zynpu 
    180176            ! 
    181             zlam = glamv(ji,jj)     ! north pole direction & modulous (at v-point) 
    182             zphi = gphiv(ji,jj) 
     177            zlam = plamv(ji,jj)     ! north pole direction & modulous (at v-point) 
     178            zphi = pphiv(ji,jj) 
    183179            zxnpv = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    184180            zynpv = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    185181            znnpv = zxnpv*zxnpv + zynpv*zynpv 
    186182            ! 
    187             zlam = glamf(ji,jj)     ! north pole direction & modulous (at f-point) 
    188             zphi = gphif(ji,jj) 
     183            zlam = plamf(ji,jj)     ! north pole direction & modulous (at f-point) 
     184            zphi = pphif(ji,jj) 
    189185            zxnpf = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    190186            zynpf = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. ) 
    191187            znnpf = zxnpf*zxnpf + zynpf*zynpf 
    192188            ! 
    193             zlam = glamv(ji,jj  )   ! j-direction: v-point segment direction (around t-point) 
    194             zphi = gphiv(ji,jj  ) 
    195             zlan = glamv(ji,jj-1) 
    196             zphh = gphiv(ji,jj-1) 
     189            zlam = plamv(ji,jj  )   ! j-direction: v-point segment direction (around t-point) 
     190            zphi = pphiv(ji,jj  ) 
     191            zlan = plamv(ji,jj-1) 
     192            zphh = pphiv(ji,jj-1) 
    197193            zxvvt =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   & 
    198194               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. ) 
     
    202198            znvvt = MAX( znvvt, 1.e-14 ) 
    203199            ! 
    204             zlam = glamf(ji,jj  )   ! j-direction: f-point segment direction (around u-point) 
    205             zphi = gphif(ji,jj  ) 
    206             zlan = glamf(ji,jj-1) 
    207             zphh = gphif(ji,jj-1) 
     200            zlam = plamf(ji,jj  )   ! j-direction: f-point segment direction (around u-point) 
     201            zphi = pphif(ji,jj  ) 
     202            zlan = plamf(ji,jj-1) 
     203            zphh = pphif(ji,jj-1) 
    208204            zxffu =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   & 
    209205               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. ) 
     
    213209            znffu = MAX( znffu, 1.e-14 ) 
    214210            ! 
    215             zlam = glamf(ji  ,jj)   ! i-direction: f-point segment direction (around v-point) 
    216             zphi = gphif(ji  ,jj) 
    217             zlan = glamf(ji-1,jj) 
    218             zphh = gphif(ji-1,jj) 
     211            zlam = plamf(ji  ,jj)   ! i-direction: f-point segment direction (around v-point) 
     212            zphi = pphif(ji  ,jj) 
     213            zlan = plamf(ji-1,jj) 
     214            zphh = pphif(ji-1,jj) 
    219215            zxffv =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   & 
    220216               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. ) 
     
    224220            znffv = MAX( znffv, 1.e-14 ) 
    225221            ! 
    226             zlam = glamu(ji,jj+1)   ! j-direction: u-point segment direction (around f-point) 
    227             zphi = gphiu(ji,jj+1) 
    228             zlan = glamu(ji,jj  ) 
    229             zphh = gphiu(ji,jj  ) 
     222            zlam = plamu(ji,jj+1)   ! j-direction: u-point segment direction (around f-point) 
     223            zphi = pphiu(ji,jj+1) 
     224            zlan = plamu(ji,jj  ) 
     225            zphh = pphiu(ji,jj  ) 
    230226            zxuuf =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   & 
    231227               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. ) 
     
    257253      DO jj = 2, jpjm1 
    258254         DO ji = fs_2, jpi   ! vector opt. 
    259             IF( MOD( ABS( glamv(ji,jj) - glamv(ji,jj-1) ), 360. ) < 1.e-8 ) THEN 
     255            IF( MOD( ABS( plamv(ji,jj) - plamv(ji,jj-1) ), 360. ) < 1.e-8 ) THEN 
    260256               gsint(ji,jj) = 0. 
    261257               gcost(ji,jj) = 1. 
    262258            ENDIF 
    263             IF( MOD( ABS( glamf(ji,jj) - glamf(ji,jj-1) ), 360. ) < 1.e-8 ) THEN 
     259            IF( MOD( ABS( plamf(ji,jj) - plamf(ji,jj-1) ), 360. ) < 1.e-8 ) THEN 
    264260               gsinu(ji,jj) = 0. 
    265261               gcosu(ji,jj) = 1. 
    266262            ENDIF 
    267             IF(      ABS( gphif(ji,jj) - gphif(ji-1,jj) )         < 1.e-8 ) THEN 
     263            IF(      ABS( pphif(ji,jj) - pphif(ji-1,jj) )         < 1.e-8 ) THEN 
    268264               gsinv(ji,jj) = 0. 
    269265               gcosv(ji,jj) = 1. 
    270266            ENDIF 
    271             IF( MOD( ABS( glamu(ji,jj) - glamu(ji,jj+1) ), 360. ) < 1.e-8 ) THEN 
     267            IF( MOD( ABS( plamu(ji,jj) - plamu(ji,jj+1) ), 360. ) < 1.e-8 ) THEN 
    272268               gsinf(ji,jj) = 0. 
    273269               gcosf(ji,jj) = 1. 
     
    457453         IF(lwp) WRITE(numout,*) ' obs_rot : geographic <--> stretched' 
    458454         IF(lwp) WRITE(numout,*) ' ~~~~~~~   coordinate transformation' 
    459          CALL angle       ! initialization of the transformation 
     455         CALL angle( glamt, gphit, glamu, gphiu, glamv, gphiv, glamf, gphif )       ! initialization of the transformation 
    460456         lmust_init = .FALSE. 
    461457      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.