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 14086 for NEMO/trunk/src/ICE – NEMO

Changeset 14086 for NEMO/trunk/src/ICE


Ignore:
Timestamp:
2020-12-04T12:37:14+01:00 (3 years ago)
Author:
cetlod
Message:

Adding AGRIF branches into the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/ICE/iceistate.F90

    r14072 r14086  
    1818   USE oce            ! dynamics and tracers variables 
    1919   USE dom_oce        ! ocean domain 
    20    USE sbc_oce , ONLY : sst_m, sss_m, ln_ice_embd 
     20   USE sbc_oce , ONLY : sst_m, sss_m, ln_ice_embd  
    2121   USE sbc_ice , ONLY : tn_ice, snwice_mass, snwice_mass_b 
    2222   USE eosbn2         ! equation of state 
     
    3939# if defined key_agrif 
    4040   USE agrif_oce 
    41    USE agrif_ice 
    42    USE agrif_ice_interp 
    43 # endif 
     41   USE agrif_ice_interp  
     42# endif    
    4443 
    4544   IMPLICIT NONE 
     
    9190      !! 
    9291      !! ** Method  :   This routine will put some ice where ocean 
    93       !!                is at the freezing point, then fill in ice 
    94       !!                state variables using prescribed initial 
    95       !!                values in the namelist 
     92      !!                is at the freezing point, then fill in ice  
     93      !!                state variables using prescribed initial  
     94      !!                values in the namelist             
    9695      !! 
    9796      !! ** Steps   :   1) Set initial surface and basal temperatures 
     
    103102      !!              where there is no ice 
    104103      !!-------------------------------------------------------------------- 
    105       INTEGER, INTENT(in) :: kt            ! time step 
     104      INTEGER, INTENT(in) :: kt            ! time step  
    106105      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa ! ocean time level indices 
    107106      ! 
     
    129128      ! basal temperature (considered at freezing point)   [Kelvin] 
    130129      CALL eos_fzp( sss_m(:,:), t_bo(:,:) ) 
    131       t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) 
     130      t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1)  
    132131      ! 
    133132      ! surface temperature and conductivity 
     
    154153      e_i (:,:,:,:) = 0._wp 
    155154      e_s (:,:,:,:) = 0._wp 
    156  
     155       
    157156      ! general fields 
    158157      a_i (:,:,:) = 0._wp 
     
    184183      IF( ln_iceini ) THEN 
    185184         ! 
    186          IF( Agrif_Root() ) THEN 
     185#if defined key_agrif 
     186         IF ( ( Agrif_Root() ).OR.(.NOT.ln_init_chfrpar ) ) THEN 
     187#endif 
    187188            !                             !---------------! 
    188189            IF( nn_iceini_file == 1 )THEN ! Read a file   ! 
     
    229230               IF( TRIM(si(jp_apd)%clrootname) == 'NOT USED' ) & 
    230231                  &     si(jp_apd)%fnow(:,:,1) = ( rn_apd_ini_n * zswitch + rn_apd_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) & ! rn_apd = pond fraction => rn_apnd * a_i = pond conc. 
    231                   &                              * si(jp_ati)%fnow(:,:,1) 
     232                  &                              * si(jp_ati)%fnow(:,:,1)  
    232233               ! 
    233234               ! pond depth 
     
    248249               ! 
    249250               ! change the switch for the following 
    250                WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1) 
     251               WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1)  
    251252               ELSEWHERE                         ;   zswitch(:,:) = 0._wp 
    252253               END WHERE 
     
    256257               !                          !---------------! 
    257258               ! no ice if (sst - Tfreez) >= thresold 
    258                WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp 
     259               WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp  
    259260               ELSEWHERE                                                                    ;   zswitch(:,:) = tmask(:,:,1) 
    260261               END WHERE 
     
    269270                  zt_su_ini(:,:) = rn_tsu_ini_n * zswitch(:,:) 
    270271                  ztm_s_ini(:,:) = rn_tms_ini_n * zswitch(:,:) 
    271                   zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) * zat_i_ini(:,:) ! rn_apd = pond fraction => rn_apd * a_i = pond conc. 
     272                  zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) * zat_i_ini(:,:) ! rn_apd = pond fraction => rn_apd * a_i = pond conc.  
    272273                  zhpnd_ini(:,:) = rn_hpd_ini_n * zswitch(:,:) 
    273274                  zhlid_ini(:,:) = rn_hld_ini_n * zswitch(:,:) 
     
    295296               zhlid_ini(:,:) = 0._wp 
    296297            ENDIF 
    297  
     298             
    298299            IF ( .NOT.ln_pnd_lids ) THEN 
    299300               zhlid_ini(:,:) = 0._wp 
    300301            ENDIF 
    301  
     302             
    302303            !----------------! 
    303304            ! 3) fill fields ! 
     
    323324            CALL tab_2d_1d( npti, nptidx(1:npti), h_ip_1d(1:npti)  , zhpnd_ini ) 
    324325            CALL tab_2d_1d( npti, nptidx(1:npti), h_il_1d(1:npti)  , zhlid_ini ) 
    325  
     326             
    326327            ! allocate temporary arrays 
    327328            ALLOCATE( zhi_2d (npti,jpl), zhs_2d (npti,jpl), zai_2d (npti,jpl), & 
     
    377378            DO jl = 1, jpl 
    378379               DO_3D( 1, 1, 1, 1, 1, nlay_i ) 
    379                   t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl) 
     380                  t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl)  
    380381                  ztmelts          = - rTmlt * sz_i(ji,jj,jk,jl) + rt0 ! melting temperature in K 
    381382                  e_i(ji,jj,jk,jl) = zswitch(ji,jj) * v_i(ji,jj,jl) * r1_nlay_i * & 
     
    385386               END_3D 
    386387            END DO 
    387  
    388 #if  defined key_agrif 
     388            ! 
     389#if defined key_agrif 
    389390         ELSE 
    390  
    391             Agrif_SpecialValue    = -9999. 
    392             Agrif_UseSpecialValue = .TRUE. 
    393             CALL Agrif_init_variable(tra_iceini_id,procname=interp_tra_ice) 
    394             use_sign_north = .TRUE. 
    395             sign_north = -1. 
    396             CALL Agrif_init_variable(u_iceini_id  ,procname=interp_u_ice) 
    397             CALL Agrif_init_variable(v_iceini_id  ,procname=interp_v_ice) 
    398             Agrif_SpecialValue    = 0._wp 
    399             use_sign_north = .FALSE. 
    400             Agrif_UseSpecialValue = .FALSE. 
    401         ! lbc ???? 
    402    ! Here we know : a_i, v_i, v_s, sv_i, oa_i, a_ip, v_ip, v_il, t_su, e_s, e_i 
    403             CALL ice_var_glo2eqv 
    404             CALL ice_var_zapsmall 
    405             CALL ice_var_agg(2) 
     391            CALL  agrif_istate_ice 
     392         ENDIF 
    406393#endif 
    407          ENDIF ! Agrif_Root 
    408          ! 
    409394         ! Melt ponds 
    410395         WHERE( a_i > epsi10 )   ;   a_ip_eff(:,:,:) = a_ip(:,:,:) / a_i(:,:,:) 
     
    413398         v_ip(:,:,:) = h_ip(:,:,:) * a_ip(:,:,:) 
    414399         v_il(:,:,:) = h_il(:,:,:) * a_ip(:,:,:) 
    415  
     400          
    416401         ! specific temperatures for coupled runs 
    417402         tn_ice(:,:,:) = t_su(:,:,:) 
     
    423408            WHERE( at_i(:,:) > rn_amax_2d(:,:) )   a_i(:,:,jl) = a_i(:,:,jl) * rn_amax_2d(:,:) / at_i(:,:) 
    424409         END DO 
    425          at_i(:,:) = SUM( a_i, dim=3 ) 
     410        at_i(:,:) = SUM( a_i, dim=3 ) 
    426411         ! 
    427412      ENDIF ! ln_iceini 
     
    456441      !!------------------------------------------------------------------- 
    457442      !!                   ***  ROUTINE ice_istate_init  *** 
    458       !! 
    459       !! ** Purpose :   Definition of initial state of the ice 
    460       !! 
    461       !! ** Method  :   Read the namini namelist and check the parameter 
     443      !!         
     444      !! ** Purpose :   Definition of initial state of the ice  
     445      !! 
     446      !! ** Method  :   Read the namini namelist and check the parameter  
    462447      !!              values called at the first timestep (nit000) 
    463448      !! 
     
    500485         WRITE(numout,*) '      max ocean temp. above Tfreeze with initial ice   rn_thres_sst   = ', rn_thres_sst 
    501486         IF( ln_iceini .AND. nn_iceini_file == 0 ) THEN 
    502             WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s 
     487            WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s  
    503488            WRITE(numout,*) '      initial ice thickness in the north-south         rn_hti_ini     = ', rn_hti_ini_n,rn_hti_ini_s 
    504489            WRITE(numout,*) '      initial ice concentr  in the north-south         rn_ati_ini     = ', rn_ati_ini_n,rn_ati_ini_s 
Note: See TracChangeset for help on using the changeset viewer.