[8426] | 1 | MODULE icedia |
---|
| 2 | !!====================================================================== |
---|
[8486] | 3 | !! *** MODULE icedia *** |
---|
| 4 | !! Sea-Ice model : global budgets |
---|
[8426] | 5 | !!====================================================================== |
---|
| 6 | !! History : 3.4 ! 2012-10 (C. Rousset) original code |
---|
[8486] | 7 | !! 4.0 ! 2017-08 (C. Rousset) fits nemo4.0 standards |
---|
[8426] | 8 | !!---------------------------------------------------------------------- |
---|
| 9 | #if defined key_lim3 |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
| 11 | !! 'key_lim3' LIM3 sea-ice model |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
[8486] | 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 |
---|
[8426] | 16 | !!---------------------------------------------------------------------- |
---|
[8486] | 17 | USE ice ! LIM-3: sea-ice variable |
---|
| 18 | USE dom_oce ! ocean domain |
---|
| 19 | USE phycst ! physical constant |
---|
| 20 | USE daymod ! model calendar |
---|
| 21 | USE sbc_oce , ONLY : sfx ! surface boundary condition: ocean fields |
---|
| 22 | USE icerst ! ice restart |
---|
| 23 | ! |
---|
| 24 | USE in_out_manager ! I/O manager |
---|
| 25 | USE lib_mpp ! MPP library |
---|
| 26 | USE timing ! preformance summary |
---|
| 27 | USE iom ! I/O manager |
---|
| 28 | USE lib_fortran ! glob_sum |
---|
[8426] | 29 | |
---|
| 30 | IMPLICIT NONE |
---|
| 31 | PRIVATE |
---|
| 32 | |
---|
| 33 | PUBLIC ice_dia ! routine called by icestp.F90 |
---|
| 34 | PUBLIC ice_dia_init ! routine called in icestp.F90 |
---|
| 35 | |
---|
| 36 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: vol_loc_ini, sal_loc_ini, tem_loc_ini ! initial volume, salt and heat contents |
---|
| 37 | REAL(wp) :: frc_sal, frc_voltop, frc_volbot, frc_temtop, frc_tembot ! global forcing trends |
---|
| 38 | |
---|
| 39 | !! * Substitutions |
---|
| 40 | # include "vectopt_loop_substitute.h90" |
---|
| 41 | !!---------------------------------------------------------------------- |
---|
[8486] | 42 | !! NEMO/ICE 4.0 , NEMO Consortium (2017) |
---|
[8426] | 43 | !! $Id: icedia.F90 8413 2017-08-07 17:05:39Z clem $ |
---|
| 44 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 45 | !!---------------------------------------------------------------------- |
---|
| 46 | CONTAINS |
---|
| 47 | |
---|
| 48 | SUBROUTINE ice_dia( kt ) |
---|
| 49 | !!--------------------------------------------------------------------------- |
---|
| 50 | !! *** ROUTINE ice_dia *** |
---|
| 51 | !! |
---|
[8486] | 52 | !! ** Purpose: Compute the sea-ice global heat content, salt content |
---|
| 53 | !! and volume conservation |
---|
[8426] | 54 | !!--------------------------------------------------------------------------- |
---|
[8486] | 55 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
[8426] | 56 | !! |
---|
[8486] | 57 | REAL(wp) :: zbg_ivol, zbg_item, zbg_area, zbg_isal |
---|
| 58 | REAL(wp) :: zbg_svol, zbg_stem |
---|
| 59 | REAL(wp) :: z_frc_voltop, z_frc_temtop, z_frc_sal |
---|
| 60 | REAL(wp) :: z_frc_volbot, z_frc_tembot |
---|
[8426] | 61 | REAL(wp) :: zdiff_vol, zdiff_sal, zdiff_tem |
---|
| 62 | !!--------------------------------------------------------------------------- |
---|
| 63 | IF( nn_timing == 1 ) CALL timing_start('ice_dia') |
---|
| 64 | |
---|
| 65 | IF( kt == nit000 .AND. lwp ) THEN |
---|
| 66 | WRITE(numout,*) |
---|
[8486] | 67 | WRITE(numout,*)'icedia : outpout ice diagnostics (integrated over the domain)' |
---|
[8426] | 68 | WRITE(numout,*)'~~~~~~' |
---|
| 69 | ENDIF |
---|
| 70 | |
---|
[8486] | 71 | !!gm glob_sum includes a " * tmask_i ", so remove " * tmask(:,:,1) " |
---|
| 72 | |
---|
[8426] | 73 | ! ----------------------- ! |
---|
| 74 | ! 1 - Contents ! |
---|
| 75 | ! ----------------------- ! |
---|
[8486] | 76 | zbg_ivol = glob_sum( vt_i(:,:) * e1e2t(:,:) ) * 1.e-9 ! ice volume (km3) |
---|
| 77 | zbg_svol = glob_sum( vt_s(:,:) * e1e2t(:,:) ) * 1.e-9 ! snow volume (km3) |
---|
| 78 | zbg_area = glob_sum( at_i(:,:) * e1e2t(:,:) ) * 1.e-6 ! area (km2) |
---|
| 79 | zbg_isal = glob_sum( SUM( smv_i(:,:,:), dim=3 ) * e1e2t(:,:) ) * 1.e-9 ! salt content (pss*km3) |
---|
| 80 | zbg_item = glob_sum( et_i * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J) |
---|
| 81 | zbg_stem = glob_sum( et_s * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J) |
---|
[8426] | 82 | |
---|
| 83 | ! ---------------------------! |
---|
| 84 | ! 2 - Trends due to forcing ! |
---|
| 85 | ! ---------------------------! |
---|
[8486] | 86 | z_frc_volbot = r1_rau0 * glob_sum( - ( wfx_ice(:,:) + wfx_snw(:,:) + wfx_err_sub(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! freshwater flux ice/snow-ocean |
---|
| 87 | z_frc_voltop = r1_rau0 * glob_sum( - ( wfx_sub(:,:) + wfx_spr(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! freshwater flux ice/snow-atm |
---|
| 88 | z_frc_sal = r1_rau0 * glob_sum( - sfx(:,:) * e1e2t(:,:) ) * 1.e-9 ! salt fluxes ice/snow-ocean |
---|
| 89 | z_frc_tembot = glob_sum( hfx_out(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat on top of ocean (and below ice) |
---|
| 90 | z_frc_temtop = glob_sum( hfx_in (:,:) * e1e2t(:,:) ) * 1.e-20 ! heat on top of ice-coean |
---|
[8426] | 91 | ! |
---|
| 92 | frc_voltop = frc_voltop + z_frc_voltop * rdt_ice ! km3 |
---|
| 93 | frc_volbot = frc_volbot + z_frc_volbot * rdt_ice ! km3 |
---|
| 94 | frc_sal = frc_sal + z_frc_sal * rdt_ice ! km3*pss |
---|
| 95 | frc_temtop = frc_temtop + z_frc_temtop * rdt_ice ! 1.e20 J |
---|
| 96 | frc_tembot = frc_tembot + z_frc_tembot * rdt_ice ! 1.e20 J |
---|
| 97 | |
---|
| 98 | ! ----------------------- ! |
---|
| 99 | ! 3 - Content variations ! |
---|
| 100 | ! ----------------------- ! |
---|
[8486] | 101 | zdiff_vol = r1_rau0 * glob_sum( ( rhoic*vt_i(:,:) + rhosn*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! freshwater trend (km3) |
---|
| 102 | zdiff_sal = r1_rau0 * glob_sum( ( rhoic* SUM( smv_i(:,:,:), dim=3 ) - sal_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9 ! salt content trend (km3*pss) |
---|
| 103 | zdiff_tem = glob_sum( ( et_i(:,:) + et_s(:,:) - tem_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-20 ! heat content trend (1.e20 J) |
---|
| 104 | ! + SUM( qevap_ice * a_i_b, dim=3 ) !! clem: I think this term should not be there (but needs a check) |
---|
[8426] | 105 | |
---|
| 106 | ! ----------------------- ! |
---|
| 107 | ! 4 - Drifts ! |
---|
| 108 | ! ----------------------- ! |
---|
| 109 | zdiff_vol = zdiff_vol - ( frc_voltop + frc_volbot ) |
---|
| 110 | zdiff_sal = zdiff_sal - frc_sal |
---|
| 111 | zdiff_tem = zdiff_tem - ( frc_tembot - frc_temtop ) |
---|
| 112 | |
---|
| 113 | ! ----------------------- ! |
---|
| 114 | ! 5 - Diagnostics writing ! |
---|
| 115 | ! ----------------------- ! |
---|
[8486] | 116 | !!gm I don't understand the division by the ocean surface (i.e. glob_sum( e1e2t(:,:) ) * 1.e-20 * kt*rdt ) |
---|
| 117 | !! and its multiplication bu kt ! is it really what we want ? what is this quantity ? |
---|
| 118 | !! IF it is really what we want, compute it at kt=nit000, not 3 time by time-step ! |
---|
| 119 | !! kt*rdt : you mean rdtice ? |
---|
| 120 | !!gm |
---|
[8426] | 121 | ! |
---|
[8486] | 122 | IF( iom_use('ibgvolume') ) CALL iom_put( 'ibgvolume' , zdiff_vol ) ! ice/snow volume drift (km3 equivalent ocean water) |
---|
| 123 | IF( iom_use('ibgsaltco') ) CALL iom_put( 'ibgsaltco' , zdiff_sal ) ! ice salt content drift (psu*km3 equivalent ocean water) |
---|
| 124 | IF( iom_use('ibgheatco') ) CALL iom_put( 'ibgheatco' , zdiff_tem ) ! ice/snow heat content drift (1.e20 J) |
---|
| 125 | IF( iom_use('ibgheatfx') ) CALL iom_put( 'ibgheatfx' , & ! ice/snow heat flux drift (W/m2) |
---|
| 126 | & zdiff_tem /glob_sum( e1e2t(:,:) * 1.e-20 * kt*rdt ) ) |
---|
[8426] | 127 | |
---|
[8486] | 128 | IF( iom_use('ibgfrcvoltop') ) CALL iom_put( 'ibgfrcvoltop' , frc_voltop ) ! vol forcing ice/snw-atm (km3 equivalent ocean water) |
---|
| 129 | IF( iom_use('ibgfrcvolbot') ) CALL iom_put( 'ibgfrcvolbot' , frc_volbot ) ! vol forcing ice/snw-ocean (km3 equivalent ocean water) |
---|
| 130 | IF( iom_use('ibgfrcsal') ) CALL iom_put( 'ibgfrcsal' , frc_sal ) ! sal - forcing (psu*km3 equivalent ocean water) |
---|
| 131 | IF( iom_use('ibgfrctemtop') ) CALL iom_put( 'ibgfrctemtop' , frc_temtop ) ! heat on top of ice/snw/ocean (1.e20 J) |
---|
| 132 | IF( iom_use('ibgfrctembot') ) CALL iom_put( 'ibgfrctembot' , frc_tembot ) ! heat on top of ocean(below ice) (1.e20 J) |
---|
| 133 | IF( iom_use('ibgfrchfxtop') ) CALL iom_put( 'ibgfrchfxtop' , & ! heat on top of ice/snw/ocean (W/m2) |
---|
| 134 | & frc_temtop / glob_sum( e1e2t(:,:) ) * 1.e-20 * kt*rdt ) |
---|
| 135 | IF( iom_use('ibgfrchfxbot') ) CALL iom_put( 'ibgfrchfxbot' , & ! heat on top of ocean(below ice) (W/m2) |
---|
| 136 | & frc_tembot / glob_sum( e1e2t(:,:) ) * 1.e-20 * kt*rdt ) |
---|
[8426] | 137 | |
---|
[8486] | 138 | IF( iom_use('ibgvol_tot' ) ) CALL iom_put( 'ibgvol_tot' , zbg_ivol ) ! ice volume (km3) |
---|
| 139 | IF( iom_use('sbgvol_tot' ) ) CALL iom_put( 'sbgvol_tot' , zbg_svol ) ! snow volume (km3) |
---|
| 140 | IF( iom_use('ibgarea_tot') ) CALL iom_put( 'ibgarea_tot' , zbg_area ) ! ice area (km2) |
---|
| 141 | IF( iom_use('ibgsalt_tot') ) CALL iom_put( 'ibgsalt_tot' , zbg_isal ) ! ice salinity content (pss*km3) |
---|
| 142 | IF( iom_use('ibgheat_tot') ) CALL iom_put( 'ibgheat_tot' , zbg_item ) ! ice heat content (1.e20 J) |
---|
| 143 | IF( iom_use('sbgheat_tot') ) CALL iom_put( 'sbgheat_tot' , zbg_stem ) ! snow heat content (1.e20 J) |
---|
[8426] | 144 | ! |
---|
| 145 | IF( lrst_ice ) CALL ice_dia_rst( 'WRITE', kt_ice ) |
---|
| 146 | ! |
---|
| 147 | IF( nn_timing == 1 ) CALL timing_stop('ice_dia') |
---|
| 148 | ! |
---|
| 149 | END SUBROUTINE ice_dia |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | SUBROUTINE ice_dia_init |
---|
| 153 | !!--------------------------------------------------------------------------- |
---|
| 154 | !! *** ROUTINE ice_dia_init *** |
---|
| 155 | !! |
---|
| 156 | !! ** Purpose: Initialization for the heat salt volume budgets |
---|
| 157 | !! |
---|
| 158 | !! ** Method : Compute initial heat content, salt content and volume |
---|
| 159 | !! |
---|
| 160 | !! ** Action : - Compute initial heat content, salt content and volume |
---|
| 161 | !! - Initialize forcing trends |
---|
| 162 | !! - Compute coefficients for conversion |
---|
| 163 | !!--------------------------------------------------------------------------- |
---|
| 164 | INTEGER :: ierror ! local integer |
---|
| 165 | !! |
---|
| 166 | !!NAMELIST/namicehsb/ blabla |
---|
| 167 | !!---------------------------------------------------------------------- |
---|
| 168 | ! |
---|
| 169 | !!REWIND ( numnam_ice ) ! Read Namelist namicehsb |
---|
| 170 | !!READ ( numnam_ice, namicehsb ) |
---|
| 171 | ! |
---|
| 172 | IF(lwp) THEN ! Control print |
---|
| 173 | WRITE(numout,*) |
---|
| 174 | WRITE(numout,*) 'ice_dia_init : check the heat and salt budgets' |
---|
| 175 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
| 176 | ENDIF |
---|
| 177 | ! |
---|
| 178 | ALLOCATE( vol_loc_ini(jpi,jpj), sal_loc_ini(jpi,jpj), tem_loc_ini(jpi,jpj), STAT=ierror ) |
---|
| 179 | IF( ierror > 0 ) THEN |
---|
| 180 | CALL ctl_stop( 'ice_dia: unable to allocate vol_loc_ini' ) |
---|
| 181 | RETURN |
---|
| 182 | ENDIF |
---|
[8486] | 183 | ! |
---|
[8426] | 184 | CALL ice_dia_rst( 'READ' ) !* read or initialize all required files |
---|
| 185 | ! |
---|
| 186 | END SUBROUTINE ice_dia_init |
---|
| 187 | |
---|
[8486] | 188 | |
---|
[8426] | 189 | SUBROUTINE ice_dia_rst( cdrw, kt ) |
---|
[8486] | 190 | !!--------------------------------------------------------------------- |
---|
| 191 | !! *** ROUTINE limdia_rst *** |
---|
| 192 | !! |
---|
| 193 | !! ** Purpose : Read or write DIA file in restart file |
---|
| 194 | !! |
---|
| 195 | !! ** Method : use of IOM library |
---|
| 196 | !!---------------------------------------------------------------------- |
---|
| 197 | CHARACTER(len=*) , INTENT(in) :: cdrw ! "READ"/"WRITE" flag |
---|
| 198 | INTEGER, OPTIONAL, INTENT(in) :: kt ! ice time-step |
---|
| 199 | ! |
---|
| 200 | INTEGER :: iter ! local integer |
---|
| 201 | REAL(wp) :: ziter ! local scalar |
---|
| 202 | !!---------------------------------------------------------------------- |
---|
| 203 | ! |
---|
| 204 | IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise |
---|
| 205 | IF( ln_rstart ) THEN !* Read the restart file |
---|
| 206 | ! |
---|
| 207 | CALL iom_get( numrir, 'kt_ice' , ziter ) |
---|
| 208 | IF(lwp) WRITE(numout,*) |
---|
| 209 | IF(lwp) WRITE(numout,*) ' ice_dia_rst read at time step = ', ziter |
---|
| 210 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 211 | CALL iom_get( numrir, 'frc_voltop' , frc_voltop ) |
---|
| 212 | CALL iom_get( numrir, 'frc_volbot' , frc_volbot ) |
---|
| 213 | CALL iom_get( numrir, 'frc_temtop' , frc_temtop ) |
---|
| 214 | CALL iom_get( numrir, 'frc_tembot' , frc_tembot ) |
---|
| 215 | CALL iom_get( numrir, 'frc_sal' , frc_sal ) |
---|
| 216 | CALL iom_get( numrir, jpdom_autoglo, 'vol_loc_ini', vol_loc_ini ) |
---|
| 217 | CALL iom_get( numrir, jpdom_autoglo, 'tem_loc_ini', tem_loc_ini ) |
---|
| 218 | CALL iom_get( numrir, jpdom_autoglo, 'sal_loc_ini', sal_loc_ini ) |
---|
| 219 | ELSE |
---|
| 220 | IF(lwp) WRITE(numout,*) |
---|
| 221 | IF(lwp) WRITE(numout,*) ' ice_dia at initial state ' |
---|
| 222 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 223 | ! set trends to 0 |
---|
| 224 | frc_voltop = 0._wp |
---|
| 225 | frc_volbot = 0._wp |
---|
| 226 | frc_temtop = 0._wp |
---|
| 227 | frc_tembot = 0._wp |
---|
| 228 | frc_sal = 0._wp |
---|
| 229 | ! record initial ice volume, salt and temp |
---|
| 230 | vol_loc_ini(:,:) = rhoic * vt_i(:,:) + rhosn * vt_s(:,:) ! ice/snow volume (kg/m2) |
---|
| 231 | tem_loc_ini(:,:) = et_i(:,:) + et_s(:,:) ! ice/snow heat content (J) |
---|
| 232 | sal_loc_ini(:,:) = rhoic * SUM( smv_i(:,:,:), dim=3 ) ! ice salt content (pss*kg/m2) |
---|
| 233 | ENDIF |
---|
| 234 | ! |
---|
| 235 | ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN ! Create restart file |
---|
| 236 | ! ! ------------------- |
---|
| 237 | iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 |
---|
| 238 | ! |
---|
| 239 | IF( iter == nitrst ) THEN |
---|
| 240 | IF(lwp) WRITE(numout,*) |
---|
| 241 | IF(lwp) WRITE(numout,*) ' ice_dia_rst write at time step = ', kt |
---|
| 242 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 243 | ENDIF |
---|
| 244 | ! |
---|
| 245 | ! Write in numriw (if iter == nitrst) |
---|
| 246 | ! ------------------ |
---|
| 247 | CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop ) |
---|
| 248 | CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot ) |
---|
| 249 | CALL iom_rstput( iter, nitrst, numriw, 'frc_temtop' , frc_temtop ) |
---|
| 250 | CALL iom_rstput( iter, nitrst, numriw, 'frc_tembot' , frc_tembot ) |
---|
| 251 | CALL iom_rstput( iter, nitrst, numriw, 'frc_sal' , frc_sal ) |
---|
| 252 | CALL iom_rstput( iter, nitrst, numriw, 'vol_loc_ini', vol_loc_ini ) |
---|
| 253 | CALL iom_rstput( iter, nitrst, numriw, 'tem_loc_ini', tem_loc_ini ) |
---|
| 254 | CALL iom_rstput( iter, nitrst, numriw, 'sal_loc_ini', sal_loc_ini ) |
---|
| 255 | ! |
---|
| 256 | ENDIF |
---|
| 257 | ! |
---|
[8426] | 258 | END SUBROUTINE ice_dia_rst |
---|
| 259 | |
---|
| 260 | #else |
---|
| 261 | !!---------------------------------------------------------------------- |
---|
| 262 | !! Default option : Empty module NO LIM sea-ice model |
---|
| 263 | !!---------------------------------------------------------------------- |
---|
| 264 | #endif |
---|
[8486] | 265 | |
---|
[8426] | 266 | !!====================================================================== |
---|
| 267 | END MODULE icedia |
---|