Changeset 11536 for NEMO/trunk/src/ICE/icecor.F90
- Timestamp:
- 2019-09-11T15:54:18+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/ICE/icecor.F90
r10994 r11536 17 17 USE phycst ! physical constants 18 18 USE ice ! sea-ice: variable 19 USE ice1D ! sea-ice: thermodynamic sea-icevariables19 USE ice1D ! sea-ice: thermodynamic variables 20 20 USE iceitd ! sea-ice: rebining 21 21 USE icevar ! sea-ice: operations … … 60 60 IF( ln_timing ) CALL timing_start('icecor') ! timing 61 61 IF( ln_icediachk ) CALL ice_cons_hsm(0, 'icecor', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation 62 IF( ln_icediachk ) CALL ice_cons2D (0, 'icecor', diag_v, diag_s, diag_t, diag_fv, diag_fs, diag_ft) ! conservation 62 63 ! 63 64 IF( kt == nit000 .AND. lwp .AND. kn == 2 ) THEN … … 78 79 ! !----------------------------------------------------- 79 80 at_i(:,:) = SUM( a_i(:,:,:), dim=3 ) 80 DO jl 81 DO jl = 1, jpl 81 82 WHERE( at_i(:,:) > rn_amax_2d(:,:) ) a_i(:,:,jl) = a_i(:,:,jl) * rn_amax_2d(:,:) / at_i(:,:) 82 83 END DO … … 84 85 ! !----------------------------------------------------- 85 86 IF ( nn_icesal == 2 ) THEN ! salinity must stay in bounds [Simin,Simax] ! 86 !!-----------------------------------------------------87 ! !----------------------------------------------------- 87 88 zzc = rhoi * r1_rdtice 88 89 DO jl = 1, jpl … … 117 118 END DO 118 119 END DO 119 CALL lbc_lnk_multi( 'icecor', u_ice, 'U', -1., v_ice, 'V', -1. ) ! lateral boundary conditions120 CALL lbc_lnk_multi( 'icecor', u_ice, 'U', -1., v_ice, 'V', -1. ) 120 121 ENDIF 121 122 122 !!gm I guess the trends are only out on demand123 !! So please, only do this is it exite an iom_use of on a these variables124 !! furthermore, only allocate the diag_ arrays in this case125 !! and do the iom_put here so that it is only a local allocation126 !!gm127 123 ! !----------------------------------------------------- 128 124 SELECT CASE( kn ) ! Diagnostics ! … … 130 126 CASE( 1 ) !--- dyn trend diagnostics 131 127 ! 132 !!gm here I think the number of ice cat is too small to use a SUM instruction... 133 DO jj = 1, jpj 134 DO ji = 1, jpi 135 ! ! heat content variation (W.m-2) 136 diag_heat(ji,jj) = - ( SUM( e_i(ji,jj,1:nlay_i,:) - e_i_b(ji,jj,1:nlay_i,:) ) & 137 & + SUM( e_s(ji,jj,1:nlay_s,:) - e_s_b(ji,jj,1:nlay_s,:) ) ) * r1_rdtice 138 ! ! salt, volume 139 diag_sice(ji,jj) = SUM( sv_i(ji,jj,:) - sv_i_b(ji,jj,:) ) * rhoi * r1_rdtice 140 diag_vice(ji,jj) = SUM( v_i (ji,jj,:) - v_i_b (ji,jj,:) ) * rhoi * r1_rdtice 141 diag_vsnw(ji,jj) = SUM( v_s (ji,jj,:) - v_s_b (ji,jj,:) ) * rhos * r1_rdtice 142 END DO 143 END DO 128 IF( ln_icediachk .OR. iom_use('hfxdhc') ) THEN 129 diag_heat(:,:) = - SUM(SUM( e_i (:,:,1:nlay_i,:) - e_i_b (:,:,1:nlay_i,:), dim=4 ), dim=3 ) * r1_rdtice & ! W.m-2 130 & - SUM(SUM( e_s (:,:,1:nlay_s,:) - e_s_b (:,:,1:nlay_s,:), dim=4 ), dim=3 ) * r1_rdtice 131 diag_sice(:,:) = SUM( sv_i(:,:,:) - sv_i_b(:,:,:) , dim=3 ) * r1_rdtice * rhoi 132 diag_vice(:,:) = SUM( v_i (:,:,:) - v_i_b (:,:,:) , dim=3 ) * r1_rdtice * rhoi 133 diag_vsnw(:,:) = SUM( v_s (:,:,:) - v_s_b (:,:,:) , dim=3 ) * r1_rdtice * rhos 134 ENDIF 144 135 ! ! concentration tendency (dynamics) 145 zafx (:,:) = SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice 146 afx_tot(:,:) = zafx(:,:) 147 IF( iom_use('afxdyn') ) CALL iom_put( 'afxdyn' , zafx(:,:) ) 136 IF( iom_use('afxdyn') .OR. iom_use('afxthd') .OR. iom_use('afxtot') ) THEN 137 zafx(:,:) = SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice 138 CALL iom_put( 'afxdyn' , zafx ) 139 ENDIF 148 140 ! 149 141 CASE( 2 ) !--- thermo trend diagnostics & ice aging … … 151 143 oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rdt_ice ! ice natural aging incrementation 152 144 ! 153 !!gm here I think the number of ice cat is too small to use a SUM instruction... 154 DO jj = 1, jpj155 DO ji = 1, jpi156 ! ! heat content variation (W.m-2)157 diag_heat(ji,jj) = diag_heat(ji,jj) - ( SUM( e_i(ji,jj,1:nlay_i,:) - e_i_b(ji,jj,1:nlay_i,:) ) &158 & + SUM( e_s(ji,jj,1:nlay_s,:) - e_s_b(ji,jj,1:nlay_s,:) ) ) * r1_rdtice159 ! ! salt, volume160 diag_sice(ji,jj) = diag_sice(ji,jj) + SUM( sv_i(ji,jj,:) - sv_i_b(ji,jj,:) ) * rhoi * r1_rdtice161 diag_vice(ji,jj) = diag_vice(ji,jj) + SUM( v_i (ji,jj,:) - v_i_b (ji,jj,:) ) * rhoi * r1_rdtice162 diag_vsnw(ji,jj) = diag_vsnw(ji,jj) + SUM( v_s (ji,jj,:) - v_s_b (ji,jj,:) ) * rhos * r1_rdtice163 END DO164 END DO145 IF( ln_icediachk .OR. iom_use('hfxdhc') ) THEN 146 diag_heat(:,:) = diag_heat(:,:) & 147 & - SUM(SUM( e_i (:,:,1:nlay_i,:) - e_i_b (:,:,1:nlay_i,:), dim=4 ), dim=3 ) * r1_rdtice & 148 & - SUM(SUM( e_s (:,:,1:nlay_s,:) - e_s_b (:,:,1:nlay_s,:), dim=4 ), dim=3 ) * r1_rdtice 149 diag_sice(:,:) = diag_sice(:,:) & 150 & + SUM( sv_i(:,:,:) - sv_i_b(:,:,:) , dim=3 ) * r1_rdtice * rhoi 151 diag_vice(:,:) = diag_vice(:,:) & 152 & + SUM( v_i (:,:,:) - v_i_b (:,:,:) , dim=3 ) * r1_rdtice * rhoi 153 diag_vsnw(:,:) = diag_vsnw(:,:) & 154 & + SUM( v_s (:,:,:) - v_s_b (:,:,:) , dim=3 ) * r1_rdtice * rhos 155 CALL iom_put ( 'hfxdhc' , diag_heat ) 156 ENDIF 165 157 ! ! concentration tendency (total + thermo) 166 zafx (:,:) = SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice 167 afx_tot(:,:) = afx_tot(:,:) + zafx(:,:) 168 IF( iom_use('afxthd') ) CALL iom_put( 'afxthd' , zafx(:,:) ) 169 IF( iom_use('afxtot') ) CALL iom_put( 'afxtot' , afx_tot(:,:) ) 158 IF( iom_use('afxdyn') .OR. iom_use('afxthd') .OR. iom_use('afxtot') ) THEN 159 zafx(:,:) = zafx(:,:) + SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice 160 CALL iom_put( 'afxthd' , SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice ) 161 CALL iom_put( 'afxtot' , zafx ) 162 ENDIF 170 163 ! 171 164 END SELECT 172 165 ! 173 166 ! controls 174 IF( ln_icediachk ) CALL ice_cons_hsm(1, 'icecor', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation 175 IF( ln_ctl ) CALL ice_prt3D ('icecor') ! prints 176 IF( ln_icectl .AND. kn == 2 ) CALL ice_prt( kt, iiceprt, jiceprt, 2, ' - Final state - ' ) ! prints 177 IF( ln_timing ) CALL timing_stop ('icecor') ! timing 167 IF( ln_ctl ) CALL ice_prt3D ('icecor') ! prints 168 IF( ln_icectl .AND. kn == 2 ) & 169 & CALL ice_prt ( kt, iiceprt, jiceprt, 2, ' - Final state - ' ) ! prints 170 IF( ln_icediachk ) CALL ice_cons_hsm(1, 'icecor', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation 171 IF( ln_icediachk ) CALL ice_cons2D (1, 'icecor', diag_v, diag_s, diag_t, diag_fv, diag_fs, diag_ft) ! conservation 172 IF( ln_timing ) CALL timing_stop ('icecor') ! timing 178 173 ! 179 174 END SUBROUTINE ice_cor
Note: See TracChangeset
for help on using the changeset viewer.