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 7646 for trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90 – NEMO

Ignore:
Timestamp:
2017-02-06T10:25:03+01:00 (7 years ago)
Author:
timgraham
Message:

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90

    r6470 r7646  
    1818   USE thd_ice          ! LIM thermodynamics 
    1919   USE ice              ! LIM variables 
    20    USE dom_ice          ! LIM domain 
    2120   USE limvar           ! LIM 
    2221   USE lbclnk           ! lateral boundary condition - MPP exchanges 
    2322   USE lib_mpp          ! MPP library 
    2423   USE wrk_nemo         ! work arrays 
    25    USE prtctl           ! Print control 
    2624 
    2725   USE in_out_manager   ! I/O manager 
    2826   USE iom              ! I/O manager 
    2927   USE lib_fortran      ! glob_sum 
    30    USE limdiahsb 
    3128   USE timing           ! Timing 
    3229   USE limcons          ! conservation tests 
     30   USE limctl           ! control prints 
    3331 
    3432   IMPLICIT NONE 
     
    7068      !!                ***  ROUTINE lim_itd_me_alloc *** 
    7169      !!---------------------------------------------------------------------! 
    72       ALLOCATE(                                                                     & 
     70      ALLOCATE(                                                                      & 
    7371         !* Variables shared among ridging subroutines 
    74          &      asum (jpi,jpj)     , athorn(jpi,jpj,0:jpl)                    ,     & 
    75          &      aksum(jpi,jpj)                                                ,     & 
    76          &      hrmin(jpi,jpj,jpl) , hraft(jpi,jpj,jpl) , aridge(jpi,jpj,jpl) ,     & 
    77          &      hrmax(jpi,jpj,jpl) , krdg (jpi,jpj,jpl) , araft (jpi,jpj,jpl) , STAT=lim_itd_me_alloc ) 
     72         &      asum (jpi,jpj)     , athorn(jpi,jpj,0:jpl) , aksum (jpi,jpj)     ,   & 
     73         &      hrmin(jpi,jpj,jpl) , hraft(jpi,jpj,jpl)    , aridge(jpi,jpj,jpl) ,   & 
     74         &      hrmax(jpi,jpj,jpl) , krdg (jpi,jpj,jpl)    , araft (jpi,jpj,jpl) , STAT=lim_itd_me_alloc ) 
    7875         ! 
    7976      IF( lim_itd_me_alloc /= 0 )   CALL ctl_warn( 'lim_itd_me_alloc: failed to allocate arrays' ) 
     
    127124      CALL wrk_alloc( jpi,jpj, closing_net, divu_adv, opning, closing_gross ) 
    128125 
    129       IF(ln_ctl) THEN 
    130          CALL prt_ctl(tab2d_1=ato_i , clinfo1=' lim_itd_me: ato_i  : ', tab2d_2=at_i   , clinfo2=' at_i    : ') 
    131          CALL prt_ctl(tab2d_1=divu_i, clinfo1=' lim_itd_me: divu_i : ', tab2d_2=delta_i, clinfo2=' delta_i : ') 
    132       ENDIF 
    133  
    134       IF( ln_limdyn ) THEN          !   Start ridging and rafting   ! 
    135  
    136126      ! conservation test 
    137       IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limitd_me', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
     127      IF( ln_limdiachk ) CALL lim_cons_hsm(0, 'limitd_me', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
    138128 
    139129      !-----------------------------------------------------------------------------! 
     
    211201            DO ji = 1, jpi 
    212202               za   = ( opning(ji,jj) - athorn(ji,jj,0) * closing_gross(ji,jj) ) * rdt_ice 
    213                IF( za < 0._wp .AND. za > - ato_i(ji,jj) ) THEN  ! would lead to negative ato_i 
    214                   zfac = - ato_i(ji,jj) / za 
     203               IF    ( za < 0._wp .AND. za > - ato_i(ji,jj) ) THEN                  ! would lead to negative ato_i 
     204                  zfac          = - ato_i(ji,jj) / za 
    215205                  opning(ji,jj) = athorn(ji,jj,0) * closing_gross(ji,jj) - ato_i(ji,jj) * r1_rdtice  
    216206               ELSEIF( za > 0._wp .AND. za > ( asum(ji,jj) - ato_i(ji,jj) ) ) THEN  ! would lead to ato_i > asum 
    217                   zfac = ( asum(ji,jj) - ato_i(ji,jj) ) / za 
     207                  zfac          = ( asum(ji,jj) - ato_i(ji,jj) ) / za 
    218208                  opning(ji,jj) = athorn(ji,jj,0) * closing_gross(ji,jj) + ( asum(ji,jj) - ato_i(ji,jj) ) * r1_rdtice  
    219209               ENDIF 
     
    259249                  closing_net(ji,jj) = 0._wp 
    260250                  opning     (ji,jj) = 0._wp 
     251                  ato_i      (ji,jj) = MAX( 0._wp, 1._wp - SUM( a_i(ji,jj,:) ) ) 
    261252               ELSE 
    262253                  iterate_ridging    = 1 
     
    292283      ! control prints 
    293284      !-----------------------------------------------------------------------------! 
    294       IF(ln_ctl) THEN  
    295          CALL lim_var_glo2eqv 
    296  
    297          CALL prt_ctl_info(' ') 
    298          CALL prt_ctl_info(' - Cell values : ') 
    299          CALL prt_ctl_info('   ~~~~~~~~~~~~~ ') 
    300          CALL prt_ctl(tab2d_1=e1e2t , clinfo1=' lim_itd_me  : cell area :') 
    301          CALL prt_ctl(tab2d_1=at_i , clinfo1=' lim_itd_me  : at_i      :') 
    302          CALL prt_ctl(tab2d_1=vt_i , clinfo1=' lim_itd_me  : vt_i      :') 
    303          CALL prt_ctl(tab2d_1=vt_s , clinfo1=' lim_itd_me  : vt_s      :') 
    304          DO jl = 1, jpl 
    305             CALL prt_ctl_info(' ') 
    306             CALL prt_ctl_info(' - Category : ', ivar1=jl) 
    307             CALL prt_ctl_info('   ~~~~~~~~~~') 
    308             CALL prt_ctl(tab2d_1=a_i   (:,:,jl)   , clinfo1= ' lim_itd_me  : a_i      : ') 
    309             CALL prt_ctl(tab2d_1=ht_i  (:,:,jl)   , clinfo1= ' lim_itd_me  : ht_i     : ') 
    310             CALL prt_ctl(tab2d_1=ht_s  (:,:,jl)   , clinfo1= ' lim_itd_me  : ht_s     : ') 
    311             CALL prt_ctl(tab2d_1=v_i   (:,:,jl)   , clinfo1= ' lim_itd_me  : v_i      : ') 
    312             CALL prt_ctl(tab2d_1=v_s   (:,:,jl)   , clinfo1= ' lim_itd_me  : v_s      : ') 
    313             CALL prt_ctl(tab2d_1=e_s   (:,:,1,jl) , clinfo1= ' lim_itd_me  : e_s      : ') 
    314             CALL prt_ctl(tab2d_1=t_su  (:,:,jl)   , clinfo1= ' lim_itd_me  : t_su     : ') 
    315             CALL prt_ctl(tab2d_1=t_s   (:,:,1,jl) , clinfo1= ' lim_itd_me  : t_snow   : ') 
    316             CALL prt_ctl(tab2d_1=sm_i  (:,:,jl)   , clinfo1= ' lim_itd_me  : sm_i     : ') 
    317             CALL prt_ctl(tab2d_1=smv_i (:,:,jl)   , clinfo1= ' lim_itd_me  : smv_i    : ') 
    318             DO jk = 1, nlay_i 
    319                CALL prt_ctl_info(' ') 
    320                CALL prt_ctl_info(' - Layer : ', ivar1=jk) 
    321                CALL prt_ctl_info('   ~~~~~~~') 
    322                CALL prt_ctl(tab2d_1=t_i(:,:,jk,jl) , clinfo1= ' lim_itd_me  : t_i      : ') 
    323                CALL prt_ctl(tab2d_1=e_i(:,:,jk,jl) , clinfo1= ' lim_itd_me  : e_i      : ') 
    324             END DO 
    325          END DO 
    326       ENDIF 
    327  
    328285      ! conservation test 
    329       IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limitd_me', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
    330  
    331       ENDIF  ! ln_limdyn=.true. 
    332       ! 
     286      IF( ln_limdiachk ) CALL lim_cons_hsm(1, 'limitd_me', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
     287 
     288      ! control prints 
     289      IF( ln_ctl )       CALL lim_prt3D( 'limitd_me' ) 
     290 
    333291      CALL wrk_dealloc( jpi, jpj, closing_net, divu_adv, opning, closing_gross ) 
    334292      ! 
     
    368326               rswitch = MAX( 0._wp , SIGN( 1._wp, a_i(ji,jj,jl) - epsi20 ) ) 
    369327               ht_i(ji,jj,jl) = v_i (ji,jj,jl) / MAX( a_i(ji,jj,jl) , epsi20 ) * rswitch 
    370             END DO 
     328           END DO 
    371329         END DO 
    372330      END DO 
     
    438396      ENDIF 
    439397 
    440       IF( ln_rafting ) THEN      ! Ridging and rafting ice participation functions 
     398      ! --- Ridging and rafting participation concentrations --- ! 
     399      IF( ln_rafting .AND. ln_ridging ) THEN 
    441400         ! 
    442401         DO jl = 1, jpl 
     
    445404                  zdummy           = TANH ( rn_craft * ( ht_i(ji,jj,jl) - rn_hraft ) ) 
    446405                  aridge(ji,jj,jl) = ( 1._wp + zdummy ) * 0.5_wp * athorn(ji,jj,jl) 
    447                   araft (ji,jj,jl) = ( 1._wp - zdummy ) * 0.5_wp * athorn(ji,jj,jl) 
     406                  araft (ji,jj,jl) = athorn(ji,jj,jl) - aridge(ji,jj,jl) 
    448407               END DO 
    449408            END DO 
    450409         END DO 
    451  
    452       ELSE 
     410         ! 
     411      ELSEIF( ln_ridging .AND. .NOT. ln_rafting ) THEN 
    453412         ! 
    454413         DO jl = 1, jpl 
    455414            aridge(:,:,jl) = athorn(:,:,jl) 
     415         END DO 
     416         ! 
     417      ELSEIF( ln_rafting .AND. .NOT. ln_ridging ) THEN 
     418         ! 
     419         DO jl = 1, jpl 
     420            araft(:,:,jl) = athorn(:,:,jl) 
    456421         END DO 
    457422         ! 
     
    657622                  &                            - sm_i(ji,jj,jl1) * vsw(ij) * rhoic * r1_rdtice     ! and get  sm_i  from the ocean  
    658623            ENDIF 
    659              
     624                
    660625            !------------------------------------------             
    661626            ! 3.7 Put the snow somewhere in the ocean 
     
    795760      INTEGER             ::   numts_rm    ! number of time steps for the P smoothing 
    796761      REAL(wp)            ::   zp, z1_3    ! local scalars 
    797       REAL(wp), POINTER, DIMENSION(:,:) ::   zworka   ! temporary array used here 
     762      REAL(wp), POINTER, DIMENSION(:,:) ::   zworka           ! temporary array used here 
     763      REAL(wp), POINTER, DIMENSION(:,:) ::   zstrp1, zstrp2   ! strength at previous time steps 
    798764      !!---------------------------------------------------------------------- 
    799765 
    800       CALL wrk_alloc( jpi, jpj, zworka ) 
     766      CALL wrk_alloc( jpi,jpj, zworka, zstrp1, zstrp2 ) 
    801767 
    802768      !------------------------------------------------------------------------------! 
     
    844810         END DO 
    845811    
    846          strength(:,:) = rn_pe_rdg * Cp * strength(:,:) / aksum(:,:) 
     812         strength(:,:) = rn_pe_rdg * Cp * strength(:,:) / aksum(:,:) * tmask(:,:,1) 
    847813                         ! where Cp = (g/2)*(rhow-rhoi)*(rhoi/rhow) and rn_pe_rdg accounts for frictional dissipation 
    848814         ksmooth = 1 
    849815 
    850          !------------------------------------------------------------------------------! 
    851          ! 4) Hibler (1979)' method 
    852          !------------------------------------------------------------------------------! 
     816      !------------------------------------------------------------------------------! 
     817      ! 4) Hibler (1979)' method 
     818      !------------------------------------------------------------------------------! 
    853819      ELSE                      ! kstrngth ne 1:  Hibler (1979) form 
    854820         ! 
    855          strength(:,:) = rn_pstar * vt_i(:,:) * EXP( - rn_crhg * ( 1._wp - at_i(:,:) )  ) 
     821         strength(:,:) = rn_pstar * vt_i(:,:) * EXP( - rn_crhg * ( 1._wp - at_i(:,:) )  ) * tmask(:,:,1) 
    856822         ! 
    857823         ksmooth = 1 
     
    866832         DO jj = 1, jpj 
    867833            DO ji = 1, jpi 
    868                strength(ji,jj) = strength(ji,jj) * exp(-5.88*SQRT(MAX(bv_i(ji,jj),0.0))) 
     834               strength(ji,jj) = strength(ji,jj) * exp(-5.88*SQRT(MAX(bvm_i(ji,jj),0.0))) 
    869835            END DO 
    870836         END DO 
     
    880846      IF ( ksmooth == 1 ) THEN 
    881847 
    882          CALL lbc_lnk( strength, 'T', 1. ) 
    883  
    884848         DO jj = 2, jpjm1 
    885849            DO ji = 2, jpim1 
    886                IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > 0._wp) THEN  
     850               IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > 0._wp ) THEN  
    887851                  zworka(ji,jj) = ( 4.0 * strength(ji,jj)              & 
    888852                     &                  + strength(ji-1,jj) * tmask(ji-1,jj,1) + strength(ji+1,jj) * tmask(ji+1,jj,1) &   
     
    907871      ! Temporal smoothing 
    908872      !-------------------- 
    909       IF ( numit == nit000 + nn_fsbc - 1 ) THEN 
    910          strp1(:,:) = 0.0             
    911          strp2(:,:) = 0.0             
    912       ENDIF 
    913  
    914873      IF ( ksmooth == 2 ) THEN 
    915874 
    916          CALL lbc_lnk( strength, 'T', 1. ) 
    917  
    918          DO jj = 1, jpj - 1 
    919             DO ji = 1, jpi - 1 
    920                IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > 0._wp) THEN  
     875         IF ( numit == nit000 + nn_fsbc - 1 ) THEN 
     876            zstrp1(:,:) = 0._wp 
     877            zstrp2(:,:) = 0._wp 
     878         ENDIF 
     879 
     880         DO jj = 2, jpjm1 
     881            DO ji = 2, jpim1 
     882               IF ( ( asum(ji,jj) - ato_i(ji,jj) ) > 0._wp ) THEN  
    921883                  numts_rm = 1 ! number of time steps for the running mean 
    922                   IF ( strp1(ji,jj) > 0._wp ) numts_rm = numts_rm + 1 
    923                   IF ( strp2(ji,jj) > 0._wp ) numts_rm = numts_rm + 1 
    924                   zp = ( strength(ji,jj) + strp1(ji,jj) + strp2(ji,jj) ) / numts_rm 
    925                   strp2(ji,jj) = strp1(ji,jj) 
    926                   strp1(ji,jj) = strength(ji,jj) 
     884                  IF ( zstrp1(ji,jj) > 0._wp ) numts_rm = numts_rm + 1 
     885                  IF ( zstrp2(ji,jj) > 0._wp ) numts_rm = numts_rm + 1 
     886                  zp = ( strength(ji,jj) + zstrp1(ji,jj) + zstrp2(ji,jj) ) / numts_rm 
     887                  zstrp2(ji,jj) = zstrp1(ji,jj) 
     888                  zstrp1(ji,jj) = strength(ji,jj) 
    927889                  strength(ji,jj) = zp 
    928  
    929890               ENDIF 
    930891            END DO 
    931892         END DO 
    932893 
     894         CALL lbc_lnk( strength, 'T', 1. )      ! Boundary conditions 
     895 
    933896      ENDIF ! ksmooth 
    934897 
    935       CALL lbc_lnk( strength, 'T', 1. )      ! Boundary conditions 
    936  
    937       CALL wrk_dealloc( jpi, jpj, zworka ) 
     898      CALL wrk_dealloc( jpi,jpj, zworka, zstrp1, zstrp2 ) 
    938899      ! 
    939900   END SUBROUTINE lim_itd_me_icestrength 
     
    953914      !!------------------------------------------------------------------- 
    954915      INTEGER :: ios                 ! Local integer output status for namelist read 
    955       NAMELIST/namiceitdme/ rn_cs, rn_fsnowrdg, rn_fsnowrft,              &  
    956         &                   rn_gstar, rn_astar, rn_hstar, ln_rafting, rn_hraft, rn_craft, rn_por_rdg, & 
    957         &                   nn_partfun 
     916      NAMELIST/namiceitdme/ rn_cs, nn_partfun, rn_gstar, rn_astar,             &  
     917        &                   ln_ridging, rn_hstar, rn_por_rdg, rn_fsnowrdg, ln_rafting, rn_hraft, rn_craft, rn_fsnowrft 
    958918      !!------------------------------------------------------------------- 
    959919      ! 
     
    969929      IF (lwp) THEN                          ! control print 
    970930         WRITE(numout,*) 
    971          WRITE(numout,*)' lim_itd_me_init : ice parameters for mechanical ice redistribution ' 
    972          WRITE(numout,*)' ~~~~~~~~~~~~~~~' 
     931         WRITE(numout,*)'lim_itd_me_init : ice parameters for mechanical ice redistribution ' 
     932         WRITE(numout,*)'~~~~~~~~~~~~~~~' 
    973933         WRITE(numout,*)'   Fraction of shear energy contributing to ridging        rn_cs       = ', rn_cs  
    974          WRITE(numout,*)'   Fraction of snow volume conserved during ridging        rn_fsnowrdg = ', rn_fsnowrdg  
    975          WRITE(numout,*)'   Fraction of snow volume conserved during ridging        rn_fsnowrft = ', rn_fsnowrft  
     934         WRITE(numout,*)'   Switch for part. function (0) linear (1) exponential    nn_partfun  = ', nn_partfun 
    976935         WRITE(numout,*)'   Fraction of total ice coverage contributing to ridging  rn_gstar    = ', rn_gstar 
    977936         WRITE(numout,*)'   Equivalent to G* for an exponential part function       rn_astar    = ', rn_astar 
     937         WRITE(numout,*)'   Ridging of ice sheets or not                            ln_ridging  = ', ln_ridging 
    978938         WRITE(numout,*)'   Quantity playing a role in max ridged ice thickness     rn_hstar    = ', rn_hstar 
     939         WRITE(numout,*)'   Initial porosity of ridges                              rn_por_rdg  = ', rn_por_rdg 
     940         WRITE(numout,*)'   Fraction of snow volume conserved during ridging        rn_fsnowrdg = ', rn_fsnowrdg  
    979941         WRITE(numout,*)'   Rafting of ice sheets or not                            ln_rafting  = ', ln_rafting 
    980942         WRITE(numout,*)'   Parmeter thickness (threshold between ridge-raft)       rn_hraft    = ', rn_hraft 
    981943         WRITE(numout,*)'   Rafting hyperbolic tangent coefficient                  rn_craft    = ', rn_craft   
    982          WRITE(numout,*)'   Initial porosity of ridges                              rn_por_rdg  = ', rn_por_rdg 
    983          WRITE(numout,*)'   Switch for part. function (0) linear (1) exponential    nn_partfun  = ', nn_partfun 
     944         WRITE(numout,*)'   Fraction of snow volume conserved during ridging        rn_fsnowrft = ', rn_fsnowrft  
    984945      ENDIF 
    985946      ! 
Note: See TracChangeset for help on using the changeset viewer.