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 4346 for branches/2013 – NEMO

Changeset 4346 for branches/2013


Ignore:
Timestamp:
2014-01-10T17:25:44+01:00 (10 years ago)
Author:
clem
Message:

clean the glob_sum diags for LIM3

Location:
branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/LIM_SRC_3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/LIM_SRC_3/limdiahsb.F90

    r4161 r4346  
    3434   !!PUBLIC   lim_diahsb_rst   ! routine called by ice_init.F90 
    3535 
    36    REAL(wp), SAVE  ::   frc_sal, frc_vol   ! global forcing trends 
    37    REAL(wp), SAVE   ::   bg_grpme           ! global ice growth+melt trends 
     36   REAL(dp) ::   frc_sal, frc_vol   ! global forcing trends 
     37   REAL(dp) ::   bg_grme            ! global ice growth+melt trends 
    3838   REAL(wp) ::   epsi06 = 1.e-6_wp  ! small number 
    3939   REAL(wp) ::   epsi03 = 1.e-3_wp  ! small number 
     
    5757      !! ** Purpose: Compute the ice global heat content, salt content and volume conservation 
    5858      !!  
    59       !! ** Method : - Compute the deviation of heat content, salt content and volume 
    60       !!             at the current time step from their values at nit000 
    61       !!             - Compute the contribution of forcing and remove it from these deviations 
     59      !!--------------------------------------------------------------------------- 
    6260      !! 
    63       !!--------------------------------------------------------------------------- 
    64       !! 
    65       REAL(wp)   ::   zbg_ivo, zbg_svo, zbg_are, zbg_sal ,zbg_tem ,zbg_ihc ,zbg_shc 
    66       REAL(wp)   ::   zbg_sfx, zbg_emp, zbg_sfx_bri, zbg_sfx_thd, zbg_sfx_res, zbg_sfx_mec  
    67       REAL(wp)   ::   z_frc_vol, z_frc_sal, z_bg_grpme  
    68       REAL(wp)   ::   zdeltat, z1_area                     !    -     - 
     61      REAL(dp)   ::   zbg_ivo, zbg_svo, zbg_are, zbg_sal ,zbg_tem ,zbg_ihc ,zbg_shc 
     62      REAL(dp)   ::   zbg_sfx, zbg_sfx_bri, zbg_sfx_thd, zbg_sfx_res, zbg_sfx_mec  
     63      REAL(dp)   ::   zbg_emp, zbg_emp_bog, zbg_emp_lag, zbg_emp_sig, zbg_emp_dyg, zbg_emp_bom, zbg_emp_sum, zbg_emp_res  
     64      REAL(dp)   ::   z_frc_vol, z_frc_sal, z_bg_grme  
     65      REAL(dp)   ::   z1_area                     !    -     - 
     66      REAL(dp)   ::   zinda, zindb 
    6967      !!--------------------------------------------------------------------------- 
    7068      IF( nn_timing == 1 )   CALL timing_start('lim_diahsb') 
     
    7371 
    7472      ! 1/area 
    75       z1_area = 1.0 / MAX( glob_sum( area(:,:) * tms(:,:) ),epsi06 ) 
     73      z1_area = 1.d0 / MAX( glob_sum( area(:,:) * tms(:,:) ), epsi06 ) 
     74 
     75      zinda = MAX( 0.d0 , SIGN( 1.d0 , glob_sum( area(:,:) * tms(:,:) ) - epsi06 ) ) 
    7676      ! ----------------------- ! 
    7777      ! 1 -  Content variations ! 
     
    8080      zbg_svo = glob_sum( vt_s(:,:) * area(:,:) * tms(:,:) ) ! volume snow 
    8181      zbg_are = glob_sum( at_i(:,:) * area(:,:) * tms(:,:) ) ! area 
    82       zbg_sal = glob_sum( SUM(smv_i(:,:,:),dim=3) * area(:,:) * tms(:,:) ) ! mean salt content 
    83       zbg_tem = glob_sum( (tm_i(:,:)-rtt) * vt_i(:,:) * area(:,:) * tms(:,:) )  ! mean temp content 
     82      zbg_sal = glob_sum( SUM( smv_i(:,:,:), dim=3 ) * area(:,:) * tms(:,:) )      ! mean salt content 
     83      zbg_tem = glob_sum( ( tm_i(:,:) - rtt ) * vt_i(:,:) * area(:,:) * tms(:,:) )  ! mean temp content 
    8484 
    8585      !zbg_ihc = glob_sum( et_i(:,:) * area(:,:) * tms(:,:) ) / MAX( zbg_ivo,epsi06 ) ! ice heat content 
    8686      !zbg_shc = glob_sum( et_s(:,:) * area(:,:) * tms(:,:) ) / MAX( zbg_svo,epsi06 ) ! snow heat content 
    8787 
    88       zbg_ihc = glob_sum( et_i(:,:) ) ! ice heat content  [10^9 J] 
    89       zbg_shc = glob_sum( et_s(:,:) ) ! snow heat content [10^9 J] 
    90  
    91       zbg_sfx      = glob_sum(      sfx(:,:) * area(:,:) * tms(:,:) ) * z1_area 
    92       zbg_emp       = glob_sum(       emp(:,:) * area(:,:) * tms(:,:) ) * z1_area 
    93       zbg_sfx_bri     = glob_sum(     sfx_bri(:,:) * area(:,:) * tms(:,:) ) * z1_area 
    94       zbg_sfx_thd     = glob_sum(     sfx_thd(:,:) * area(:,:) * tms(:,:) ) * z1_area 
    95       zbg_sfx_res = glob_sum( sfx_res(:,:) * area(:,:) * tms(:,:) ) * z1_area 
    96       zbg_sfx_mec = glob_sum( sfx_mec(:,:) * area(:,:) * tms(:,:) ) * z1_area 
     88      zbg_ihc = glob_sum( et_i(:,:) * 1.e-11 ) ! ice heat content  [10^9*1.e-11 J] 
     89      zbg_shc = glob_sum( et_s(:,:) * 1.e-11 ) ! snow heat content [10^9*1.e-11 J] 
     90 
     91      zbg_emp     = zinda * glob_sum(         emp(:,:) * area(:,:) * tms(:,:) ) * z1_area         * r1_rau0 * rday 
     92      zbg_emp_bog = zinda * glob_sum( diag_bot_gr(:,:) * area(:,:) * tms(:,:) ) * z1_area * rhoic * r1_rau0 * rday 
     93      zbg_emp_lag = zinda * glob_sum( diag_lat_gr(:,:) * area(:,:) * tms(:,:) ) * z1_area * rhoic * r1_rau0 * rday 
     94      zbg_emp_sig = zinda * glob_sum( diag_sni_gr(:,:) * area(:,:) * tms(:,:) ) * z1_area * rhoic * r1_rau0 * rday 
     95      zbg_emp_dyg = zinda * glob_sum( diag_dyn_gr(:,:) * area(:,:) * tms(:,:) ) * z1_area * rhoic * r1_rau0 * rday 
     96      zbg_emp_bom = zinda * glob_sum( diag_bot_me(:,:) * area(:,:) * tms(:,:) ) * z1_area * rhoic * r1_rau0 * rday 
     97      zbg_emp_sum = zinda * glob_sum( diag_sur_me(:,:) * area(:,:) * tms(:,:) ) * z1_area * rhoic * r1_rau0 * rday 
     98      zbg_emp_res = zinda * glob_sum( diag_res_pr(:,:) * area(:,:) * tms(:,:) ) * z1_area * rhoic * r1_rau0 * rday 
     99 
     100      zbg_sfx     = zinda * glob_sum(     sfx(:,:) * area(:,:) * tms(:,:) ) * z1_area * r1_rau0 * rday 
     101      zbg_sfx_bri = zinda * glob_sum( sfx_bri(:,:) * area(:,:) * tms(:,:) ) * z1_area * r1_rau0 * rday 
     102      zbg_sfx_thd = zinda * glob_sum( sfx_thd(:,:) * area(:,:) * tms(:,:) ) * z1_area * r1_rau0 * rday 
     103      zbg_sfx_res = zinda * glob_sum( sfx_res(:,:) * area(:,:) * tms(:,:) ) * z1_area * r1_rau0 * rday 
     104      zbg_sfx_mec = zinda * glob_sum( sfx_mec(:,:) * area(:,:) * tms(:,:) ) * z1_area * r1_rau0 * rday 
    97105       
    98106      ! --------------------------------------------- ! 
    99107      ! 2 - Trends due to forcing and ice growth/melt ! 
    100108      ! --------------------------------------------- ! 
    101       z_frc_vol = ( 1.e0 / rau0 ) * glob_sum( - emp(:,:) * area(:,:) * tms(:,:) ) ! volume fluxes 
    102       z_frc_sal = ( 1.e0 / rau0 ) * glob_sum(  sfx(:,:) * area(:,:) * tms(:,:) ) ! salt fluxes 
    103       z_bg_grpme = glob_sum( ( diag_bot_gr(:,:) + diag_lat_gr(:,:) + diag_sni_gr(:,:) + diag_dyn_gr(:,:) + & 
     109      z_frc_vol = r1_rau0 * glob_sum( - emp(:,:) * area(:,:) * tms(:,:) ) ! volume fluxes 
     110      z_frc_sal = r1_rau0 * glob_sum(   sfx(:,:) * area(:,:) * tms(:,:) ) ! salt fluxes 
     111      z_bg_grme = glob_sum( ( diag_bot_gr(:,:) + diag_lat_gr(:,:) + diag_sni_gr(:,:) + diag_dyn_gr(:,:) + & 
    104112                          &    diag_bot_me(:,:) + diag_sur_me(:,:) + diag_res_pr(:,:) ) * area(:,:) * tms(:,:) ) ! volume fluxes 
    105113      ! 
    106114      frc_vol  = frc_vol  + z_frc_vol  * rdt_ice 
    107115      frc_sal  = frc_sal  + z_frc_sal  * rdt_ice 
    108       bg_grpme = bg_grpme + z_bg_grpme * rdt_ice 
     116      bg_grme  = bg_grme  + z_bg_grme * rdt_ice 
    109117       
    110118      ! difference 
     
    115123      ! 3 - Diagnostics writing ! 
    116124      ! ----------------------- ! 
    117       !zdeltat  = 1.e0 / ( ( kt - nit000 + 1 ) * rdt_ice ) 
    118       ! 
    119       CALL iom_put( 'ibgvoltot',zbg_ivo * rhoic / rau0 * 1.e-9 ) ! m3 (equivalent liquid)          
    120       CALL iom_put( 'sbgvoltot',zbg_svo * rhosn / rau0 * 1.e-9 )  ! m3 (equivalent liquid)        
    121       CALL iom_put( 'ibgarea',zbg_are * 1.e-6 )          
    122       CALL iom_put( 'ibgsaline',zbg_sal / MAX( zbg_ivo,epsi03 ) )          
    123       CALL iom_put( 'ibgtemper',zbg_tem / MAX( zbg_ivo,epsi03 ) )          
    124       CALL iom_put( 'ibgheatco',zbg_ihc )           ! 10^9 J         
    125       CALL iom_put( 'ibgsaltco',zbg_sal * rhoic / rau0 * 1.e-9 ) ! psu*km3         
    126       CALL iom_put( 'sbgheatco',zbg_shc )           ! 10^9 J 
    127       CALL iom_put( 'ibgfrcemp',frc_vol * 1.e-9 )           !vol - forcing : km3 (equivalent liquid)          
    128       CALL iom_put( 'ibgfrcsfx',frc_sal * 1.e-9 )          !sal - forcing : psu*km3    
    129       CALL iom_put( 'ibgsfx',zbg_sfx *rday)             
    130       CALL iom_put( 'ibgemp',zbg_emp *rday)               
    131       CALL iom_put( 'ibgsfxbri',zbg_sfx_bri *rday)          
    132       CALL iom_put( 'ibgsfxthd',zbg_sfx_thd *rday)          
    133       CALL iom_put( 'ibgsfxres',zbg_sfx_res *rday)          
    134       CALL iom_put( 'ibgsfxmec',zbg_sfx_mec *rday)          
    135       CALL iom_put( 'ibggrpme',bg_grpme * rhoic / rau0 * 1.e-9 ) ! km3 (equivalent liquid)          
     125      zindb = MAX( 0.d0 , SIGN( 1.d0 , zbg_ivo - epsi06 ) ) 
     126      ! 
     127      CALL iom_put( 'ibgvoltot' , zbg_ivo * rhoic * r1_rau0 * 1.e-9        )   ! ice volume (km3 equivalent liquid)          
     128      CALL iom_put( 'sbgvoltot' , zbg_svo * rhosn * r1_rau0 * 1.e-9        )   ! snw volume (km3 equivalent liquid)        
     129      CALL iom_put( 'ibgarea'   , zbg_are * 1.e-6                          )   ! ice area   (km2) 
     130      CALL iom_put( 'ibgsaline' , zindb * zbg_sal / MAX( zbg_ivo, epsi06 ) )   ! ice saline (psu) 
     131      CALL iom_put( 'ibgtemper' , zindb * zbg_tem / MAX( zbg_ivo, epsi06 ) )   ! ice temper (C) 
     132      CALL iom_put( 'ibgheatco' , zbg_ihc                                  )   ! ice heat content (1.e20 J)         
     133      CALL iom_put( 'sbgheatco' , zbg_shc                                  )   ! snw heat content (1.e20 J) 
     134      CALL iom_put( 'ibgsaltco' , zbg_sal * rhoic * r1_rau0 * 1.e-9        )   ! ice salt content (psu*km3 equivalent liquid)         
     135 
     136      CALL iom_put( 'ibgemp'    , zbg_emp                                  )   ! volume flux emp (m/day liquid) 
     137      CALL iom_put( 'ibgempbog' , zbg_emp_bog                              )   ! volume flux bottom growth     -(m/day equivalent liquid) 
     138      CALL iom_put( 'ibgemplag' , zbg_emp_lag                              )   ! volume flux open water growth - 
     139      CALL iom_put( 'ibgempsig' , zbg_emp_sig                              )   ! volume flux snow ice growth   - 
     140      CALL iom_put( 'ibgempdyg' , zbg_emp_dyg                              )   ! volume flux dynamic growth    - 
     141      CALL iom_put( 'ibgempbom' , zbg_emp_bom                              )   ! volume flux bottom melt       - 
     142      CALL iom_put( 'ibgempsum' , zbg_emp_sum                              )   ! volume flux surface melt      - 
     143      CALL iom_put( 'ibgempres' , zbg_emp_res                              )   ! volume flux resultant         - 
     144           
     145      CALL iom_put( 'ibgsfx'    , zbg_sfx                                  )   ! salt flux         -(psu*m/day equivalent liquid)        
     146      CALL iom_put( 'ibgsfxbri' , zbg_sfx_bri                              )   ! salt flux brines  -       
     147      CALL iom_put( 'ibgsfxthd' , zbg_sfx_thd                              )   ! salt flux thermo  -     
     148      CALL iom_put( 'ibgsfxmec' , zbg_sfx_mec                              )   ! salt flux dynamic -     
     149      CALL iom_put( 'ibgsfxres' , zbg_sfx_res                              )   ! salt flux result  -     
     150 
     151      CALL iom_put( 'ibgfrcvol' , frc_vol * 1.e-9                          )   ! vol - forcing     (km3 equivalent liquid)  
     152      CALL iom_put( 'ibgfrcsfx' , frc_sal * 1.e-9                          )   ! sal - forcing     (psu*km3 equivalent liquid)    
     153      CALL iom_put( 'ibggrme'   , bg_grme * rhoic * r1_rau0 * 1.e-9        )   ! vol growth + melt (km3 equivalent liquid)          
    136154      ! 
    137155      IF( lrst_ice )   CALL lim_diahsb_rst( numit, 'WRITE' ) 
     
    172190      ! 2 - initial conservation variables ! 
    173191      ! ---------------------------------- ! 
    174       !frc_vol = 0._wp                                           ! volume       trend due to forcing 
    175       !frc_sal = 0._wp                                           ! salt content   -    -   -    -          
    176       !bg_grpme = 0._wp                                          ! ice growth + melt volume trend 
     192      !frc_vol = 0.d0                                           ! volume       trend due to forcing 
     193      !frc_sal = 0.d0                                           ! salt content   -    -   -    -          
     194      !bg_grme = 0.d0                                           ! ice growth + melt volume trend 
    177195      ! 
    178196      CALL lim_diahsb_rst( nstart, 'READ' )  !* read or initialize all required files 
     
    196214     IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise  
    197215        IF( ln_rstart ) THEN                   !* Read the restart file 
    198            id1 = iom_varid( numrir, 'frc_vol'  , ldstop = .TRUE. ) 
     216           !id1 = iom_varid( numrir, 'frc_vol'  , ldstop = .TRUE. ) 
    199217           ! 
     218           IF(lwp) WRITE(numout,*) '~~~~~~~' 
     219           IF(lwp) WRITE(numout,*) ' lim_diahsb_rst at it= ', kt,' date= ', ndastp 
     220           IF(lwp) WRITE(numout,*) '~~~~~~~' 
    200221           CALL iom_get( numrir, 'frc_vol', frc_vol ) 
    201222           CALL iom_get( numrir, 'frc_sal', frc_sal ) 
    202            CALL iom_get( numrir, 'bg_grpme', bg_grpme ) 
    203        ELSE 
    204             frc_vol = 0._wp                                            
    205             frc_sal = 0._wp                                                   
    206             bg_grpme = 0._wp                                         
     223           CALL iom_get( numrir, 'bg_grme', bg_grme ) 
     224        ELSE 
     225           IF(lwp) WRITE(numout,*) '~~~~~~~' 
     226           IF(lwp) WRITE(numout,*) ' lim_diahsb at initial state ' 
     227           IF(lwp) WRITE(numout,*) '~~~~~~~' 
     228           frc_vol  = 0.d0                                            
     229           frc_sal  = 0.d0                                                   
     230           bg_grme  = 0.d0                                         
    207231       ENDIF    
    208232 
    209233     ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file 
    210234        !                                   ! ------------------- 
    211         IF(lwp) WRITE(numout,*) '---- limdia-rst ----' 
     235        IF(lwp) WRITE(numout,*) '~~~~~~~' 
     236        IF(lwp) WRITE(numout,*) ' lim_diahsb_rst at it= ', kt,' date= ', ndastp 
     237        IF(lwp) WRITE(numout,*) '~~~~~~~' 
    212238        CALL iom_rstput( kt, nitrst, numriw, 'frc_vol'   , frc_vol     ) 
    213239        CALL iom_rstput( kt, nitrst, numriw, 'frc_sal'   , frc_sal     ) 
    214         CALL iom_rstput( kt, nitrst, numriw, 'bg_grpme'  , bg_grpme     ) 
     240        CALL iom_rstput( kt, nitrst, numriw, 'bg_grme'   , bg_grme     ) 
    215241        ! 
    216242     ENDIF 
  • branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90

    r4333 r4346  
    14841484            END DO 
    14851485         END DO 
    1486          zmask_glo = glob_sum(zmask) 
     1486         !zmask_glo = glob_sum(zmask) 
    14871487         !IF( ln_nicep .AND. lwp ) WRITE(numout,*) zmask_glo, ' cells of ice zapped in the ocean ' 
    14881488 
  • branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90

    r4333 r4346  
    427427               !-Calculate stress tensor components zs1 and zs2  
    428428               !-at centre of grid cells (see section 3.5 of CICE user's guide). 
    429                zs1(ji,jj) = ( zs1(ji,jj) - dtotel*( ( 1._wp - alphaevp) * zs1(ji,jj) +   & 
    430                   &          ( delta / deltat(ji,jj) - zdd(ji,jj) / deltat(ji,jj) ) * zpresh(ji,jj) ) )  &        
    431                   &          / ( 1._wp + alphaevp * dtotel ) 
    432  
    433                zs2(ji,jj) = ( zs2(ji,jj) - dtotel * ( ( 1._wp - alphaevp ) * ecc2 * zs2(ji,jj) -   & 
    434                              zdt(ji,jj) / deltat(ji,jj) * zpresh(ji,jj) ) )   & 
    435                   &          / ( 1._wp + alphaevp * ecc2 * dtotel ) 
     429               !zs1(ji,jj) = ( zs1(ji,jj) - dtotel*( ( 1._wp - alphaevp) * zs1(ji,jj) +   & 
     430               !   &          ( delta / deltat(ji,jj) - zdd(ji,jj) / deltat(ji,jj) ) * zpresh(ji,jj) ) )  &        
     431               !   &          / ( 1._wp + alphaevp * dtotel ) 
     432 
     433               !zs2(ji,jj) = ( zs2(ji,jj) - dtotel * ( ( 1._wp - alphaevp ) * ecc2 * zs2(ji,jj) -   & 
     434               !              zdt(ji,jj) / deltat(ji,jj) * zpresh(ji,jj) ) )   & 
     435               !   &          / ( 1._wp + alphaevp * ecc2 * dtotel ) 
    436436 
    437437               ! new formulation from S. Bouillon to help stabilizing the code (no need of alphaevp) 
    438                !zs1(ji,jj) = ( zs1(ji,jj) + dtotel * ( ( zdd(ji,jj) / deltat(ji,jj) - delta / deltat(ji,jj) )  & 
    439                !   &         * zpresh(ji,jj) ) ) / ( 1._wp + dtotel ) 
    440                !zs2(ji,jj) = ( zs2(ji,jj) + dtotel * ( ecci * zdt(ji,jj) / deltat(ji,jj) * zpresh(ji,jj) ) )  & 
    441                !   &         / ( 1._wp + dtotel ) 
     438               zs1(ji,jj) = ( zs1(ji,jj) + dtotel * ( ( zdd(ji,jj) / deltat(ji,jj) - delta / deltat(ji,jj) )  & 
     439                  &         * zpresh(ji,jj) ) ) / ( 1._wp + dtotel ) 
     440               zs2(ji,jj) = ( zs2(ji,jj) + dtotel * ( ecci * zdt(ji,jj) / deltat(ji,jj) * zpresh(ji,jj) ) )  & 
     441                  &         / ( 1._wp + dtotel ) 
    442442 
    443443            END DO 
     
    473473 
    474474               !-Calculate stress tensor component zs12 at corners (see section 3.5 of CICE user's guide). 
    475                zs12(ji,jj) = ( zs12(ji,jj) - dtotel * ( (1.0-alphaevp) * ecc2 * zs12(ji,jj) - zds(ji,jj) /  & 
    476                   &          ( 2._wp * deltac(ji,jj) ) * zpreshc(ji,jj) ) )  & 
    477                   &          / ( 1._wp + alphaevp * ecc2 * dtotel )  
     475               !zs12(ji,jj) = ( zs12(ji,jj) - dtotel * ( (1.0-alphaevp) * ecc2 * zs12(ji,jj) - zds(ji,jj) /  & 
     476               !   &          ( 2._wp * deltac(ji,jj) ) * zpreshc(ji,jj) ) )  & 
     477               !   &          / ( 1._wp + alphaevp * ecc2 * dtotel )  
    478478 
    479479               ! new formulation from S. Bouillon to help stabilizing the code (no need of alphaevp) 
    480                !zs12(ji,jj) = ( zs12(ji,jj) + dtotel *  & 
    481                !   &          ( ecci * zds(ji,jj) / ( 2._wp * deltac(ji,jj) ) * zpreshc(ji,jj) ) )  & 
    482                !   &          / ( 1.0 + dtotel )  
     480               zs12(ji,jj) = ( zs12(ji,jj) + dtotel *  & 
     481                  &          ( ecci * zds(ji,jj) / ( 2._wp * deltac(ji,jj) ) * zpreshc(ji,jj) ) )  & 
     482                  &          / ( 1.0 + dtotel )  
    483483 
    484484            END DO ! ji 
Note: See TracChangeset for help on using the changeset viewer.