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