diff --git a/src/MNH/mode_les_diachro.f90 b/src/MNH/mode_les_diachro.f90 index 27764a382b7ad500d65dfde90516e50bcbb897df..c78e23506cc43545d5ec17a0d9edc33a072a725e 100644 --- a/src/MNH/mode_les_diachro.f90 +++ b/src/MNH/mode_les_diachro.f90 @@ -970,7 +970,7 @@ else zfield(:, :, :, :) = pfield(:, :, :, :) end if -! Time average +! Time average (physical units remain unchanged) iresp = 0 if ( oavg ) call Les_time_avg_4d( zfield, tzdates, iresp ) @@ -1035,6 +1035,8 @@ if ( iresp == 0 .and. any( zfield /= XUNDEF ) ) then tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. tzbudiachro%lkcompress = .false. + tzbudiachro%ltcompress = oavg + tzbudiachro%lnorm = onorm tzbudiachro%nil = iil tzbudiachro%nih = iih tzbudiachro%njl = ijl @@ -1128,6 +1130,11 @@ type(tfield_metadata_base) :: tzfield allocate( tzdates( NLES_CURRENT_TIMES ) ) tzdates(:) = tles_dates(:) +iil = nles_current_iinf +iih = nles_current_isup +ijl = nles_current_jinf +ijh = nles_current_jsup + ikl = 1 ikh = nspectra_k @@ -1137,11 +1144,6 @@ tzfield = tpfield if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_2PTS_NI ) then Allocate( zwork6(Size( pfield, 1 ), 1, nspectra_k, nles_current_times, 1, 1) ) - iil = nles_current_iinf - iih = nles_current_isup - ijl = 1 - ijh = 1 - do jt = 1, Size( pfield, 3 ) do jk = 1, Size( pfield, 2 ) zwork6(:, 1, jk, jt, 1, 1) = pfield (:, jk, jt) @@ -1161,11 +1163,6 @@ if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_2PTS_NI ) then else if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_2PTS_NJ ) then Allocate( zwork6(1, Size( pfield, 1 ), nspectra_k, nles_current_times, 1, 1) ) - iil = 1 - iih = 1 - ijl = nles_current_jinf - ijh = nles_current_jsup - do jt = 1, Size( pfield, 3 ) do jk = 1, Size( pfield, 2 ) zwork6(1, :, jk, jt, 1, 1) = pfield (:, jk, jt) @@ -1191,7 +1188,7 @@ tzfield%cmnhname = ygroup tzfield%clongname = ygroup tzfield%ccomment = ycomment(:) -!* time average +!* time average (physical units remain unchanged) iresp = 0 if ( gavg ) then call Les_time_avg( zwork6, tzdates, iresp ) @@ -1211,11 +1208,18 @@ else end if tzbudiachro%ctype = 'SPXY' tzbudiachro%ccategory = 'LES' -tzbudiachro%cshape = 'spectrum' +tzbudiachro%cshape = '2-point correlation' +if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_2PTS_NI ) then + tzbudiachro%cdirection = 'I' +else + tzbudiachro%cdirection = 'J' +end if tzbudiachro%lmobile = .false. tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. tzbudiachro%lkcompress = .false. +tzbudiachro%ltcompress = gavg +tzbudiachro%lnorm = .false. tzbudiachro%nil = iil tzbudiachro%nih = iih tzbudiachro%njl = ijl @@ -1295,6 +1299,11 @@ type(tfield_metadata_base) :: tzfield allocate( tzdates( nles_current_times ) ) tzdates(:) = tles_dates(:) +iil = nles_current_iinf +iih = nles_current_isup +ijl = nles_current_jinf +ijh = nles_current_jsup + ikl = 1 ikh = nspectra_k @@ -1307,11 +1316,6 @@ tzfield = tpfield if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_SPEC_NI ) then Allocate( zwork6(Size( pspectra, 1 ), 1, nspectra_k, nles_current_times, 2, 1) ) - iil = nles_current_iinf - iih = nles_current_isup - ijl = 1 - ijh = 1 - do jt = 1, Size( pspectra, 4 ) do jk = 1, Size( pspectra, 3 ) zwork6(:, 1, jk, jt, 1, 1) = pspectra (:, 1, jk, jt) @@ -1332,11 +1336,6 @@ if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_SPEC_NI ) then else if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_SPEC_NJ ) then Allocate( zwork6( 1, Size( pspectra, 1 ), nspectra_k, nles_current_times, 2, 1 ) ) - iil = 1 - iih = 1 - ijl = nles_current_jinf - ijh = nles_current_jsup - do jt = 1, Size( pspectra, 4 ) do jk = 1, Size( pspectra, 3 ) zwork6(1, :, jk, jt, 1, 1) = pspectra (:, 1, jk, jt) @@ -1368,10 +1367,17 @@ tzbudiachro%ccomment = tzfield%ccomment tzbudiachro%ctype = 'SPXY' tzbudiachro%ccategory = 'LES' tzbudiachro%cshape = 'spectrum' +if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_SPEC_NI ) then + tzbudiachro%cdirection = 'I' +else + tzbudiachro%cdirection = 'J' +end if tzbudiachro%lmobile = .false. tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. tzbudiachro%lkcompress = .false. +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. tzbudiachro%nil = iil tzbudiachro%nih = iih tzbudiachro%njl = ijl @@ -1381,7 +1387,7 @@ tzbudiachro%nkh = ikh call Write_diachro( tpdiafile, tzbudiachro, [ tzfield ], tzdates, zwork6 ) ! -!* time average +!* time average (physical units remain unchanged) ! iresp = 0 call Les_time_avg( zwork6, tzdates, iresp ) @@ -1396,10 +1402,17 @@ tzbudiachro%ccomment = Trim( tzfield%ccomment ) // ' (time averaged)' tzbudiachro%ctype = 'SPXY' tzbudiachro%ccategory = 'LES' tzbudiachro%cshape = 'spectrum' +if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_SPEC_NI ) then + tzbudiachro%cdirection = 'I' +else + tzbudiachro%cdirection = 'J' +end if tzbudiachro%lmobile = .false. tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. tzbudiachro%lkcompress = .false. +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. tzbudiachro%nil = iil tzbudiachro%nih = iih tzbudiachro%njl = ijl diff --git a/src/MNH/write_aircraft_balloon.f90 b/src/MNH/write_aircraft_balloon.f90 index 993ce2f91077560b34f1509d56bbf6b637145d2b..f025c425cb79ee4785a294074dce4f5dfc679598 100644 --- a/src/MNH/write_aircraft_balloon.f90 +++ b/src/MNH/write_aircraft_balloon.f90 @@ -873,6 +873,8 @@ tzbudiachro%lmobile = .true. ! tzbudiachro%licompress = NOT SET (default values) ! tzbudiachro%ljcompress = NOT SET (default values) ! tzbudiachro%lkcompress = NOT SET (default values) +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. ! tzbudiachro%nil = NOT SET (default values) ! tzbudiachro%nih = NOT SET (default values) ! tzbudiachro%njl = NOT SET (default values) @@ -912,6 +914,8 @@ tzbudiachro%lmobile = .true. tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. tzbudiachro%lkcompress = .false. +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. tzbudiachro%nil = 1 tzbudiachro%nih = 1 tzbudiachro%njl = 1 diff --git a/src/MNH/write_budget.f90 b/src/MNH/write_budget.f90 index be4f2d5a2d56ce97923cd3cf146b6b3a04ba3816..e11a77846862de789f3fde0d2bf50d58e7b190b2 100644 --- a/src/MNH/write_budget.f90 +++ b/src/MNH/write_budget.f90 @@ -562,13 +562,17 @@ subroutine Store_one_budget_rho( tpdiafile, tpdates, tprhodj, kp, knocompress, p tzbudiachro%ccategory = 'budget' if ( ybutype == 'CART' ) then tzbudiachro%cshape = 'cartesian' + tzbudiachro%lmobile = .false. else tzbudiachro%cshape = 'mask' + !Masks are updated at each timestep (therefore the studied domains change during execution) + tzbudiachro%lmobile = .true. end if - tzbudiachro%lmobile = .false. tzbudiachro%licompress = lbu_icp tzbudiachro%ljcompress = lbu_jcp tzbudiachro%lkcompress = lbu_kcp + tzbudiachro%ltcompress = .true. !Data is temporally averaged + tzbudiachro%lnorm = .false. tzbudiachro%nil = nbuil tzbudiachro%nih = nbuih tzbudiachro%njl = nbujl @@ -815,13 +819,17 @@ subroutine Store_one_budget( tpdiafile, tpdates, tpbudget, prhodjn, knocompress, tzbudiachro%ccategory = 'budget' if ( ybutype == 'CART' ) then tzbudiachro%cshape = 'cartesian' + tzbudiachro%lmobile = .false. else tzbudiachro%cshape = 'mask' + !Masks are updated at each timestep (therefore the studied domains change during execution) + tzbudiachro%lmobile = .true. end if - tzbudiachro%lmobile = .false. tzbudiachro%licompress = lbu_icp tzbudiachro%ljcompress = lbu_jcp tzbudiachro%lkcompress = lbu_kcp + tzbudiachro%ltcompress = .true. !Data is temporally averaged + tzbudiachro%lnorm = .false. tzbudiachro%nil = nbuil tzbudiachro%nih = nbuih tzbudiachro%njl = nbujl diff --git a/src/MNH/write_diachro.f90 b/src/MNH/write_diachro.f90 index 485909a62c4103ad9b3ada8e0f027453d1e58e45..d875e7604f14ef18feecd78901fdc83e3203e9f4 100644 --- a/src/MNH/write_diachro.f90 +++ b/src/MNH/write_diachro.f90 @@ -13,6 +13,9 @@ private public :: Write_diachro +interface Att_write + procedure Att_write_c0, Att_write_i0, Att_write_x0 +end interface contains ! ################################################################# @@ -202,6 +205,15 @@ ijh = tpbudiachro%njh ikl = tpbudiachro%nkl ikh = tpbudiachro%nkh +!For backward compatibility of LFI files +if ( tpbudiachro%cdirection == 'I' ) then + ijl = 1 + ijh = 1 +else if ( tpbudiachro%cdirection == 'J' ) then + iil = 1 + iih = 1 +end if + !Write only in LFI files tzfile%cformat = 'LFI' @@ -664,7 +676,7 @@ use modd_budget, only: nbutshift, nbusubwrite, tbudiachrometadata use modd_conf, only: lcartesian use modd_field use modd_io, only: isp, tfiledata -use modd_les, only: nles_masks +use modd_les, only: cbl_height_def, cles_norm_type, nles_masks, xles_temp_sampling use modd_parameters, only: jphext use modd_precision, only: CDFINT, MNHREAL_NF90 use modd_type_date, only: date_time @@ -754,59 +766,152 @@ MASTER: if ( isp == tzfile%nmaster_rank) then tzfile%nncid = igrpid if ( .not. ggroupdefined ) then - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'name', Trim( tpbudiachro%cname ) ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'name for '//trim(ygroup)//' group' ) - - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'comment', Trim( tpbudiachro%ccomment ) ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'comment for '//trim(ygroup)//' group' ) - - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'type', trim( ytype ) ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'type for '//trim(ygroup)//' group' ) - - if ( trim ( ytype ) == 'CART' .or. trim ( ytype ) == 'MASK' .or. trim ( ytype ) == 'SPXY') then - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min x index in physical domain', iil ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'min x index for '//trim(ygroup)//' group' ) - - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max x index in physical domain', iih ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'max x index for '//trim(ygroup)//' group' ) - - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min y index in physical domain', ijl ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'min y index for '//trim(ygroup)//' group' ) - - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max y index in physical domain', ijh ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'max y index for '//trim(ygroup)//' group' ) - - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'min z index in physical domain', ikl ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'min z index for '//trim(ygroup)//' group' ) - - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'max z index in physical domain', ikh ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'max z index for '//trim(ygroup)//' group' ) - end if + call Att_write( ygroup, igrpid, 'name', tpbudiachro%cname ) + call Att_write( ygroup, igrpid, 'comment', tpbudiachro%ccomment ) + call Att_write( ygroup, igrpid, 'type', ytype ) + call Att_write( ygroup, igrpid, 'category', tpbudiachro%ccategory ) + call Att_write( ygroup, igrpid, 'shape', tpbudiachro%cshape ) + call Att_write( ygroup, igrpid, 'moving', Merge( 'yes', 'no ', tpbudiachro%lmobile ) ) + call Att_write( ygroup, igrpid, 'time averaged', Merge( 'yes', 'no ', tpbudiachro%ltcompress ) ) + call Att_write( ygroup, igrpid, 'normalized', Merge( 'yes', 'no ', tpbudiachro%lnorm ) ) + + if ( tpbudiachro%ccategory == 'budget' .and. tpbudiachro%cshape == 'cartesian' ) then + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + call Att_write( ygroup, igrpid, 'min K index in physical domain', ikl ) + call Att_write( ygroup, igrpid, 'max K index in physical domain', ikh ) + + call Att_write( ygroup, igrpid, 'averaged in the I direction', Merge( 'yes', 'no ', tpbudiachro%licompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the J direction', Merge( 'yes', 'no ', tpbudiachro%ljcompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the K direction', Merge( 'yes', 'no ', tpbudiachro%lkcompress ) ) + + else if ( tpbudiachro%ccategory == 'budget' .and. tpbudiachro%cshape == 'mask' ) then + call Att_write( ygroup, igrpid, 'masks are stored in variable', 'MASKS' ) + call Att_write( ygroup, igrpid, 'averaged in the K direction', Merge( 1, 0, tpbudiachro%lkcompress ) ) + + else if ( tpbudiachro%ccategory == 'LES' .and. tpbudiachro%cshape == 'cartesian' ) then + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + + call Att_write( ygroup, igrpid, 'averaged in the I direction', Merge( 'yes', 'no ', tpbudiachro%licompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the J direction', Merge( 'yes', 'no ', tpbudiachro%ljcompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the K direction', Merge( 'yes', 'no ', tpbudiachro%lkcompress ) ) + + call Att_write( ygroup, igrpid, 'temporal sampling frequency', xles_temp_sampling ) + + if ( tpbudiachro%lnorm ) then + if ( cles_norm_type == 'NONE' ) then + call Att_write( ygroup, igrpid, 'normalization', 'none' ) + else if ( cles_norm_type == 'CONV' ) then + call Att_write( ygroup, igrpid, 'normalization', 'convective' ) + ! cbl_height_def determines how the boundary layer height is computed, which is used in this normalization + call Att_write( ygroup, igrpid, 'definition of boundary layer height', cbl_height_def ) + else if ( cles_norm_type == 'EKMA' ) then + call Att_write( ygroup, igrpid, 'normalization', 'Ekman' ) + ! cbl_height_def determines how the boundary layer height is computed, which is used in this normalization + call Att_write( ygroup, igrpid, 'definition of boundary layer height', cbl_height_def ) + else if ( cles_norm_type == 'MOBU' ) then + call Att_write( ygroup, igrpid, 'normalization', 'Monin-Obukhov' ) + else + call Print_msg( NVERB_WARNING, 'IO', 'Write_diachro_nc4', Trim( tzfile%cname ) // & + ': group ' // Trim( ygroup ) // ': unknown normalization' ) + call Att_write( ygroup, igrpid, 'normalization', 'unknown' ) + end if + else + call Att_write( ygroup, igrpid, 'normalization', 'none' ) + end if - if ( trim ( ytype ) == 'CART' ) then - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'averaged on x dimension', Merge( 1, 0, tpbudiachro%licompress ) ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'averaged on x dimension '//trim(ygroup)//' group' ) + else if ( tpbudiachro%ccategory == 'LES' .and. tpbudiachro%cshape == '2-point correlation' ) then + call Att_write( ygroup, igrpid, 'direction of 2-point correlation', tpbudiachro%cdirection ) + + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + + call Att_write( ygroup, igrpid, 'temporal sampling frequency', xles_temp_sampling ) + + else if ( tpbudiachro%ccategory == 'LES' .and. tpbudiachro%cshape == 'spectrum' ) then + call Att_write( ygroup, igrpid, 'direction of spectrum', tpbudiachro%cdirection ) + + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + + call Att_write( ygroup, igrpid, 'temporal sampling frequency', xles_temp_sampling ) + + else if ( ( tpbudiachro%ccategory == 'aircraft' & + .or. tpbudiachro%ccategory == 'radiosonde balloon' & + .or. tpbudiachro%ccategory == 'iso-density balloon' & + .or. tpbudiachro%ccategory == 'constant volume balloon' ) & + .and. tpbudiachro%cshape == 'point' ) then + + else if ( ( tpbudiachro%ccategory == 'aircraft' & + .or. tpbudiachro%ccategory == 'radiosonde balloon' & + .or. tpbudiachro%ccategory == 'iso-density balloon' & + .or. tpbudiachro%ccategory == 'constant volume balloon' ) & + .and. tpbudiachro%cshape == 'vertical profile' ) then + + else if ( tpbudiachro%ccategory == 'profiler' .and. tpbudiachro%cshape == 'vertical profile' ) then + else if ( tpbudiachro%ccategory == 'station' .and. tpbudiachro%cshape == 'point' ) then + + else if ( tpbudiachro%cgroupname == 'TSERIES' ) then + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + call Att_write( ygroup, igrpid, 'min K index in physical domain', ikl ) + call Att_write( ygroup, igrpid, 'max K index in physical domain', ikh ) + + call Att_write( ygroup, igrpid, 'averaged in the I direction', Merge( 'yes', 'no ', tpbudiachro%licompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the J direction', Merge( 'yes', 'no ', tpbudiachro%ljcompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the K direction', Merge( 'yes', 'no ', tpbudiachro%lkcompress ) ) + + else if ( tpbudiachro%cgroupname == 'ZTSERIES' ) then + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + call Att_write( ygroup, igrpid, 'min K index in physical domain', ikl ) + call Att_write( ygroup, igrpid, 'max K index in physical domain', ikh ) + + call Att_write( ygroup, igrpid, 'averaged in the I direction', Merge( 'yes', 'no ', tpbudiachro%licompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the J direction', Merge( 'yes', 'no ', tpbudiachro%ljcompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the K direction', Merge( 'yes', 'no ', tpbudiachro%lkcompress ) ) + + else if ( tpbudiachro%cgroupname(1:8) == 'XTSERIES' ) then + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + call Att_write( ygroup, igrpid, 'min K index in physical domain', ikl ) + call Att_write( ygroup, igrpid, 'max K index in physical domain', ikh ) + + call Att_write( ygroup, igrpid, 'averaged in the I direction', Merge( 'yes', 'no ', tpbudiachro%licompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the J direction', Merge( 'yes', 'no ', tpbudiachro%ljcompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the K direction', Merge( 'yes', 'no ', tpbudiachro%lkcompress ) ) - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'averaged on y dimension', Merge( 1, 0, tpbudiachro%ljcompress ) ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'averaged on y dimension '//trim(ygroup)//' group' ) + else + call Print_msg( NVERB_WARNING, 'IO', 'Write_diachro_nc4', & + 'unknown group definition for ' // Trim( tpbudiachro%cname ) // ': using default behavior' ) + + call Att_write( ygroup, igrpid, 'min I index in physical domain', iil ) + call Att_write( ygroup, igrpid, 'max I index in physical domain', iih ) + call Att_write( ygroup, igrpid, 'min J index in physical domain', ijl ) + call Att_write( ygroup, igrpid, 'max J index in physical domain', ijh ) + call Att_write( ygroup, igrpid, 'min K index in physical domain', ikl ) + call Att_write( ygroup, igrpid, 'max K index in physical domain', ikh ) + + call Att_write( ygroup, igrpid, 'averaged in the I direction', Merge( 'yes', 'no ', tpbudiachro%licompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the J direction', Merge( 'yes', 'no ', tpbudiachro%ljcompress ) ) + call Att_write( ygroup, igrpid, 'averaged in the K direction', Merge( 'yes', 'no ', tpbudiachro%lkcompress ) ) end if - if ( trim ( ytype ) == 'CART' .or. trim ( ytype ) == 'MASK' .or. trim ( ytype ) == 'SPXY') then - istatus = NF90_PUT_ATT( igrpid, NF90_GLOBAL, 'averaged on z dimension', Merge( 1, 0, tpbudiachro%lkcompress ) ) - if (istatus /= NF90_NOERR ) & - call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', 'averaged on z dimension '//trim(ygroup)//' group' ) - end if end if end if MASTER @@ -1581,6 +1686,69 @@ if ( osplit ) then end if end subroutine Prepare_diachro_write + + +subroutine Att_write_c0( hgroup, kgrpid, hattname, hdata ) +use NETCDF, only: NF90_PUT_ATT, NF90_GLOBAL, NF90_NOERR + +use modd_precision, only: CDFINT + +use mode_io_tools_nc4, only: IO_Err_handle_nc4 + +character(len=*), intent(in) :: hgroup +integer(kind=CDFINT), intent(in) :: kgrpid +character(len=*), intent(in) :: hattname +character(len=*), intent(in) :: hdata + +integer(kind=CDFINT) :: istatus + +istatus = NF90_PUT_ATT( kgrpid, NF90_GLOBAL, hattname, Trim( hdata ) ) +if (istatus /= NF90_NOERR ) & + call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', Trim( hattname ) // ' for '// Trim( hgroup ) // ' group' ) + +end subroutine Att_write_c0 + + +subroutine Att_write_i0( hgroup, kgrpid, hattname, kdata ) +use NETCDF, only: NF90_PUT_ATT, NF90_GLOBAL, NF90_NOERR + +use modd_precision, only: CDFINT + +use mode_io_tools_nc4, only: IO_Err_handle_nc4 + +character(len=*), intent(in) :: hgroup +integer(kind=CDFINT), intent(in) :: kgrpid +character(len=*), intent(in) :: hattname +integer, intent(in) :: kdata + +integer(kind=CDFINT) :: istatus + +istatus = NF90_PUT_ATT( kgrpid, NF90_GLOBAL, hattname, kdata ) +if (istatus /= NF90_NOERR ) & + call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', Trim( hattname ) // ' for '// Trim( hgroup ) // ' group' ) + +end subroutine Att_write_i0 + + +subroutine Att_write_x0( hgroup, kgrpid, hattname, pdata ) +use NETCDF, only: NF90_PUT_ATT, NF90_GLOBAL, NF90_NOERR + +use modd_precision, only: CDFINT + +use mode_io_tools_nc4, only: IO_Err_handle_nc4 + +character(len=*), intent(in) :: hgroup +integer(kind=CDFINT), intent(in) :: kgrpid +character(len=*), intent(in) :: hattname +real, intent(in) :: pdata + +integer(kind=CDFINT) :: istatus + +istatus = NF90_PUT_ATT( kgrpid, NF90_GLOBAL, hattname, pdata ) +if (istatus /= NF90_NOERR ) & + call IO_Err_handle_nc4( istatus, 'Write_diachro_nc4', 'NF90_PUT_ATT', Trim( hattname ) // ' for '// Trim( hgroup ) // ' group' ) + +end subroutine Att_write_x0 #endif end module mode_write_diachro diff --git a/src/MNH/write_profilern.f90 b/src/MNH/write_profilern.f90 index e0ed5fcfd6b4bb0d8e4117996d9d8a85f67da5e1..18e0bceac9bf6f022690fa5165e0381acbe7b017 100644 --- a/src/MNH/write_profilern.f90 +++ b/src/MNH/write_profilern.f90 @@ -660,6 +660,8 @@ tzbudiachro%lmobile = .false. tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. tzbudiachro%lkcompress = .false. +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. tzbudiachro%nil = 1 tzbudiachro%nih = 1 tzbudiachro%njl = 1 diff --git a/src/MNH/write_seriesn.f90 b/src/MNH/write_seriesn.f90 index e0aa67be2a6e3884202bd00288f5cbff50d3594c..a448ab1b8958f7f89b9ac972d7ebfa00d76f6d60 100644 --- a/src/MNH/write_seriesn.f90 +++ b/src/MNH/write_seriesn.f90 @@ -269,6 +269,8 @@ tzbudiachro%lmobile = .false. tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. tzbudiachro%lkcompress = .true. +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. tzbudiachro%nil = niboxl tzbudiachro%nih = niboxh tzbudiachro%njl = njboxl @@ -364,6 +366,8 @@ tzbudiachro%lmobile = .false. tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. tzbudiachro%lkcompress = .false. +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. tzbudiachro%nil = niboxl tzbudiachro%nih = niboxh tzbudiachro%njl = njboxl @@ -463,6 +467,8 @@ DO JS=1,NBJSLICE tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .true. tzbudiachro%lkcompress = .true. + tzbudiachro%ltcompress = .false. + tzbudiachro%lnorm = .false. tzbudiachro%nil = 1 tzbudiachro%nih = iiu_ll tzbudiachro%njl = 1 diff --git a/src/MNH/write_stationn.f90 b/src/MNH/write_stationn.f90 index ecacfb93518111d04e6787461c881bb4f14c4648..5dc5a8b515d70dd0aaf248cc00ecd77d2c0fcc76 100644 --- a/src/MNH/write_stationn.f90 +++ b/src/MNH/write_stationn.f90 @@ -745,6 +745,8 @@ tzbudiachro%lmobile = .false. tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. tzbudiachro%lkcompress = .false. +tzbudiachro%ltcompress = .false. +tzbudiachro%lnorm = .false. tzbudiachro%nil = 1 tzbudiachro%nih = 1 tzbudiachro%njl = 1