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 8534 for branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/icethd_zdf.F90 – NEMO

Ignore:
Timestamp:
2017-09-18T16:54:04+02:00 (7 years ago)
Author:
clem
Message:

changes in style - part6 - pure cosmetics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/icethd_zdf.F90

    r8531 r8534  
    22   !!====================================================================== 
    33   !!                       ***  MODULE icethd_zdf *** 
    4    !!                       heat diffusion in sea ice  
    5    !!                   computation of surface and inner T   
     4   !!   sea-ice: vertical heat diffusion in sea ice (computation of temperatures)  
    65   !!====================================================================== 
    76   !! History :  LIM  ! 02-2003 (M. Vancoppenolle) original 1D code 
     
    1413#if defined key_lim3 
    1514   !!---------------------------------------------------------------------- 
    16    !!   'key_lim3'                                      LIM3 sea-ice model 
     15   !!   'key_lim3'                                       ESIM sea-ice model 
    1716   !!---------------------------------------------------------------------- 
    18    USE par_oce        ! ocean parameters 
     17   USE dom_oce        ! ocean space and time domain 
    1918   USE phycst         ! physical constants (ocean directory)  
    2019   USE ice            ! sea-ice: variables 
    21    USE ice1D          ! sea-ice: thermodynamics 
     20   USE ice1D          ! sea-ice: thermodynamics variables 
    2221   ! 
    2322   USE in_out_manager ! I/O manager 
    2423   USE lib_mpp        ! MPP library 
    25    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)   
     24   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero) 
    2625 
    2726   IMPLICIT NONE 
    2827   PRIVATE 
    2928 
    30    PUBLIC   ice_thd_zdf        ! called by ice_thd 
    31    PUBLIC   ice_thd_zdf_init   ! called by ice_stp 
     29   PUBLIC   ice_thd_zdf        ! called by icethd 
     30   PUBLIC   ice_thd_zdf_init   ! called by icestp 
    3231 
    3332   !!** namelist (namthd_zdf) ** 
     
    4746 
    4847   SUBROUTINE ice_thd_zdf 
    49       !!------------------------------------------------------------------ 
     48      !!------------------------------------------------------------------- 
    5049      !!                ***  ROUTINE ice_thd_zdf  *** 
    5150      !! ** Purpose : 
     
    6362      !! 
    6463      !!           The successive steps of this routine are 
    65       !!           1.  Thermal conductivity at the interfaces of the ice layers 
    66       !!           2.  Internal absorbed radiation 
    67       !!           3.  Scale factors due to non-uniform grid 
     64      !!           1.  initialization of ice-snow layers thicknesses 
     65      !!           2.  Internal absorbed and transmitted radiation 
     66      !!           Then iterative procedure begins 
     67      !!           3.  Thermal conductivity 
    6868      !!           4.  Kappa factors 
    69       !!           Then iterative procedure begins 
    7069      !!           5.  specific heat in the ice 
    7170      !!           6.  eta factors 
     
    7574      !!           Iterative procedure ends according to a criterion on evolution 
    7675      !!           of temperature 
     76      !!           10. Fluxes at the interfaces 
    7777      !! 
    7878      !! ** Inputs / Ouputs : (global commons) 
     
    8282      !!           number of layers in the ice/snow: nlay_i, nlay_s 
    8383      !!           total ice/snow thickness : ht_i_1d, ht_s_1d 
    84       !!------------------------------------------------------------------ 
     84      !!------------------------------------------------------------------- 
    8585      INTEGER ::   ji, jk         ! spatial loop index 
    8686      INTEGER ::   numeq          ! current reference number of equation 
     
    149149      END DO 
    150150 
    151       !------------------------------------------------------------------------------! 
    152       ! 1) Initialization                                                            ! 
    153       !------------------------------------------------------------------------------! 
     151      !------------------ 
     152      ! 1) Initialization 
     153      !------------------ 
    154154      DO ji = 1, nidx 
    155155         isnow(ji)= 1._wp - MAX( 0._wp , SIGN(1._wp, - ht_s_1d(ji) ) )  ! is there snow or not 
     
    173173      t_su_1d(1:nidx)   = MIN( t_su_1d(1:nidx), rt0 - ztsu_err )   ! necessary 
    174174      ! 
    175       !------------------------------------------------------------------------------| 
    176       ! 2) Radiation                                                              | 
    177       !------------------------------------------------------------------------------| 
     175      !------------- 
     176      ! 2) Radiation 
     177      !------------- 
    178178      ! 
    179179      z1_hsu = 1._wp / 0.1_wp ! threshold for the computation of i0 
    180180      DO ji = 1, nidx 
    181          !------------------- 
    182          ! Computation of i0 
    183          !------------------- 
     181         ! --- Computation of i0 --- ! 
    184182         ! i0 describes the fraction of solar radiation which does not contribute 
    185183         ! to the surface energy budget but rather penetrates inside the ice. 
     
    193191         i0(ji) = ( 1._wp - isnow(ji) ) * ( fr1_i0_1d(ji) + zfac * fr2_i0_1d(ji) ) 
    194192 
    195          !------------------------------------------------------- 
    196          ! Solar radiation absorbed / transmitted at the surface 
    197          ! Derivative of the non solar flux 
    198          !------------------------------------------------------- 
     193         ! --- Solar radiation absorbed / transmitted at the surface --- ! 
     194         !     Derivative of the non solar flux 
    199195         zfsw   (ji)     =  qsr_ice_1d(ji) * ( 1 - i0(ji) )   ! Shortwave radiation absorbed at surface 
    200196         zftrice(ji)     =  qsr_ice_1d(ji) *       i0(ji)     ! Solar radiation transmitted below the surface layer 
     
    203199      END DO 
    204200 
    205       !--------------------------------------------------------- 
    206       ! Transmission - absorption of solar radiation in the ice 
    207       !--------------------------------------------------------- 
     201      ! --- Transmission/absorption of solar radiation in the ice --- ! 
    208202      zradtr_s(1:nidx,0) = zftrice(1:nidx) 
    209203      DO jk = 1, nlay_s 
     
    227221 
    228222      ftr_ice_1d(1:nidx) = zradtr_i(1:nidx,nlay_i)   ! record radiation transmitted below the ice 
    229  
    230       !------------------------------------------------------------------------------| 
    231       !  3) Iterative procedure begins                                               | 
    232       !------------------------------------------------------------------------------| 
    233223      ! 
    234224      iconv    =  0          ! number of iterations 
    235225      zdti_max =  1000._wp   ! maximal value of error on all points 
    236       DO WHILE ( zdti_max > zdti_bnd .AND. iconv < iconv_max ) 
     226      !                                                          !----------------------------! 
     227      DO WHILE ( zdti_max > zdti_bnd .AND. iconv < iconv_max )   ! Iterative procedure begins ! 
     228         !                                                       !----------------------------! 
    237229         ! 
    238230         iconv = iconv + 1 
     
    241233         ztsb(1:nidx,:) = t_s_1d(1:nidx,:) 
    242234         ! 
    243          !------------------------------------------------------------------------------| 
    244          ! 4) Sea ice thermal conductivity                                              | 
    245          !------------------------------------------------------------------------------| 
    246          ! 
     235         !-------------------------------- 
     236         ! 3) Sea ice thermal conductivity 
     237         !-------------------------------- 
    247238         IF( ln_cndi_U64 ) THEN         !-- Untersteiner (1964) formula: k = k0 + beta.S/T 
    248239            ! 
     
    277268         ztcond_i(1:nidx,:) = MAX( zkimin, ztcond_i(1:nidx,:) )         
    278269         ! 
    279          !------------------------------------------------------------------------------| 
    280          !  5) G(he) - enhancement of thermal conductivity in mono-category case        | 
    281          !------------------------------------------------------------------------------| 
    282          ! 
     270         !--- G(he) : enhancement of thermal conductivity in mono-category case 
    283271         ! Computation of effective thermal conductivity G(h) 
    284272         ! Used in mono-category case only to simulate an ITD implicitly 
     
    309297         END SELECT 
    310298         ! 
    311          !------------------------------------------------------------------------------| 
    312          !  6) kappa factors                                                            | 
    313          !------------------------------------------------------------------------------| 
    314          ! 
     299         !----------------- 
     300         ! 4) kappa factors 
     301         !----------------- 
    315302         !--- Snow 
    316303         DO jk = 0, nlay_s-1 
     
    338325         END DO 
    339326         ! 
    340          !------------------------------------------------------------------------------| 
    341          ! 7) Sea ice specific heat, eta factors                                        | 
    342          !------------------------------------------------------------------------------| 
    343          ! 
     327         !-------------------------------------- 
     328         ! 5) Sea ice specific heat, eta factors 
     329         !-------------------------------------- 
    344330         DO jk = 1, nlay_i 
    345331            DO ji = 1, nidx 
     
    355341         END DO 
    356342         ! 
    357          !------------------------------------------------------------------------------| 
    358          ! 8) surface flux computation                                                  | 
    359          !------------------------------------------------------------------------------| 
    360          ! 
     343         !---------------------------- 
     344         ! 6) surface flux computation 
     345         !---------------------------- 
    361346         IF ( ln_dqns_i ) THEN  
    362347            DO ji = 1, nidx 
     
    370355         END DO 
    371356         ! 
    372          !------------------------------------------------------------------------------| 
    373          ! 9) tridiagonal system terms                                                  | 
    374          !------------------------------------------------------------------------------| 
    375          ! 
     357         !---------------------------- 
     358         ! 7) tridiagonal system terms 
     359         !---------------------------- 
    376360         !!layer denotes the number of the layer in the snow or in the ice 
    377361         !!numeq denotes the reference number of the equation in the tridiagonal 
     
    414398 
    415399         DO ji = 1, nidx 
    416             IF ( ht_s_1d(ji) > 0.0 ) THEN 
    417                ! 
    418                !------------------------------------------------------------------------------| 
    419                !  snow-covered cells                                                          | 
    420                !------------------------------------------------------------------------------| 
     400            !                               !---------------------! 
     401            IF ( ht_s_1d(ji) > 0.0 ) THEN   !  snow-covered cells ! 
     402               !                            !---------------------! 
    421403               ! 
    422404               !!snow interior terms (bottom equation has the same form as the others) 
     
    435417               ENDIF 
    436418 
    437                IF ( t_su_1d(ji) < rt0 ) THEN 
    438  
    439                   !------------------------------------------------------------------------------| 
    440                   !  case 1 : no surface melting - snow present                                  | 
    441                   !------------------------------------------------------------------------------| 
     419               IF ( t_su_1d(ji) < rt0 ) THEN   !--  case 1 : no surface melting 
     420 
    442421                  numeqmin(ji)    =  1 
    443422                  numeqmax(ji)    =  nlay_i + nlay_s + 1 
     
    455434                  zindterm(ji,2) =  ztsold(ji,1) + zeta_s(ji,1) * zradab_s(ji,1) 
    456435 
    457                ELSE  
    458                   ! 
    459                   !------------------------------------------------------------------------------| 
    460                   !  case 2 : surface is melting - snow present                                  | 
    461                   !------------------------------------------------------------------------------| 
     436               ELSE                            !--  case 2 : surface is melting 
    462437                  ! 
    463438                  numeqmin(ji)    =  2 
     
    471446                     &             ( zradab_s(ji,1) + zkappa_s(ji,0) * zg1s * t_su_1d(ji) )  
    472447               ENDIF 
    473             ELSE 
     448            !                               !---------------------! 
     449            ELSE                            ! cells without snow  ! 
     450               !                            !---------------------! 
    474451               ! 
    475                !------------------------------------------------------------------------------| 
    476                !  cells without snow                                                          | 
    477                !------------------------------------------------------------------------------| 
    478                ! 
    479                IF ( t_su_1d(ji) < rt0 ) THEN 
    480                   ! 
    481                   !------------------------------------------------------------------------------| 
    482                   !  case 3 : no surface melting - no snow                                       | 
    483                   !------------------------------------------------------------------------------| 
     452               IF ( t_su_1d(ji) < rt0 ) THEN   !--  case 1 : no surface melting 
    484453                  ! 
    485454                  numeqmin(ji)      =  nlay_s + 1 
     
    512481                  ENDIF 
    513482 
    514                ELSE 
    515  
    516                   ! 
    517                   !------------------------------------------------------------------------------| 
    518                   ! case 4 : surface is melting - no snow                                        | 
    519                   !------------------------------------------------------------------------------| 
    520                   ! 
     483               ELSE                            !--  case 2 : surface is melting 
     484 
    521485                  numeqmin(ji)    =  nlay_s + 2 
    522486                  numeqmax(ji)    =  nlay_i + nlay_s + 1 
     
    543507         END DO 
    544508         ! 
    545          !------------------------------------------------------------------------------| 
    546          ! 10) tridiagonal system solving                                               | 
    547          !------------------------------------------------------------------------------| 
    548          ! 
     509         !------------------------------ 
     510         ! 8) tridiagonal system solving 
     511         !------------------------------ 
    549512         ! Solve the tridiagonal system with Gauss elimination method. 
    550          ! Thomas algorithm, from Computational fluid Dynamics, J.D. ANDERSON,  
    551          ! McGraw-Hill 1984.   
     513         ! Thomas algorithm, from Computational fluid Dynamics, J.D. ANDERSON, McGraw-Hill 1984.    
    552514 
    553515         maxnumeqmax = 0 
     
    595557         END DO 
    596558         ! 
    597          !-------------------------------------------------------------------------- 
    598          !  11) Has the scheme converged ?, end of the iterative procedure         | 
    599          !-------------------------------------------------------------------------- 
    600          ! 
     559         !-------------------------------------------------------------- 
     560         ! 9) Has the scheme converged ?, end of the iterative procedure 
     561         !-------------------------------------------------------------- 
    601562         ! check that nowhere it has started to melt 
    602563         ! zdti_max is a measure of error, it has to be under zdti_bnd 
     
    632593         WRITE(numout,*) ' iconv    : ', iconv 
    633594      ENDIF 
    634  
    635       ! 
    636       !-------------------------------------------------------------------------! 
    637       !   12) Fluxes at the interfaces                                          ! 
    638       !-------------------------------------------------------------------------! 
     595      ! 
     596      !----------------------------- 
     597      ! 10) Fluxes at the interfaces 
     598      !----------------------------- 
    639599      DO ji = 1, nidx 
    640600         !                                ! surface ice conduction flux 
     
    694654 
    695655   SUBROUTINE ice_thd_enmelt 
    696       !!----------------------------------------------------------------------- 
     656      !!------------------------------------------------------------------- 
    697657      !!                   ***  ROUTINE ice_thd_enmelt ***  
    698658      !!                  
     
    764724      ! 
    765725      IF ( ( ln_cndi_U64 .AND. ln_cndi_P07 ) .OR. ( .NOT.ln_cndi_U64 .AND. .NOT.ln_cndi_P07 ) ) THEN 
    766          CALL ctl_stop( 'ice_thd_zdf_init: choose one and only one formulation for thermal conductivity (ln_cndi_U64 or ln_cndi_P07)' ) 
     726         CALL ctl_stop( 'ice_thd_zdf_init: choose one and only one formulation for thermal conduction (ln_cndi_U64 or ln_cndi_P07)' ) 
    767727      ENDIF 
    768728      ! 
     
    771731#else 
    772732   !!---------------------------------------------------------------------- 
    773    !!                   Dummy Module                 No ESIM sea-ice model 
     733   !!   Default option       Dummy Module             No ESIM sea-ice model 
    774734   !!---------------------------------------------------------------------- 
    775735#endif 
Note: See TracChangeset for help on using the changeset viewer.