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 12377 for NEMO/trunk/src/NST/agrif_top_update.F90 – NEMO

Ignore:
Timestamp:
2020-02-12T15:39:06+01:00 (4 years ago)
Author:
acc
Message:

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

Location:
NEMO/trunk
Files:
2 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_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
  • NEMO/trunk/src/NST/agrif_top_update.F90

    r11078 r12377  
    1 #define TWO_WAY 
    21#undef DECAL_FEEDBACK 
    32 
     
    2019   USE par_trc 
    2120   USE trc 
     21   USE vremap 
    2222 
    2323   IMPLICIT NONE 
     
    4040      IF (Agrif_Root()) RETURN  
    4141      ! 
    42 #if defined TWO_WAY    
    4342      Agrif_UseSpecialValueInUpdate = .TRUE. 
    4443      Agrif_SpecialValueFineGrid    = 0._wp 
     
    5352      ! 
    5453      Agrif_UseSpecialValueInUpdate = .FALSE. 
    55       ! 
    56 #endif 
    5754      ! 
    5855   END SUBROUTINE Agrif_Update_Trc 
     
    6865      !! 
    6966      INTEGER :: ji,jj,jk,jn 
    70       REAL(wp), DIMENSION(i1:i2,j1:j2,1:jpk,n1:n2) :: tabres_child 
     67      REAL(wp) :: ztb, ztnu, ztno 
    7168      REAL(wp) :: h_in(k1:k2) 
    7269      REAL(wp) :: h_out(1:jpk) 
    7370      INTEGER  :: N_in, N_out 
    7471      REAL(wp) :: h_diff 
    75       REAL(wp) :: zrho_xy 
    76       REAL(wp) :: tabin(k1:k2,n1:n2) 
     72      REAL(wp) :: tabin(k1:k2,1:jptra) 
     73      REAL(wp), DIMENSION(i1:i2,j1:j2,1:jpk,1:jptra) :: tabres_child 
    7774      !!--------------------------------------------- 
    7875      ! 
    7976      IF (before) THEN 
    8077         AGRIF_SpecialValue = -999._wp 
    81          zrho_xy = Agrif_rhox() * Agrif_rhoy()  
    8278         DO jn = n1,n2-1 
    8379            DO jk=k1,k2 
    8480               DO jj=j1,j2 
    8581                  DO ji=i1,i2 
    86                      tabres(ji,jj,jk,jn) = (trn(ji,jj,jk,jn) * e3t_n(ji,jj,jk) ) & 
     82                     tabres(ji,jj,jk,jn) = (tr(ji,jj,jk,jn,Kmm_a) * e3t(ji,jj,jk,Kmm_a) ) & 
    8783                                           * tmask(ji,jj,jk) + (tmask(ji,jj,jk)-1)*999._wp 
    8884                  END DO 
     
    9389            DO jj=j1,j2 
    9490               DO ji=i1,i2 
    95                   tabres(ji,jj,jk,n2) = tmask(ji,jj,jk) * e3t_n(ji,jj,jk) & 
     91                  tabres(ji,jj,jk,n2) = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm_a) & 
    9692                                           + (tmask(ji,jj,jk)-1)*999._wp 
    9793               END DO 
     
    114110                  IF (tmask(ji,jj,jk) < -900) EXIT ! TODO: Will not work with ISF 
    115111                  N_out = N_out + 1 
    116                   h_out(N_out) = e3t_n(ji,jj,jk) !Parent grid scale factors. Could multiply by e1e2t here instead of division above 
     112                  h_out(N_out) = e3t(ji,jj,jk,Kmm_a) !Parent grid scale factors. Could multiply by e1e2t here instead of division above 
    117113               ENDDO 
    118114               IF (N_in > 0) THEN !Remove this? 
     
    124120                     STOP 
    125121                  ENDIF 
    126                   DO jn=1,jptra 
    127                      CALL reconstructandremap(tabin(1:N_in,jn),h_in(1:N_in),tabres_child(ji,jj,1:N_out,jn),h_out(1:N_out),N_in,N_out) 
    128                   ENDDO 
     122                  CALL reconstructandremap(tabin(1:N_in,1:jptra),h_in(1:N_in),tabres_child(ji,jj,1:N_out,1:jptra),h_out(1:N_out),N_in,N_out,jptra) 
    129123               ENDIF 
    130124            ENDDO 
    131125         ENDDO 
    132  
     126         ! 
    133127         IF (.NOT.(lk_agrif_fstep.AND.(neuler==0))) THEN 
    134128            ! Add asselin part 
    135129            DO jn = 1,jptra 
    136                DO jk=1,jpk 
     130               DO jk=1,jpkm1 
    137131                  DO jj=j1,j2 
    138132                     DO ji=i1,i2 
    139133                        IF( tabres_child(ji,jj,jk,jn) .NE. 0. ) THEN 
    140                            trb(ji,jj,jk,jn) = trb(ji,jj,jk,jn) &  
    141                                  & + atfp * ( tabres_child(ji,jj,jk,jn) & 
    142                                  &          - trn(ji,jj,jk,jn) ) * tmask(ji,jj,jk) 
     134                           ztb  = tr(ji,jj,jk,jn,Kbb_a) * e3t(ji,jj,jk,Kbb_a) ! fse3t_b prior update should be used 
     135                           ztnu = tabres_child(ji,jj,jk,jn) * e3t(ji,jj,jk,Kmm_a) 
     136                           ztno = tr(ji,jj,jk,jn,Kmm_a) * e3t(ji,jj,jk,Krhs_a) 
     137                           tr(ji,jj,jk,jn,Kbb_a) = ( ztb + atfp * ( ztnu - ztno) )  &  
     138                                     &        * tmask(ji,jj,jk) / e3t(ji,jj,jk,Kbb_a) 
    143139                        ENDIF 
    144140                     ENDDO 
     
    148144         ENDIF 
    149145         DO jn = 1,jptra 
    150             DO jk=1,jpk 
     146            DO jk=1,jpkm1 
    151147               DO jj=j1,j2 
    152148                  DO ji=i1,i2 
    153149                     IF( tabres_child(ji,jj,jk,jn) .NE. 0. ) THEN  
    154                         trn(ji,jj,jk,jn) = tabres_child(ji,jj,jk,jn) * tmask(ji,jj,jk) 
     150                        tr(ji,jj,jk,jn,Kmm_a) = tabres_child(ji,jj,jk,jn) 
    155151                     END IF 
    156152                  END DO 
     
    158154            END DO 
    159155         END DO 
     156         ! 
     157         IF  ((neuler==0).AND.(Agrif_Nb_Step()==0) ) THEN 
     158            tr(i1:i2,j1:j2,1:jpkm1,1:jptra,Kbb_a)  = tr(i1:i2,j1:j2,1:jpkm1,1:jptra,Kmm_a) 
     159         ENDIF 
     160         ! 
     161 
    160162      ENDIF 
    161163      !  
     
    183185                  DO ji=i1,i2 
    184186!> jc tmp 
    185                      tabres(ji,jj,jk,jn) = trn(ji,jj,jk,jn)  * e3t_n(ji,jj,jk) / e3t_0(ji,jj,jk) 
    186 !                     tabres(ji,jj,jk,jn) = trn(ji,jj,jk,jn)  * e3t_n(ji,jj,jk) 
     187                     tabres(ji,jj,jk,jn) = tr(ji,jj,jk,jn,Kmm_a)  * e3t(ji,jj,jk,Kmm_a) / e3t_0(ji,jj,jk) 
     188!                     tabres(ji,jj,jk,jn) = tr(ji,jj,jk,jn,Kmm_a)  * e3t(ji,jj,jk,Kmm_a) 
    187189!< jc tmp 
    188190                  END DO 
     
    204206                     DO ji=i1,i2 
    205207                        IF( tabres(ji,jj,jk,jn) .NE. 0. ) THEN 
    206                            ztb  = trb(ji,jj,jk,jn) * e3t_b(ji,jj,jk) ! fse3t_b prior update should be used 
     208                           ztb  = tr(ji,jj,jk,jn,Kbb_a) * e3t(ji,jj,jk,Kbb_a) ! fse3t_b prior update should be used 
    207209                           ztnu = tabres(ji,jj,jk,jn) 
    208                            ztno = trn(ji,jj,jk,jn) * e3t_a(ji,jj,jk) 
    209                            trb(ji,jj,jk,jn) = ( ztb + atfp * ( ztnu - ztno) )  &  
    210                                      &        * tmask(ji,jj,jk) / e3t_b(ji,jj,jk) 
     210                           ztno = tr(ji,jj,jk,jn,Kmm_a) * e3t(ji,jj,jk,Krhs_a) 
     211                           tr(ji,jj,jk,jn,Kbb_a) = ( ztb + atfp * ( ztnu - ztno) )  &  
     212                                     &        * tmask(ji,jj,jk) / e3t(ji,jj,jk,Kbb_a) 
    211213                        ENDIF 
    212214                     ENDDO 
     
    220222                  DO ji=i1,i2 
    221223                     IF( tabres(ji,jj,jk,jn) .NE. 0. ) THEN  
    222                         trn(ji,jj,jk,jn) = tabres(ji,jj,jk,jn) / e3t_n(ji,jj,jk) 
     224                        tr(ji,jj,jk,jn,Kmm_a) = tabres(ji,jj,jk,jn) / e3t(ji,jj,jk,Kmm_a) 
    223225                     END IF 
    224226                  END DO 
     
    228230         ! 
    229231         IF  ((neuler==0).AND.(Agrif_Nb_Step()==0) ) THEN 
    230             trb(i1:i2,j1:j2,k1:k2,n1:n2)  = trn(i1:i2,j1:j2,k1:k2,n1:n2) 
     232            tr(i1:i2,j1:j2,k1:k2,n1:n2,Kbb_a)  = tr(i1:i2,j1:j2,k1:k2,n1:n2,Kmm_a) 
    231233         ENDIF 
    232234         ! 
Note: See TracChangeset for help on using the changeset viewer.