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

Ignore:
Timestamp:
2017-09-08T18:19:17+02:00 (7 years ago)
Author:
clem
Message:

changes in style - part5 - very nearly finished

File:
1 edited

Legend:

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

    r8514 r8515  
    285285      !                                ! Initial sea-ice state 
    286286      IF( .NOT. ln_rstart ) THEN              ! start from rest: sea-ice deduced from sst 
     287         CALL ice_istate_init 
    287288         CALL ice_istate 
    288289      ELSE                                    ! start from a restart file 
     
    301302      tn_ice(:,:,:) = t_su(:,:,:)       ! initialisation of surface temp for coupled simu 
    302303      ! 
    303       DO jj = 1, jpj 
    304          DO ji = 1, jpi 
    305             IF( gphit(ji,jj) > 0._wp ) THEN   ;   rn_amax_2d(ji,jj) = rn_amax_n  ! NH 
    306             ELSE                              ;   rn_amax_2d(ji,jj) = rn_amax_s  ! SH 
    307             ENDIF 
    308          END DO 
    309       END DO 
     304      WHERE( gphit(:,:) > 0._wp )   ;   rn_amax_2d(:,:) = rn_amax_n  ! NH 
     305      ELSEWHERE                     ;   rn_amax_2d(:,:) = rn_amax_s  ! SH 
     306      END WHERE 
    310307      ! 
    311308   END SUBROUTINE ice_init 
     
    381378      !!---------------------------------------------------------------------- 
    382379      ! 
    383       DO jl = 1, jpl 
    384          DO jj = 2, jpjm1 
    385             DO ji = 2, jpim1 
    386                a_i_b  (ji,jj,jl)   = a_i  (ji,jj,jl)     ! ice area 
    387                v_i_b  (ji,jj,jl)   = v_i  (ji,jj,jl)     ! ice volume 
    388                v_s_b  (ji,jj,jl)   = v_s  (ji,jj,jl)     ! snow volume 
    389                smv_i_b(ji,jj,jl)   = smv_i(ji,jj,jl)     ! salt content 
    390                oa_i_b (ji,jj,jl)   = oa_i (ji,jj,jl)     ! areal age content 
    391                e_s_b  (ji,jj,:,jl) = e_s  (ji,jj,:,jl)   ! snow thermal energy 
    392                e_i_b  (ji,jj,:,jl) = e_i  (ji,jj,:,jl)   ! ice thermal energy 
    393                !                                         ! ice thickness 
    394                rswitch = MAX( 0._wp , SIGN( 1._wp, a_i_b(ji,jj,jl) - epsi20 ) ) ! 0 if no ice and 1 if yes 
    395                ht_i_b(ji,jj,jl) = v_i_b (ji,jj,jl) / MAX( a_i_b(ji,jj,jl) , epsi20 ) * rswitch 
    396                ht_s_b(ji,jj,jl) = v_s_b (ji,jj,jl) / MAX( a_i_b(ji,jj,jl) , epsi20 ) * rswitch 
    397             END DO 
    398          END DO    
    399       END DO 
    400       CALL lbc_lnk_multi(  a_i_b, 'T', 1., v_i_b , 'T', 1., ht_i_b, 'T', 1., smv_i_b, 'T', 1.,   & 
    401          &                oa_i_b, 'T', 1., v_s_b , 'T', 1., ht_s_b, 'T', 1. ) 
    402       CALL lbc_lnk( e_i_b, 'T', 1. ) 
    403       CALL lbc_lnk( e_s_b, 'T', 1. ) 
     380      a_i_b  (:,:,:)   = a_i  (:,:,:)     ! ice area 
     381      v_i_b  (:,:,:)   = v_i  (:,:,:)     ! ice volume 
     382      v_s_b  (:,:,:)   = v_s  (:,:,:)     ! snow volume 
     383      smv_i_b(:,:,:)   = smv_i(:,:,:)     ! salt content 
     384      oa_i_b (:,:,:)   = oa_i (:,:,:)     ! areal age content 
     385      e_s_b  (:,:,:,:) = e_s  (:,:,:,:)   ! snow thermal energy 
     386      e_i_b  (:,:,:,:) = e_i  (:,:,:,:)   ! ice thermal energy 
     387      WHERE( a_i_b(:,:,:) >= epsi20 ) 
     388         ht_i_b(:,:,:) = v_i_b (:,:,:) / a_i_b(:,:,:)   ! ice thickness 
     389         ht_s_b(:,:,:) = v_s_b (:,:,:) / a_i_b(:,:,:)   ! snw thickness 
     390      ELSEWHERE 
     391         ht_i_b(:,:,:) = 0._wp 
     392         ht_s_b(:,:,:) = 0._wp 
     393      END WHERE 
    404394       
    405 !!gm Question:  here , a_i_b, u_ice and v_ice  are defined over the whole domain,  
    406 !!gm            so why not just a copy over the whole domain and no lbc_lnk ? 
    407 !!gm            that is some thing like: 
    408 !            at_i_b(:,:)  = SUM( a_i_b(:,:,:), dim=3 ) 
    409 !            u_ice_b(:,:) = u_ice(:,:) 
    410 !            v_ice_b(:,:) = v_ice(:,:) 
    411 !    idem for the loop above 
    412 !!gm 
    413395      ! ice velocities & total concentration 
    414       DO jj = 2, jpjm1 
    415          DO ji = 2, jpim1 
    416             at_i_b(ji,jj)  = SUM( a_i_b(ji,jj,:) ) 
    417             u_ice_b(ji,jj) = u_ice(ji,jj) 
    418             v_ice_b(ji,jj) = v_ice(ji,jj) 
    419          END DO 
    420       END DO 
    421       CALL lbc_lnk_multi( at_i_b, 'T', 1., u_ice_b , 'U', -1., v_ice_b , 'V', -1. ) 
     396      at_i_b(:,:)  = SUM( a_i_b(:,:,:), dim=3 ) 
     397      u_ice_b(:,:) = u_ice(:,:) 
     398      v_ice_b(:,:) = v_ice(:,:) 
    422399      ! 
    423400   END SUBROUTINE store_fields 
     
    433410      INTEGER  ::   ji, jj      ! dummy loop index 
    434411      !!---------------------------------------------------------------------- 
    435       DO jj = 1, jpj 
    436          DO ji = 1, jpi 
    437             sfx    (ji,jj) = 0._wp   ; 
    438             sfx_bri(ji,jj) = 0._wp   ;   sfx_lam(ji,jj) = 0._wp 
    439             sfx_sni(ji,jj) = 0._wp   ;   sfx_opw(ji,jj) = 0._wp 
    440             sfx_bog(ji,jj) = 0._wp   ;   sfx_dyn(ji,jj) = 0._wp 
    441             sfx_bom(ji,jj) = 0._wp   ;   sfx_sum(ji,jj) = 0._wp 
    442             sfx_res(ji,jj) = 0._wp   ;   sfx_sub(ji,jj) = 0._wp 
    443             ! 
    444             wfx_snw(ji,jj) = 0._wp   ;   wfx_ice(ji,jj) = 0._wp 
    445             wfx_sni(ji,jj) = 0._wp   ;   wfx_opw(ji,jj) = 0._wp 
    446             wfx_bog(ji,jj) = 0._wp   ;   wfx_dyn(ji,jj) = 0._wp 
    447             wfx_bom(ji,jj) = 0._wp   ;   wfx_sum(ji,jj) = 0._wp 
    448             wfx_res(ji,jj) = 0._wp   ;   wfx_sub(ji,jj) = 0._wp 
    449             wfx_spr(ji,jj) = 0._wp   ;   wfx_lam(ji,jj) = 0._wp   
    450             wfx_snw_dyn(ji,jj) = 0._wp ; wfx_snw_sum(ji,jj) = 0._wp 
    451             wfx_snw_sub(ji,jj) = 0._wp ; wfx_ice_sub(ji,jj) = 0._wp 
    452             wfx_snw_sni(ji,jj) = 0._wp  
    453             ! MV MP 2016 
    454             wfx_pnd(ji,jj) = 0._wp 
    455             ! END MV MP 2016 
    456              
    457             hfx_thd(ji,jj) = 0._wp   ; 
    458             hfx_snw(ji,jj) = 0._wp   ;   hfx_opw(ji,jj) = 0._wp 
    459             hfx_bog(ji,jj) = 0._wp   ;   hfx_dyn(ji,jj) = 0._wp 
    460             hfx_bom(ji,jj) = 0._wp   ;   hfx_sum(ji,jj) = 0._wp 
    461             hfx_res(ji,jj) = 0._wp   ;   hfx_sub(ji,jj) = 0._wp 
    462             hfx_spr(ji,jj) = 0._wp   ;   hfx_dif(ji,jj) = 0._wp 
    463             hfx_err(ji,jj) = 0._wp   ;   hfx_err_rem(ji,jj) = 0._wp 
    464             hfx_err_dif(ji,jj) = 0._wp 
    465             wfx_err_sub(ji,jj) = 0._wp 
    466             ! 
    467             afx_tot(ji,jj) = 0._wp   ; 
    468             ! 
    469             diag_heat(ji,jj) = 0._wp ;   diag_smvi(ji,jj) = 0._wp 
    470             diag_vice(ji,jj) = 0._wp ;   diag_vsnw(ji,jj) = 0._wp 
    471              
    472             ! SIMIP diagnostics 
    473             diag_fc_bo(ji,jj)    = 0._wp ; diag_fc_su(ji,jj)    = 0._wp 
    474              
    475             tau_icebfr(ji,jj) = 0._wp; ! landfast ice param only (clem: important to keep the init here) 
    476          END DO 
    477       END DO 
     412      sfx    (:,:) = 0._wp   ; 
     413      sfx_bri(:,:) = 0._wp   ;   sfx_lam(:,:) = 0._wp 
     414      sfx_sni(:,:) = 0._wp   ;   sfx_opw(:,:) = 0._wp 
     415      sfx_bog(:,:) = 0._wp   ;   sfx_dyn(:,:) = 0._wp 
     416      sfx_bom(:,:) = 0._wp   ;   sfx_sum(:,:) = 0._wp 
     417      sfx_res(:,:) = 0._wp   ;   sfx_sub(:,:) = 0._wp 
     418      ! 
     419      wfx_snw(:,:) = 0._wp   ;   wfx_ice(:,:) = 0._wp 
     420      wfx_sni(:,:) = 0._wp   ;   wfx_opw(:,:) = 0._wp 
     421      wfx_bog(:,:) = 0._wp   ;   wfx_dyn(:,:) = 0._wp 
     422      wfx_bom(:,:) = 0._wp   ;   wfx_sum(:,:) = 0._wp 
     423      wfx_res(:,:) = 0._wp   ;   wfx_sub(:,:) = 0._wp 
     424      wfx_spr(:,:) = 0._wp   ;   wfx_lam(:,:) = 0._wp   
     425      wfx_snw_dyn(:,:) = 0._wp ; wfx_snw_sum(:,:) = 0._wp 
     426      wfx_snw_sub(:,:) = 0._wp ; wfx_ice_sub(:,:) = 0._wp 
     427      wfx_snw_sni(:,:) = 0._wp  
     428      ! MV MP 2016 
     429      wfx_pnd(:,:) = 0._wp 
     430      ! END MV MP 2016 
     431 
     432      hfx_thd(:,:) = 0._wp   ; 
     433      hfx_snw(:,:) = 0._wp   ;   hfx_opw(:,:) = 0._wp 
     434      hfx_bog(:,:) = 0._wp   ;   hfx_dyn(:,:) = 0._wp 
     435      hfx_bom(:,:) = 0._wp   ;   hfx_sum(:,:) = 0._wp 
     436      hfx_res(:,:) = 0._wp   ;   hfx_sub(:,:) = 0._wp 
     437      hfx_spr(:,:) = 0._wp   ;   hfx_dif(:,:) = 0._wp 
     438      hfx_err(:,:) = 0._wp   ;   hfx_err_rem(:,:) = 0._wp 
     439      hfx_err_dif(:,:) = 0._wp 
     440      wfx_err_sub(:,:) = 0._wp 
     441      ! 
     442      afx_tot(:,:) = 0._wp   ; 
     443      ! 
     444      diag_heat(:,:) = 0._wp ;   diag_smvi(:,:) = 0._wp 
     445      diag_vice(:,:) = 0._wp ;   diag_vsnw(:,:) = 0._wp 
     446 
     447      ! SIMIP diagnostics 
     448      diag_fc_bo(:,:)    = 0._wp ; diag_fc_su(:,:)    = 0._wp 
     449 
     450      tau_icebfr(:,:) = 0._wp; ! landfast ice param only (clem: important to keep the init here) 
    478451       
    479452   END SUBROUTINE ice_diag0 
Note: See TracChangeset for help on using the changeset viewer.