[8586] | 1 | MODULE icedia |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE icedia *** |
---|
[9604] | 4 | !! Sea-Ice: global budgets |
---|
[8586] | 5 | !!====================================================================== |
---|
[9604] | 6 | !! History : 3.4 ! 2012-10 (C. Rousset) original code |
---|
| 7 | !! 4.0 ! 2018 (many people) SI3 [aka Sea Ice cube] |
---|
[8586] | 8 | !!---------------------------------------------------------------------- |
---|
[9570] | 9 | #if defined key_si3 |
---|
[8586] | 10 | !!---------------------------------------------------------------------- |
---|
[9570] | 11 | !! 'key_si3' SI3 sea-ice model |
---|
[8586] | 12 | !!---------------------------------------------------------------------- |
---|
| 13 | !! ice_dia : diagnostic of the sea-ice global heat content, salt content and volume conservation |
---|
| 14 | !! ice_dia_init : initialization of budget calculation |
---|
| 15 | !! ice_dia_rst : read/write budgets restart |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
| 17 | USE dom_oce ! ocean domain |
---|
| 18 | USE phycst ! physical constant |
---|
| 19 | USE daymod ! model calendar |
---|
| 20 | USE sbc_oce , ONLY : sfx, nn_fsbc ! surface boundary condition: ocean fields |
---|
| 21 | USE ice ! sea-ice: variables |
---|
| 22 | USE icerst ! sea-ice: restart |
---|
| 23 | ! |
---|
| 24 | USE in_out_manager ! I/O manager |
---|
| 25 | USE iom ! I/O manager library |
---|
| 26 | USE lib_mpp ! MPP library |
---|
| 27 | USE lib_fortran ! fortran utilities (glob_sum + no signed zero) |
---|
| 28 | USE timing ! Timing |
---|
| 29 | |
---|
| 30 | IMPLICIT NONE |
---|
| 31 | PRIVATE |
---|
| 32 | |
---|
| 33 | PUBLIC ice_dia ! called by icestp.F90 |
---|
| 34 | PUBLIC ice_dia_init ! called in icestp.F90 |
---|
| 35 | |
---|
[11799] | 36 | REAL(wp), SAVE :: z1_e1e2 ! inverse of the ocean area |
---|
| 37 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: vol_loc_ini, sal_loc_ini, tem_loc_ini ! initial volume, salt and heat contents |
---|
[8586] | 38 | REAL(wp) :: frc_sal, frc_voltop, frc_volbot, frc_temtop, frc_tembot ! global forcing trends |
---|
| 39 | |
---|
| 40 | !! * Substitutions |
---|
| 41 | # include "vectopt_loop_substitute.h90" |
---|
| 42 | !!---------------------------------------------------------------------- |
---|
[9598] | 43 | !! NEMO/ICE 4.0 , NEMO Consortium (2018) |
---|
[10069] | 44 | !! $Id$ |
---|
[10068] | 45 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[8586] | 46 | !!---------------------------------------------------------------------- |
---|
| 47 | CONTAINS |
---|
| 48 | |
---|
| 49 | INTEGER FUNCTION ice_dia_alloc() |
---|
| 50 | !!---------------------------------------------------------------------! |
---|
| 51 | !! *** ROUTINE ice_dia_alloc *** |
---|
| 52 | !!---------------------------------------------------------------------! |
---|
| 53 | ALLOCATE( vol_loc_ini(jpi,jpj), sal_loc_ini(jpi,jpj), tem_loc_ini(jpi,jpj), STAT=ice_dia_alloc ) |
---|
| 54 | |
---|
[10425] | 55 | CALL mpp_sum ( 'icedia', ice_dia_alloc ) |
---|
| 56 | IF( ice_dia_alloc /= 0 ) CALL ctl_stop( 'STOP', 'ice_dia_alloc: failed to allocate arrays' ) |
---|
[8586] | 57 | ! |
---|
| 58 | END FUNCTION ice_dia_alloc |
---|
| 59 | |
---|
| 60 | SUBROUTINE ice_dia( kt ) |
---|
| 61 | !!--------------------------------------------------------------------------- |
---|
| 62 | !! *** ROUTINE ice_dia *** |
---|
| 63 | !! |
---|
| 64 | !! ** Purpose: Compute the sea-ice global heat content, salt content |
---|
| 65 | !! and volume conservation |
---|
| 66 | !!--------------------------------------------------------------------------- |
---|
| 67 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
| 68 | !! |
---|
| 69 | REAL(wp) :: zbg_ivol, zbg_item, zbg_area, zbg_isal |
---|
| 70 | REAL(wp) :: zbg_svol, zbg_stem |
---|
| 71 | REAL(wp) :: z_frc_voltop, z_frc_temtop, z_frc_sal |
---|
| 72 | REAL(wp) :: z_frc_volbot, z_frc_tembot |
---|
| 73 | REAL(wp) :: zdiff_vol, zdiff_sal, zdiff_tem |
---|
| 74 | !!--------------------------------------------------------------------------- |
---|
[9124] | 75 | IF( ln_timing ) CALL timing_start('ice_dia') |
---|
[8586] | 76 | |
---|
| 77 | IF( kt == nit000 .AND. lwp ) THEN |
---|
| 78 | WRITE(numout,*) |
---|
| 79 | WRITE(numout,*)'icedia: output ice diagnostics (integrated over the domain)' |
---|
| 80 | WRITE(numout,*)'~~~~~~' |
---|
| 81 | ENDIF |
---|
| 82 | |
---|
[11799] | 83 | IF( kt == nit000 ) THEN |
---|
| 84 | z1_e1e2 = 1._wp / glob_sum( 'icedia', e1e2t(:,:) ) |
---|
| 85 | ENDIF |
---|
| 86 | |
---|
[8586] | 87 | ! ----------------------- ! |
---|
[11799] | 88 | ! 1 - Contents ! |
---|
[8586] | 89 | ! ----------------------- ! |
---|
[11799] | 90 | IF( iom_use('ibgvol_tot' ) .OR. iom_use('sbgvol_tot' ) .OR. iom_use('ibgarea_tot') .OR. & |
---|
| 91 | & iom_use('ibgsalt_tot') .OR. iom_use('ibgheat_tot') .OR. iom_use('sbgheat_tot') ) THEN |
---|
| 92 | |
---|
| 93 | zbg_ivol = glob_sum( 'icedia', vt_i(:,:) * e1e2t(:,:) ) * 1.e-9 ! ice volume (km3) |
---|
| 94 | zbg_svol = glob_sum( 'icedia', vt_s(:,:) * e1e2t(:,:) ) * 1.e-9 ! snow volume (km3) |
---|
| 95 | zbg_area = glob_sum( 'icedia', at_i(:,:) * e1e2t(:,:) ) * 1.e-6 ! area (km2) |
---|
| 96 | zbg_isal = glob_sum( 'icedia', st_i(:,:) * e1e2t(:,:) ) * 1.e-9 ! salt content (pss*km3) |
---|
| 97 | zbg_item = glob_sum( 'icedia', et_i(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J) |
---|
| 98 | zbg_stem = glob_sum( 'icedia', et_s(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J) |
---|
| 99 | |
---|
| 100 | CALL iom_put( 'ibgvol_tot' , zbg_ivol ) |
---|
| 101 | CALL iom_put( 'sbgvol_tot' , zbg_svol ) |
---|
| 102 | CALL iom_put( 'ibgarea_tot' , zbg_area ) |
---|
| 103 | CALL iom_put( 'ibgsalt_tot' , zbg_isal ) |
---|
| 104 | CALL iom_put( 'ibgheat_tot' , zbg_item ) |
---|
| 105 | CALL iom_put( 'sbgheat_tot' , zbg_stem ) |
---|
| 106 | |
---|
| 107 | ENDIF |
---|
| 108 | |
---|
[8586] | 109 | ! ---------------------------! |
---|
| 110 | ! 2 - Trends due to forcing ! |
---|
| 111 | ! ---------------------------! |
---|
[11799] | 112 | ! they must be kept outside an IF(iom_use) because of the call to dia_rst below |
---|
[10425] | 113 | z_frc_volbot = r1_rau0 * glob_sum( 'icedia', -( wfx_ice(:,:) + wfx_snw(:,:) + wfx_err_sub(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! freshwater flux ice/snow-ocean |
---|
| 114 | z_frc_voltop = r1_rau0 * glob_sum( 'icedia', -( wfx_sub(:,:) + wfx_spr(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! freshwater flux ice/snow-atm |
---|
| 115 | z_frc_sal = r1_rau0 * glob_sum( 'icedia', - sfx(:,:) * e1e2t(:,:) ) * 1.e-9 ! salt fluxes ice/snow-ocean |
---|
| 116 | z_frc_tembot = glob_sum( 'icedia', qt_oce_ai(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat on top of ocean (and below ice) |
---|
| 117 | z_frc_temtop = glob_sum( 'icedia', qt_atm_oi(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat on top of ice-coean |
---|
[8586] | 118 | ! |
---|
| 119 | frc_voltop = frc_voltop + z_frc_voltop * rdt_ice ! km3 |
---|
| 120 | frc_volbot = frc_volbot + z_frc_volbot * rdt_ice ! km3 |
---|
| 121 | frc_sal = frc_sal + z_frc_sal * rdt_ice ! km3*pss |
---|
| 122 | frc_temtop = frc_temtop + z_frc_temtop * rdt_ice ! 1.e20 J |
---|
| 123 | frc_tembot = frc_tembot + z_frc_tembot * rdt_ice ! 1.e20 J |
---|
| 124 | |
---|
[11799] | 125 | CALL iom_put( 'ibgfrcvoltop' , frc_voltop ) ! vol forcing ice/snw-atm (km3 equivalent ocean water) |
---|
| 126 | CALL iom_put( 'ibgfrcvolbot' , frc_volbot ) ! vol forcing ice/snw-ocean (km3 equivalent ocean water) |
---|
| 127 | CALL iom_put( 'ibgfrcsal' , frc_sal ) ! sal - forcing (psu*km3 equivalent ocean water) |
---|
| 128 | CALL iom_put( 'ibgfrctemtop' , frc_temtop ) ! heat on top of ice/snw/ocean (1.e20 J) |
---|
| 129 | CALL iom_put( 'ibgfrctembot' , frc_tembot ) ! heat on top of ocean(below ice) (1.e20 J) |
---|
[8586] | 130 | |
---|
[11799] | 131 | IF( iom_use('ibgfrchfxtop') .OR. iom_use('ibgfrchfxbot') ) THEN |
---|
| 132 | CALL iom_put( 'ibgfrchfxtop' , frc_temtop * z1_e1e2 * 1.e-20 * kt*rdt ) ! heat on top of ice/snw/ocean (W/m2) |
---|
| 133 | CALL iom_put( 'ibgfrchfxbot' , frc_tembot * z1_e1e2 * 1.e-20 * kt*rdt ) ! heat on top of ocean(below ice) (W/m2) |
---|
| 134 | ENDIF |
---|
| 135 | |
---|
| 136 | ! ---------------------------------- ! |
---|
| 137 | ! 3 - Content variations and drifts ! |
---|
| 138 | ! ---------------------------------- ! |
---|
| 139 | IF( iom_use('ibgvolume') .OR. iom_use('ibgsaltco') .OR. iom_use('ibgheatco') .OR. iom_use('ibgheatfx') ) THEN |
---|
| 140 | |
---|
| 141 | zdiff_vol = r1_rau0 * glob_sum( 'icedia', ( rhoi*vt_i(:,:) + rhos*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! freshwater trend (km3) |
---|
| 142 | zdiff_sal = r1_rau0 * glob_sum( 'icedia', ( rhoi*st_i(:,:) - sal_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! salt content trend (km3*pss) |
---|
| 143 | zdiff_tem = glob_sum( 'icedia', ( et_i(:,:) + et_s(:,:) - tem_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-20 ! heat content trend (1.e20 J) |
---|
| 144 | ! + SUM( qevap_ice * a_i_b, dim=3 ) !! clem: I think this term should not be there (but needs a check) |
---|
| 145 | |
---|
| 146 | zdiff_vol = zdiff_vol - ( frc_voltop + frc_volbot ) |
---|
| 147 | zdiff_sal = zdiff_sal - frc_sal |
---|
| 148 | zdiff_tem = zdiff_tem - ( frc_tembot - frc_temtop ) |
---|
| 149 | |
---|
| 150 | CALL iom_put( 'ibgvolume' , zdiff_vol ) ! ice/snow volume drift (km3 equivalent ocean water) |
---|
| 151 | CALL iom_put( 'ibgsaltco' , zdiff_sal ) ! ice salt content drift (psu*km3 equivalent ocean water) |
---|
| 152 | CALL iom_put( 'ibgheatco' , zdiff_tem ) ! ice/snow heat content drift (1.e20 J) |
---|
| 153 | ! |
---|
| 154 | ENDIF |
---|
| 155 | |
---|
[8586] | 156 | IF( lrst_ice ) CALL ice_dia_rst( 'WRITE', kt_ice ) |
---|
| 157 | ! |
---|
[9124] | 158 | IF( ln_timing ) CALL timing_stop('ice_dia') |
---|
[8586] | 159 | ! |
---|
| 160 | END SUBROUTINE ice_dia |
---|
| 161 | |
---|
| 162 | |
---|
| 163 | SUBROUTINE ice_dia_init |
---|
| 164 | !!--------------------------------------------------------------------------- |
---|
| 165 | !! *** ROUTINE ice_dia_init *** |
---|
| 166 | !! |
---|
| 167 | !! ** Purpose: Initialization for the heat salt volume budgets |
---|
| 168 | !! |
---|
| 169 | !! ** Method : Compute initial heat content, salt content and volume |
---|
| 170 | !! |
---|
| 171 | !! ** Action : - Compute initial heat content, salt content and volume |
---|
| 172 | !! - Initialize forcing trends |
---|
| 173 | !! - Compute coefficients for conversion |
---|
| 174 | !!--------------------------------------------------------------------------- |
---|
| 175 | INTEGER :: ios, ierror ! local integer |
---|
| 176 | !! |
---|
[11799] | 177 | NAMELIST/namdia/ ln_icediachk, rn_icechk_cel, rn_icechk_glo, ln_icediahsb, ln_icectl, iiceprt, jiceprt |
---|
[8586] | 178 | !!---------------------------------------------------------------------- |
---|
| 179 | ! |
---|
| 180 | REWIND( numnam_ice_ref ) ! Namelist namdia in reference namelist : Parameters for ice |
---|
| 181 | READ ( numnam_ice_ref, namdia, IOSTAT = ios, ERR = 901) |
---|
[11799] | 182 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdia in reference namelist' ) |
---|
[8586] | 183 | REWIND( numnam_ice_cfg ) ! Namelist namdia in configuration namelist : Parameters for ice |
---|
| 184 | READ ( numnam_ice_cfg, namdia, IOSTAT = ios, ERR = 902 ) |
---|
[11799] | 185 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namdia in configuration namelist' ) |
---|
[8586] | 186 | IF(lwm) WRITE ( numoni, namdia ) |
---|
| 187 | ! |
---|
| 188 | IF(lwp) THEN ! control print |
---|
| 189 | WRITE(numout,*) |
---|
| 190 | WRITE(numout,*) 'ice_dia_init: ice diagnostics' |
---|
| 191 | WRITE(numout,*) ' ~~~~~~~~~~~' |
---|
| 192 | WRITE(numout,*) ' Namelist namdia:' |
---|
[11799] | 193 | WRITE(numout,*) ' Diagnose online heat/mass/salt conservation ln_icediachk = ', ln_icediachk |
---|
| 194 | WRITE(numout,*) ' threshold for conservation (gridcell) rn_icechk_cel = ', rn_icechk_cel |
---|
| 195 | WRITE(numout,*) ' threshold for conservation (global) rn_icechk_glo = ', rn_icechk_glo |
---|
| 196 | WRITE(numout,*) ' Output heat/mass/salt budget ln_icediahsb = ', ln_icediahsb |
---|
| 197 | WRITE(numout,*) ' control prints for a given grid point ln_icectl = ', ln_icectl |
---|
| 198 | WRITE(numout,*) ' chosen grid point position (iiceprt,jiceprt) = (', iiceprt,',', jiceprt,')' |
---|
[8586] | 199 | ENDIF |
---|
| 200 | ! |
---|
| 201 | IF( ln_icediahsb ) THEN |
---|
| 202 | IF( ice_dia_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'ice_dia_init : unable to allocate arrays' ) ! allocate tke arrays |
---|
| 203 | CALL ice_dia_rst( 'READ' ) ! read or initialize all required files |
---|
| 204 | ENDIF |
---|
| 205 | ! |
---|
| 206 | END SUBROUTINE ice_dia_init |
---|
| 207 | |
---|
| 208 | |
---|
| 209 | SUBROUTINE ice_dia_rst( cdrw, kt ) |
---|
| 210 | !!--------------------------------------------------------------------- |
---|
| 211 | !! *** ROUTINE icedia_rst *** |
---|
| 212 | !! |
---|
| 213 | !! ** Purpose : Read or write DIA file in restart file |
---|
| 214 | !! |
---|
| 215 | !! ** Method : use of IOM library |
---|
| 216 | !!---------------------------------------------------------------------- |
---|
| 217 | CHARACTER(len=*) , INTENT(in) :: cdrw ! "READ"/"WRITE" flag |
---|
| 218 | INTEGER, OPTIONAL, INTENT(in) :: kt ! ice time-step |
---|
| 219 | ! |
---|
| 220 | INTEGER :: iter ! local integer |
---|
| 221 | REAL(wp) :: ziter ! local scalar |
---|
| 222 | !!---------------------------------------------------------------------- |
---|
| 223 | ! |
---|
| 224 | IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise |
---|
| 225 | IF( ln_rstart ) THEN !* Read the restart file |
---|
| 226 | ! |
---|
| 227 | CALL iom_get( numrir, 'kt_ice' , ziter ) |
---|
| 228 | IF(lwp) WRITE(numout,*) |
---|
| 229 | IF(lwp) WRITE(numout,*) 'ice_dia_rst read at time step = ', ziter |
---|
| 230 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
| 231 | CALL iom_get( numrir, 'frc_voltop' , frc_voltop ) |
---|
| 232 | CALL iom_get( numrir, 'frc_volbot' , frc_volbot ) |
---|
| 233 | CALL iom_get( numrir, 'frc_temtop' , frc_temtop ) |
---|
| 234 | CALL iom_get( numrir, 'frc_tembot' , frc_tembot ) |
---|
| 235 | CALL iom_get( numrir, 'frc_sal' , frc_sal ) |
---|
| 236 | CALL iom_get( numrir, jpdom_autoglo, 'vol_loc_ini', vol_loc_ini ) |
---|
| 237 | CALL iom_get( numrir, jpdom_autoglo, 'tem_loc_ini', tem_loc_ini ) |
---|
| 238 | CALL iom_get( numrir, jpdom_autoglo, 'sal_loc_ini', sal_loc_ini ) |
---|
| 239 | ELSE |
---|
| 240 | IF(lwp) WRITE(numout,*) |
---|
| 241 | IF(lwp) WRITE(numout,*) ' ice_dia at initial state ' |
---|
| 242 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 243 | ! set trends to 0 |
---|
| 244 | frc_voltop = 0._wp |
---|
| 245 | frc_volbot = 0._wp |
---|
| 246 | frc_temtop = 0._wp |
---|
| 247 | frc_tembot = 0._wp |
---|
| 248 | frc_sal = 0._wp |
---|
| 249 | ! record initial ice volume, salt and temp |
---|
[9935] | 250 | vol_loc_ini(:,:) = rhoi * vt_i(:,:) + rhos * vt_s(:,:) ! ice/snow volume (kg/m2) |
---|
| 251 | tem_loc_ini(:,:) = et_i(:,:) + et_s(:,:) ! ice/snow heat content (J) |
---|
[11799] | 252 | sal_loc_ini(:,:) = rhoi * st_i(:,:) ! ice salt content (pss*kg/m2) |
---|
[8586] | 253 | ENDIF |
---|
| 254 | ! |
---|
| 255 | ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN ! Create restart file |
---|
| 256 | ! ! ------------------- |
---|
| 257 | iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 |
---|
| 258 | ! |
---|
| 259 | IF( iter == nitrst ) THEN |
---|
| 260 | IF(lwp) WRITE(numout,*) |
---|
| 261 | IF(lwp) WRITE(numout,*) 'ice_dia_rst write at time step = ', kt |
---|
| 262 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' |
---|
| 263 | ENDIF |
---|
| 264 | ! |
---|
| 265 | ! Write in numriw (if iter == nitrst) |
---|
| 266 | ! ------------------ |
---|
| 267 | CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop ) |
---|
| 268 | CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot ) |
---|
| 269 | CALL iom_rstput( iter, nitrst, numriw, 'frc_temtop' , frc_temtop ) |
---|
| 270 | CALL iom_rstput( iter, nitrst, numriw, 'frc_tembot' , frc_tembot ) |
---|
| 271 | CALL iom_rstput( iter, nitrst, numriw, 'frc_sal' , frc_sal ) |
---|
| 272 | CALL iom_rstput( iter, nitrst, numriw, 'vol_loc_ini', vol_loc_ini ) |
---|
| 273 | CALL iom_rstput( iter, nitrst, numriw, 'tem_loc_ini', tem_loc_ini ) |
---|
| 274 | CALL iom_rstput( iter, nitrst, numriw, 'sal_loc_ini', sal_loc_ini ) |
---|
| 275 | ! |
---|
| 276 | ENDIF |
---|
| 277 | ! |
---|
| 278 | END SUBROUTINE ice_dia_rst |
---|
| 279 | |
---|
| 280 | #else |
---|
| 281 | !!---------------------------------------------------------------------- |
---|
[9570] | 282 | !! Default option : Empty module NO SI3 sea-ice model |
---|
[8586] | 283 | !!---------------------------------------------------------------------- |
---|
| 284 | #endif |
---|
| 285 | |
---|
| 286 | !!====================================================================== |
---|
| 287 | END MODULE icedia |
---|