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 4161 for branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90 – NEMO

Ignore:
Timestamp:
2013-11-07T11:01:27+01:00 (10 years ago)
Author:
cetlod
Message:

dev_LOCEAN_2013 : merge in the 3rd dev branch dev_r4028_CNRS_LIM3, see ticket #1169

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90

    r4147 r4161  
    1515   !!    lim_dyn_init : initialization and namelist read 
    1616   !!---------------------------------------------------------------------- 
    17    USE phycst         ! physical constants 
    18    USE dom_oce        ! ocean space and time domain 
    19    USE sbc_oce        ! Surface boundary condition: ocean fields 
    20    USE sbc_ice        ! Surface boundary condition: ice   fields 
    21    USE ice            ! LIM-3 variables 
    22    USE par_ice        ! LIM-3 parameters 
    23    USE dom_ice        ! LIM-3 domain 
    24    USE limrhg         ! LIM-3 rheology 
    25    USE lbclnk         ! lateral boundary conditions - MPP exchanges 
    26    USE lib_mpp        ! MPP library 
    27    USE wrk_nemo       ! work arrays 
    28    USE in_out_manager ! I/O manager 
    29    USE prtctl         ! Print control 
    30    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)   
     17   USE phycst           ! physical constants 
     18   USE dom_oce          ! ocean space and time domain 
     19   USE sbc_oce          ! Surface boundary condition: ocean fields 
     20   USE sbc_ice          ! Surface boundary condition: ice   fields 
     21   USE ice              ! LIM-3 variables 
     22   USE par_ice          ! LIM-3 parameters 
     23   USE dom_ice          ! LIM-3 domain 
     24   USE limrhg           ! LIM-3 rheology 
     25   USE lbclnk           ! lateral boundary conditions - MPP exchanges 
     26   USE lib_mpp          ! MPP library 
     27   USE wrk_nemo         ! work arrays 
     28   USE in_out_manager   ! I/O manager 
     29   USE prtctl           ! Print control 
     30   USE lib_fortran      ! glob_sum 
     31   USE timing          ! Timing 
    3132 
    3233   IMPLICIT NONE 
     
    3839#  include "vectopt_loop_substitute.h90" 
    3940   !!---------------------------------------------------------------------- 
    40    !! NEMO/LIM3 3.4 , UCL - NEMO Consortium (2011) 
     41   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) 
    4142   !! $Id$ 
    4243   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    6566      REAL(wp), POINTER, DIMENSION(:)   ::   zmsk           ! i-averaged of tmask 
    6667      REAL(wp), POINTER, DIMENSION(:,:) ::   zu_io, zv_io   ! ice-ocean velocity 
    67       !!--------------------------------------------------------------------- 
     68      REAL(wp) :: zchk_v_i, zchk_smv, zchk_fs, zchk_fw, zchk_v_i_b, zchk_smv_b, zchk_fs_b, zchk_fw_b ! Check conservation (C Rousset) 
     69      REAL(wp) :: zchk_vmin, zchk_amin, zchk_amax ! Check errors (C Rousset) 
     70     !!--------------------------------------------------------------------- 
     71 
     72      IF( nn_timing == 1 )  CALL timing_start('limdyn') 
    6873 
    6974      CALL wrk_alloc( jpi, jpj, zu_io, zv_io ) 
    7075      CALL wrk_alloc( jpj, zind, zmsk ) 
     76 
     77      ! ------------------------------- 
     78      !- check conservation (C Rousset) 
     79      IF (ln_limdiahsb) THEN 
     80         zchk_v_i_b = glob_sum( SUM(   v_i(:,:,:), dim=3 ) * area(:,:) * tms(:,:) ) 
     81         zchk_smv_b = glob_sum( SUM( smv_i(:,:,:), dim=3 ) * area(:,:) * tms(:,:) ) 
     82         zchk_fw_b  = glob_sum( rdm_ice(:,:) * area(:,:) * tms(:,:) ) 
     83         zchk_fs_b  = glob_sum( ( sfx_bri(:,:) + sfx_thd(:,:) + sfx_res(:,:) + sfx_mec(:,:) ) * area(:,:) * tms(:,:) ) 
     84      ENDIF 
     85      !- check conservation (C Rousset) 
     86      ! ------------------------------- 
    7187 
    7288      IF( kt == nit000 )   CALL lim_dyn_init   ! Initialization (first time-step only) 
     
    208224      ENDIF 
    209225      ! 
     226      ! ------------------------------- 
     227      !- check conservation (C Rousset) 
     228      IF (ln_limdiahsb) THEN 
     229         zchk_fs  = glob_sum( ( sfx_bri(:,:) + sfx_thd(:,:) + sfx_res(:,:) + sfx_mec(:,:) ) * area(:,:) * tms(:,:) ) - zchk_fs_b 
     230         zchk_fw  = glob_sum( rdm_ice(:,:) * area(:,:) * tms(:,:) ) - zchk_fw_b 
     231  
     232         zchk_v_i = ( glob_sum( SUM(   v_i(:,:,:), dim=3 ) * area(:,:) * tms(:,:) ) - zchk_v_i_b - ( zchk_fw / rhoic ) ) / rdt_ice 
     233         zchk_smv = ( glob_sum( SUM( smv_i(:,:,:), dim=3 ) * area(:,:) * tms(:,:) ) - zchk_smv_b ) / rdt_ice + ( zchk_fs / rhoic ) 
     234 
     235         zchk_vmin = glob_min(v_i) 
     236         zchk_amax = glob_max(SUM(a_i,dim=3)) 
     237         zchk_amin = glob_min(a_i) 
     238 
     239         IF(lwp) THEN 
     240            IF ( ABS( zchk_v_i   ) >  1.e-5 ) WRITE(numout,*) 'violation volume [m3/day]     (limdyn) = ',(zchk_v_i * rday) 
     241            IF ( ABS( zchk_smv   ) >  1.e-4 ) WRITE(numout,*) 'violation saline [psu*m3/day] (limdyn) = ',(zchk_smv * rday) 
     242            IF ( zchk_vmin <  0.            ) WRITE(numout,*) 'violation v_i<0  [mm]         (limdyn) = ',(zchk_vmin * 1.e-3) 
     243            !IF ( zchk_amax >  amax+1.e-10   ) WRITE(numout,*) 'violation a_i>amax            (limdyn) = ',zchk_amax 
     244            IF ( zchk_amin <  0.            ) WRITE(numout,*) 'violation a_i<0               (limdyn) = ',zchk_amin 
     245         ENDIF 
     246      ENDIF 
     247      !- check conservation (C Rousset) 
     248      ! ------------------------------- 
     249 
    210250      CALL wrk_dealloc( jpi, jpj, zu_io, zv_io ) 
    211251      CALL wrk_dealloc( jpj, zind, zmsk ) 
    212252      ! 
     253      IF( nn_timing == 1 )  CALL timing_stop('limdyn') 
     254 
    213255   END SUBROUTINE lim_dyn 
    214256 
     
    230272         &                dm, nbiter, nbitdr, om, resl, cw, angvg, pstar,   & 
    231273         &                c_rhg, etamn, creepl, ecc, ahi0, & 
    232          &                nevp, telast, alphaevp 
     274         &                nevp, telast, alphaevp, hminrhg 
    233275      !!------------------------------------------------------------------- 
    234276 
     
    264306         WRITE(numout,*) '   timescale for elastic waves                      telast = ', telast 
    265307         WRITE(numout,*) '   coefficient for the solution of int. stresses  alphaevp = ', alphaevp 
     308         WRITE(numout,*) '   min ice thickness for rheology calculations     hminrhg = ', hminrhg 
    266309      ENDIF 
    267310      ! 
Note: See TracChangeset for help on using the changeset viewer.