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 12590 for NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/FLO/floblk.F90 – NEMO

Ignore:
Timestamp:
2020-03-23T22:16:19+01:00 (4 years ago)
Author:
techene
Message:

all: add e3 substitute, OCE/DOM/domzgr_substitute.h90: correct a bug for e3f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/FLO/floblk.F90

    r12377 r12590  
    2020   PUBLIC   flo_blk    ! routine called by floats.F90 
    2121 
     22#  include "domzgr_substitute.h90" 
     23 
    2224   !!---------------------------------------------------------------------- 
    2325   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
    24    !! $Id$  
     26   !! $Id$ 
    2527   !! Software governed by the CeCILL license (see ./LICENSE) 
    2628   !!---------------------------------------------------------------------- 
     
    3032      !!--------------------------------------------------------------------- 
    3133      !!                  ***  ROUTINE flo_blk  *** 
    32       !!            
     34      !! 
    3335      !! ** Purpose :   Compute the geographical position,latitude, longitude 
    3436      !!      and depth of each float at each time step. 
    35       !!  
     37      !! 
    3638      !! ** Method  :   The position of a float is computed with Bruno Blanke 
    3739      !!      algorithm. We need to know the velocity field, the old positions 
     
    4749         zuoutfl,zvoutfl,zwoutfl,   &     ! transport across the ouput face 
    4850         zvol,                      &     ! volume of the mesh 
    49          zsurfz,                    &     ! surface of the face of the mesh  
     51         zsurfz,                    &     ! surface of the face of the mesh 
    5052         zind 
    5153 
     
    5355 
    5456      INTEGER  , DIMENSION ( jpnfl )  ::   iil, ijl, ikl                   ! index of nearest mesh 
    55       INTEGER  , DIMENSION ( jpnfl )  ::   iiloc , ijloc               
     57      INTEGER  , DIMENSION ( jpnfl )  ::   iiloc , ijloc 
    5658      INTEGER  , DIMENSION ( jpnfl )  ::   iiinfl, ijinfl, ikinfl          ! index of input mesh of the float. 
    5759      INTEGER  , DIMENSION ( jpnfl )  ::   iioutfl, ijoutfl, ikoutfl       ! index of output mesh of the float. 
    58       REAL(wp) , DIMENSION ( jpnfl )  ::   zgifl, zgjfl, zgkfl             ! position of floats, index on  
     60      REAL(wp) , DIMENSION ( jpnfl )  ::   zgifl, zgjfl, zgkfl             ! position of floats, index on 
    5961      !                                                                         ! velocity mesh. 
    6062      REAL(wp) , DIMENSION ( jpnfl )  ::    ztxfl, ztyfl, ztzfl            ! time for a float to quit the mesh 
    61       !                                                                         ! across one of the face x,y and z  
    62       REAL(wp) , DIMENSION ( jpnfl )  ::    zttfl                          ! time for a float to quit the mesh  
    63       REAL(wp) , DIMENSION ( jpnfl )  ::    zagefl                         ! time during which, trajectorie of  
     63      !                                                                         ! across one of the face x,y and z 
     64      REAL(wp) , DIMENSION ( jpnfl )  ::    zttfl                          ! time for a float to quit the mesh 
     65      REAL(wp) , DIMENSION ( jpnfl )  ::    zagefl                         ! time during which, trajectorie of 
    6466      !                                                                         ! the float has been computed 
    65       REAL(wp) , DIMENSION ( jpnfl )  ::   zagenewfl                       ! new age of float after calculation  
     67      REAL(wp) , DIMENSION ( jpnfl )  ::   zagenewfl                       ! new age of float after calculation 
    6668      !                                                                         ! of new position 
    6769      REAL(wp) , DIMENSION ( jpnfl )  ::   zufl, zvfl, zwfl                ! interpolated vel. at float position 
     
    7779 
    7880      ! Initialisation of parameters 
    79        
     81 
    8082      DO jfl = 1, jpnfl 
    8183         ! ages of floats are put at zero 
    8284         zagefl(jfl) = 0. 
    83          ! index on the velocity grid  
    84          ! We considere k coordinate negative, with this transformation  
    85          ! the computation in the 3 direction is the same.  
     85         ! index on the velocity grid 
     86         ! We considere k coordinate negative, with this transformation 
     87         ! the computation in the 3 direction is the same. 
    8688         zgifl(jfl) = tpifl(jfl) - 0.5 
    8789         zgjfl(jfl) = tpjfl(jfl) - 0.5 
    8890         zgkfl(jfl) = MIN(-1.,-(tpkfl(jfl))) 
    89          ! surface drift every 10 days  
     91         ! surface drift every 10 days 
    9092         IF( ln_argo ) THEN 
    9193            IF( MOD(kt,150) >= 146 .OR. MOD(kt,150) == 0 )  zgkfl(jfl) = -1. 
     
    9698         ikl(jfl) =     INT(zgkfl(jfl)) 
    9799      END DO 
    98         
     100 
    99101      iloop = 0 
    100102222   DO jfl = 1, jpnfl 
     
    104106            iiloc(jfl) = iil(jfl) - mig(1) + 1 
    105107            ijloc(jfl) = ijl(jfl) - mjg(1) + 1 
    106 # else  
     108# else 
    107109            iiloc(jfl) = iil(jfl) 
    108110            ijloc(jfl) = ijl(jfl) 
    109111# endif 
    110              
    111             ! compute the transport across the mesh where the float is.             
    112 !!bug (gm) change e3t into e3. but never checked  
    113             zsurfx(1) = e2u(iiloc(jfl)-1,ijloc(jfl)  ) * e3u(iiloc(jfl)-1,ijloc(jfl)  ,-ikl(jfl),Kmm) 
    114             zsurfx(2) = e2u(iiloc(jfl)  ,ijloc(jfl)  ) * e3u(iiloc(jfl)  ,ijloc(jfl)  ,-ikl(jfl),Kmm) 
    115             zsurfy(1) = e1v(iiloc(jfl)  ,ijloc(jfl)-1) * e3v(iiloc(jfl)  ,ijloc(jfl)-1,-ikl(jfl),Kmm) 
    116             zsurfy(2) = e1v(iiloc(jfl)  ,ijloc(jfl)  ) * e3v(iiloc(jfl)  ,ijloc(jfl)  ,-ikl(jfl),Kmm) 
     112 
     113            ! compute the transport across the mesh where the float is. 
     114!!bug (gm) change e3t into e3. but never checked 
     115            zsurfx(1) = e2u(iiloc(jfl)-1,ijloc(jfl)  )    & 
     116            &         * e3u(iiloc(jfl)-1,ijloc(jfl)  ,-ikl(jfl),Kmm) 
     117            zsurfx(2) = e2u(iiloc(jfl)  ,ijloc(jfl)  )    & 
     118            &         * e3u(iiloc(jfl)  ,ijloc(jfl)  ,-ikl(jfl),Kmm) 
     119            zsurfy(1) = e1v(iiloc(jfl)  ,ijloc(jfl)-1)    & 
     120            &         * e3v(iiloc(jfl)  ,ijloc(jfl)-1,-ikl(jfl),Kmm) 
     121            zsurfy(2) = e1v(iiloc(jfl)  ,ijloc(jfl)  )    & 
     122            &         * e3v(iiloc(jfl)  ,ijloc(jfl)  ,-ikl(jfl),Kmm) 
    117123 
    118124            ! for a isobar float zsurfz is put to zero. The vertical velocity will be zero too. 
     
    129135            zwoutfl=-(wb(iiloc(jfl),ijloc(jfl),- ikl(jfl)   )   & 
    130136               &   +  ww(iiloc(jfl),ijloc(jfl),- ikl(jfl)   ) )/2. *  zsurfz*nisobfl(jfl) 
    131              
    132             ! interpolation of velocity field on the float initial position             
     137 
     138            ! interpolation of velocity field on the float initial position 
    133139            zufl(jfl)=  zuinfl  + ( zgifl(jfl) - float(iil(jfl)-1) ) * ( zuoutfl - zuinfl) 
    134140            zvfl(jfl)=  zvinfl  + ( zgjfl(jfl) - float(ijl(jfl)-1) ) * ( zvoutfl - zvinfl) 
    135141            zwfl(jfl)=  zwinfl  + ( zgkfl(jfl) - float(ikl(jfl)-1) ) * ( zwoutfl - zwinfl) 
    136              
     142 
    137143            ! faces of input and output 
    138144            ! u-direction 
     
    147153               iiinfl (jfl) = iil(jfl) - 1 
    148154            ENDIF 
    149             ! v-direction        
     155            ! v-direction 
    150156            IF( zvfl(jfl) < 0. ) THEN 
    151157               ijoutfl(jfl) = ijl(jfl) - 1. 
     
    169175               ikinfl (jfl) = ikl(jfl) - 1. 
    170176            ENDIF 
    171              
     177 
    172178            ! compute the time to go out the mesh across a face 
    173179            ! u-direction 
     
    203209               ENDIF 
    204210            ENDIF 
    205             ! w-direction         
    206             IF( nisobfl(jfl) == 1. ) THEN  
     211            ! w-direction 
     212            IF( nisobfl(jfl) == 1. ) THEN 
    207213               zwdfl (jfl) = zwoutfl - zwinfl 
    208214               zgkdfl(jfl) = float(ikoutfl(jfl) - ikinfl(jfl)) 
     
    221227               ENDIF 
    222228            ENDIF 
    223              
     229 
    224230            ! the time to go leave the mesh is the smallest time 
    225                     
    226             IF( nisobfl(jfl) == 1. ) THEN  
     231 
     232            IF( nisobfl(jfl) == 1. ) THEN 
    227233               zttfl(jfl) = MIN(ztxfl(jfl),ztyfl(jfl),ztzfl(jfl)) 
    228234            ELSE 
     
    231237            ! new age of the FLOAT 
    232238            zagenewfl(jfl) = zagefl(jfl) + zttfl(jfl)*zvol 
    233             ! test to know if the "age" of the float is not bigger than the  
     239            ! test to know if the "age" of the float is not bigger than the 
    234240            ! time step 
    235241            IF( zagenewfl(jfl) > rdt ) THEN 
     
    237243               zagenewfl(jfl) = rdt 
    238244            ENDIF 
    239              
     245 
    240246            ! In the "minimal" direction we compute the index of new mesh 
    241247            ! on i-direction 
     
    250256               iiinfl(jfl) = ind 
    251257            ELSE 
    252                IF( ABS(zudfl(jfl)) >= 1.E-5 ) THEN  
     258               IF( ABS(zudfl(jfl)) >= 1.E-5 ) THEN 
    253259                  zgifl(jfl) = zgifl(jfl) + zgidfl(jfl)*zufl(jfl)    & 
    254260                     &       * ( EXP( zudfl(jfl)/zgidfl(jfl)*zttfl(jfl) ) - 1. ) /  zudfl(jfl) 
     
    268274               ijinfl(jfl) = ind 
    269275            ELSE 
    270                IF( ABS(zvdfl(jfl)) >= 1.E-5 ) THEN  
     276               IF( ABS(zvdfl(jfl)) >= 1.E-5 ) THEN 
    271277                  zgjfl(jfl) = zgjfl(jfl)+zgjdfl(jfl)*zvfl(jfl)   & 
    272278                     &       * ( EXP(zvdfl(jfl)/zgjdfl(jfl)*zttfl(jfl)) - 1. ) /  zvdfl(jfl) 
     
    287293                  ikinfl(jfl) = ind 
    288294               ELSE 
    289                   IF( ABS(zwdfl(jfl)) >= 1.E-5 ) THEN  
     295                  IF( ABS(zwdfl(jfl)) >= 1.E-5 ) THEN 
    290296                     zgkfl(jfl) = zgkfl(jfl)+zgkdfl(jfl)*zwfl(jfl)    & 
    291297                        &       * ( EXP(zwdfl(jfl)/zgkdfl(jfl)*zttfl(jfl)) - 1. ) /  zwdfl(jfl) 
     
    295301               ENDIF 
    296302            ENDIF 
    297              
     303 
    298304            ! coordinate of the new point on the temperature grid 
    299              
     305 
    300306            iil(jfl) = MAX(iiinfl(jfl),iioutfl(jfl)) 
    301307            ijl(jfl) = MAX(ijinfl(jfl),ijoutfl(jfl)) 
     
    306312!!Alexcadm     .    ikoutfl(jfl),ztxfl(jfl),ztyfl(jfl) 
    307313!!Alexcadm     .     ,ztzfl(jfl),zgifl(jfl), 
    308 !!Alexcadm     .  zgjfl(jfl)  
     314!!Alexcadm     .  zgjfl(jfl) 
    309315!!Alexcadm  IF (jfl == 910) write(*,*)'Flotteur 910', 
    310316!!Alexcadm     .    iiinfl(jfl),iioutfl(jfl),ijinfl(jfl) 
     
    312318!!Alexcadm     .    ikoutfl(jfl),ztxfl(jfl),ztyfl(jfl) 
    313319!!Alexcadm     .     ,ztzfl(jfl),zgifl(jfl), 
    314 !!Alexcadm     .  zgjfl(jfl)  
     320!!Alexcadm     .  zgjfl(jfl) 
    315321            ! reinitialisation of the age of FLOAT 
    316322            zagefl(jfl) = zagenewfl(jfl) 
     
    327333# endif 
    328334      END DO 
    329        
     335 
    330336      ! synchronisation 
    331337      CALL mpp_sum( 'floblk', zgifl , jpnfl )   ! sums over the global domain 
     
    335341      CALL mpp_sum( 'floblk', iil   , jpnfl ) 
    336342      CALL mpp_sum( 'floblk', ijl   , jpnfl ) 
    337        
     343 
    338344      ! Test to know if a  float hasn't integrated enought time 
    339345      IF( ln_argo ) THEN 
     
    361367!!Alexcadm     .       tpkfl(jpnfl),zufl(jpnfl),zvfl(jpnfl),zwfl(jpnfl) 
    362368      IF( ifin == 0 ) THEN 
    363          iloop = iloop + 1  
     369         iloop = iloop + 1 
    364370         GO TO 222 
    365371      ENDIF 
     
    369375 
    370376   !!====================================================================== 
    371 END MODULE floblk  
     377END MODULE floblk 
Note: See TracChangeset for help on using the changeset viewer.