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 8813 for branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/LIM_SRC_3/iceistate.F90 – NEMO

Ignore:
Timestamp:
2017-11-24T17:56:51+01:00 (6 years ago)
Author:
gm
Message:

#1911 (ENHANCE-09): PART I.3 - phasing with updated branch dev_r8183_ICEMODEL revision 8787

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/LIM_SRC_3/iceistate.F90

    r8637 r8813  
    4848   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   si  ! structure of input fields (file informations, fields read) 
    4949   ! 
    50    ! ** namelist (namini) ** 
     50   !                             !! ** namelist (namini) ** 
    5151   LOGICAL  ::   ln_iceini        ! initialization or not 
    5252   LOGICAL  ::   ln_iceini_file   ! Ice initialization state from 2D netcdf file 
     
    9191      !!              where there is no ice (clem: I do not know why, is it mandatory?)  
    9292      !!-------------------------------------------------------------------- 
    93       INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices 
     93      INTEGER  ::   ji, jj, jk, jl         ! dummy loop indices 
     94      INTEGER  ::   i_hemis, i_fill, jl0   ! local integers 
    9495      REAL(wp) ::   ztmelts, zdh 
    95       INTEGER  ::   i_hemis, i_fill, jl0 
    9696      REAL(wp) ::   zarg, zV, zconv, zdv, zfac 
    9797      INTEGER , DIMENSION(4)           ::   itest 
     
    100100      REAL(wp), DIMENSION(jpi,jpj)     ::   zht_i_ini, zat_i_ini, zvt_i_ini            !data from namelist or nc file 
    101101      REAL(wp), DIMENSION(jpi,jpj)     ::   zts_u_ini, zht_s_ini, zsm_i_ini, ztm_i_ini !data from namelist or nc file 
    102       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zh_i_ini, za_i_ini                         !data by cattegories to fill 
     102      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zh_i_ini , za_i_ini                        !data by cattegories to fill 
    103103      !-------------------------------------------------------------------- 
    104104 
     
    116116         tn_ice(:,:,jl) = rt0 * tmask(:,:,1) 
    117117      END DO 
    118  
    119       ! init basal temperature (considered at freezing point) 
     118      ! 
     119      ! init basal temperature (considered at freezing point)   [Kelvin] 
    120120      CALL eos_fzp( sss_m(:,:), t_bo(:,:) ) 
    121121      t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1)  
     
    142142            zvt_i_ini(:,:) = zht_i_ini(:,:) * zat_i_ini(:,:) 
    143143            ! 
    144          !                             !---------------! 
     144            !                          !---------------! 
    145145         ELSE                          ! Read namelist ! 
    146146            !                          !---------------! 
    147  
    148            ! no ice if sst <= t-freez + ttest 
    149             WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst ) ; zswitch(:,:) = 0._wp  
    150             ELSEWHERE                                                                  ; zswitch(:,:) = tmask(:,:,1) 
     147            ! no ice if sst <= t-freez + ttest 
     148            WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp  
     149            ELSEWHERE                                                                    ;   zswitch(:,:) = tmask(:,:,1) 
    151150            END WHERE 
    152  
     151            ! 
    153152            ! assign initial thickness, concentration, snow depth and salinity to an hemisphere-dependent array 
    154153            WHERE( ff_t(:,:) >= 0._wp ) 
     
    242241                        ! 
    243242                     ENDIF 
    244  
     243                     ! 
    245244                     ! Compatibility tests 
    246245                     zconv = ABS( zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:jpl) ) )           ! Test 1: area conservation 
    247246                     IF ( zconv < epsi06 ) itest(1) = 1 
    248                       
     247                     ! 
    249248                     zconv = ABS(       zat_i_ini(ji,jj)       * zht_i_ini(ji,jj)   &         ! Test 2: volume conservation 
    250249                        &        - SUM( za_i_ini (ji,jj,1:jpl) * zh_i_ini (ji,jj,1:jpl) ) ) 
    251250                     IF ( zconv < epsi06 ) itest(2) = 1 
    252                       
     251                     ! 
    253252                     IF ( zh_i_ini(ji,jj,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1           ! Test 3: thickness of the last category is in-bounds ? 
    254                       
     253                     ! 
    255254                     itest(4) = 1 
    256255                     DO jl = 1, i_fill 
     
    260259                  END DO                                                        ! end iteration on categories 
    261260                  !                                                             !---------------------------- 
    262                   ! 
    263261                  IF( lwp .AND. SUM(itest) /= 4 ) THEN  
    264262                     WRITE(numout,*) 
     
    270268                     WRITE(numout,*) ' zht_i_ini : ', zht_i_ini(ji,jj) 
    271269                  ENDIF 
    272                 
     270                  ! 
    273271               ENDIF 
    274272               ! 
     
    279277         ! 4) Fill in sea ice arrays 
    280278         !--------------------------------------------------------------------- 
    281  
     279         ! 
    282280         ! Ice concentration, thickness and volume, ice salinity, ice age, surface temperature 
    283281         DO jl = 1, jpl ! loop over categories 
     
    289287                  o_i(ji,jj,jl)  = 0._wp                                                     ! age (0 day) 
    290288                  t_su(ji,jj,jl) = zswitch(ji,jj) * zts_u_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rt0 ! surf temp 
    291  
     289                  ! 
    292290                  IF( zht_i_ini(ji,jj) > 0._wp )THEN 
    293291                    h_s(ji,jj,jl)= h_i(ji,jj,jl) * ( zht_s_ini(ji,jj) / zht_i_ini(ji,jj) )  ! snow depth 
     
    295293                    h_s(ji,jj,jl)= 0._wp 
    296294                  ENDIF 
    297  
     295                  ! 
    298296                  ! This case below should not be used if (h_s/h_i) is ok in namelist 
    299297                  ! In case snow load is in excess that would lead to transformation from snow to ice 
     
    303301                  h_i(ji,jj,jl) = MIN( hi_max(jl), h_i(ji,jj,jl) + zdh ) 
    304302                  h_s(ji,jj,jl) = MAX( 0._wp, h_s(ji,jj,jl) - zdh * rhoic * r1_rhosn ) 
    305  
     303                  ! 
    306304                  ! ice volume, salt content, age content 
    307305                  v_i (ji,jj,jl) = h_i(ji,jj,jl) * a_i(ji,jj,jl)              ! ice volume 
     
    312310            END DO 
    313311         END DO 
    314  
    315          ! for constant salinity in time 
    316          IF( nn_icesal /= 2 )  THEN 
     312         ! 
     313         IF( nn_icesal /= 2 )  THEN         ! for constant salinity in time 
    317314            CALL ice_var_salprof 
    318315            sv_i = s_i * v_i 
    319316         ENDIF 
    320              
     317         !   
    321318         ! Snow temperature and heat content 
    322319         DO jk = 1, nlay_s 
     
    327324                     ! Snow energy of melting 
    328325                     e_s(ji,jj,jk,jl) = zswitch(ji,jj) * rhosn * ( cpic * ( rt0 - t_s(ji,jj,jk,jl) ) + lfus ) 
    329  
     326                     ! 
    330327                     ! Mutliply by volume, and divide by number of layers to get heat content in J/m2 
    331328                     e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * v_s(ji,jj,jl) * r1_nlay_s 
     
    334331            END DO 
    335332         END DO 
    336  
     333         ! 
    337334         ! Ice salinity, temperature and heat content 
    338335         DO jk = 1, nlay_i 
     
    343340                     sz_i(ji,jj,jk,jl) = zswitch(ji,jj) * zsm_i_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rn_simin 
    344341                     ztmelts          = - tmut * sz_i(ji,jj,jk,jl) + rt0 !Melting temperature in K 
    345  
     342                     ! 
    346343                     ! heat content per unit volume 
    347                      e_i(ji,jj,jk,jl) = zswitch(ji,jj) * rhoic * (   cpic    * ( ztmelts - t_i(ji,jj,jk,jl) ) & 
    348                         +   lfus    * ( 1._wp - (ztmelts-rt0) / MIN((t_i(ji,jj,jk,jl)-rt0),-epsi20) ) & 
    349                         -   rcp     * ( ztmelts - rt0 ) ) 
    350  
     344                     e_i(ji,jj,jk,jl) = zswitch(ji,jj) * rhoic * (   cpic    * ( ztmelts - t_i(ji,jj,jk,jl) )         & 
     345                        &             + lfus * ( 1._wp - (ztmelts-rt0) / MIN( (t_i(ji,jj,jk,jl)-rt0) , -epsi20 )  )  & 
     346                        &             - rcp  * ( ztmelts - rt0 ) ) 
     347                     ! 
    351348                     ! Mutliply by ice volume, and divide by number of layers to get heat content in J/m2 
    352349                     e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * v_i(ji,jj,jl) * r1_nlay_i 
     
    355352            END DO 
    356353         END DO 
    357  
     354         ! 
    358355         tn_ice (:,:,:) = t_su (:,:,:) 
    359  
     356         ! 
    360357         ! Melt pond volume and fraction 
    361358         IF ( ln_pnd_CST .OR. ln_pnd_H12 ) THEN   ;   zfac = 1._wp 
     
    368365         a_ip(:,:,:) = a_ip_frac(:,:,:) * a_i (:,:,:)  
    369366         v_ip(:,:,:) = h_ip     (:,:,:) * a_ip(:,:,:) 
    370  
     367         ! 
    371368      ELSE ! if ln_iceini=false 
    372369         a_i  (:,:,:) = 0._wp 
     
    379376         s_i  (:,:,:) = 0._wp 
    380377         o_i  (:,:,:) = 0._wp 
    381  
     378         ! 
    382379         e_i(:,:,:,:) = 0._wp 
    383380         e_s(:,:,:,:) = 0._wp 
    384  
     381         ! 
    385382         DO jl = 1, jpl 
    386383            DO jk = 1, nlay_i 
     
    391388            END DO 
    392389         END DO 
    393  
     390         ! 
    394391         a_ip(:,:,:)      = 0._wp 
    395392         v_ip(:,:,:)      = 0._wp 
    396393         a_ip_frac(:,:,:) = 0._wp 
    397394         h_ip     (:,:,:) = 0._wp 
    398  
     395         ! 
    399396      ENDIF ! ln_iceini 
    400        
     397      ! 
    401398      at_i (:,:) = 0.0_wp 
    402399      DO jl = 1, jpl 
     
    405402      ! 
    406403      ! --- set ice velocities --- ! 
    407       u_ice (:,:)     = 0._wp 
    408       v_ice (:,:)     = 0._wp 
     404      u_ice (:,:) = 0._wp 
     405      v_ice (:,:) = 0._wp 
    409406      ! 
    410407      !---------------------------------------------- 
     
    415412      ! 
    416413      IF( ln_ice_embd ) THEN            ! embedded sea-ice: deplete the initial ssh below sea-ice area 
    417  
     414         ! 
    418415         sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 
    419416         sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 
    420  
     417         ! 
    421418         IF( .NOT.ln_linssh ) THEN 
    422              
     419            ! 
    423420            WHERE( ht_0(:,:) > 0 )   ;   z2d(:,:) = 1._wp + sshn(:,:)*tmask(:,:,1) / ht_0(:,:) 
    424421            ELSEWHERE                ;   z2d(:,:) = 1._wp   ;   END WHERE 
    425           
     422            ! 
    426423            DO jk = 1,jpkm1                     ! adjust initial vertical scale factors                 
    427424               e3t_n(:,:,jk) = e3t_0(:,:,jk) * z2d(:,:) 
     
    429426               e3t_a(:,:,jk) = e3t_n(:,:,jk) 
    430427            END DO 
    431              
     428            ! 
    432429            ! Reconstruction of all vertical scale factors at now and before time-steps 
    433430            ! ========================================================================= 
     
    478475!!      CALL dia_wri_state( 'output.init', nit000 ) 
    479476!!!       
    480  
     477      ! 
    481478   END SUBROUTINE ice_istate 
     479 
    482480 
    483481   SUBROUTINE ice_istate_init 
     
    485483      !!                   ***  ROUTINE ice_istate_init  *** 
    486484      !!         
    487       !! ** Purpose : Definition of initial state of the ice  
    488       !! 
    489       !! ** Method : Read the namini namelist and check the parameter  
    490       !!       values called at the first timestep (nit000) 
    491       !! 
    492       !! ** input :  
    493       !!        Namelist namini 
    494       !! 
    495       !! history : 
    496       !!  8.5  ! 03-08 (C. Ethe) original code  
    497       !!  8.5  ! 07-11 (M. Vancoppenolle) rewritten initialization 
     485      !! ** Purpose :   Definition of initial state of the ice  
     486      !! 
     487      !! ** Method  :   Read the namini namelist and check the parameter  
     488      !!              values called at the first timestep (nit000) 
     489      !! 
     490      !! ** input   :  Namelist namini 
     491      !! 
    498492      !!----------------------------------------------------------------------------- 
    499       ! 
    500       INTEGER :: ios,ierr,inum_ice                 ! Local integer output status for namelist read 
    501       INTEGER :: ji,jj 
    502       INTEGER :: ifpr, ierror 
     493      INTEGER ::   ji, jj 
     494      INTEGER ::   ios, ierr, inum_ice   ! Local integer output status for namelist read 
     495      INTEGER ::   ifpr, ierror 
    503496      ! 
    504497      CHARACTER(len=256) ::  cn_dir          ! Root directory for location of ice files 
     
    515508      READ  ( numnam_ice_ref, namini, IOSTAT = ios, ERR = 901) 
    516509901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namini in reference namelist', lwp ) 
    517  
     510      ! 
    518511      REWIND( numnam_ice_cfg )              ! Namelist namini in configuration namelist : Ice initial state 
    519512      READ  ( numnam_ice_cfg, namini, IOSTAT = ios, ERR = 902 ) 
    520513902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namini in configuration namelist', lwp ) 
    521514      IF(lwm) WRITE ( numoni, namini ) 
    522  
     515      ! 
    523516      slf_i(jp_hti) = sn_hti  ;  slf_i(jp_hts) = sn_hts 
    524517      slf_i(jp_ati) = sn_ati  ;  slf_i(jp_tsu) = sn_tsu 
     
    545538         WRITE(numout,*) '      initial  ice/snw temp  in the south                    rn_tmi_ini_s    = ', rn_tmi_ini_s 
    546539      ENDIF 
    547  
     540      ! 
    548541      IF( ln_iceini_file ) THEN                      ! Ice initialization using input file 
    549542         ! 
     
    553546            CALL ctl_stop( 'Ice_ini in iceistate: unable to allocate si structure' )   ;   RETURN 
    554547         ENDIF 
    555  
     548         ! 
    556549         DO ifpr = 1, jpfldi 
    557550            ALLOCATE( si(ifpr)%fnow(jpi,jpj,1) ) 
    558551            ALLOCATE( si(ifpr)%fdta(jpi,jpj,1,2) ) 
    559552         END DO 
    560  
     553         ! 
    561554         ! fill si with slf_i and control print 
    562555         CALL fld_fill( si, slf_i, cn_dir, 'ice_istate', 'ice istate ini', 'numnam_ice' ) 
    563  
     556         ! 
    564557         CALL fld_read( nit000, 1, si )                ! input fields provided at the current time-step 
    565  
     558         ! 
    566559      ENDIF 
    567  
     560      ! 
    568561   END SUBROUTINE ice_istate_init 
    569562 
Note: See TracChangeset for help on using the changeset viewer.