Skip to content
Snippets Groups Projects
Commit a8cb5e5b authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 01/07/2021: budgets: LES: use level "group" for netCDF files

parent bd9e8411
No related branches found
No related tags found
No related merge requests found
...@@ -654,15 +654,17 @@ end if ...@@ -654,15 +654,17 @@ end if
end function Les_time_avg_1pt end function Les_time_avg_1pt
!####################################################################### !##############################################################################################
subroutine Les_diachro_1D( tpdiafile, tpfield, odoavg, odonorm, pfield ) subroutine Les_diachro_1D( tpdiafile, tpfield, hgroup, hgroupcomment, odoavg, odonorm, pfield )
!####################################################################### !##############################################################################################
use modd_field, only: NMNHDIM_BUDGET_LES_TIME, NMNHDIM_UNUSED, tfield_metadata_base use modd_field, only: NMNHDIM_BUDGET_LES_TIME, NMNHDIM_UNUSED, tfield_metadata_base
use modd_io, only: tfiledata use modd_io, only: tfiledata
type(tfiledata), intent(in) :: tpdiafile ! File to write type(tfiledata), intent(in) :: tpdiafile ! File to write
type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field
character(len=*), intent(in) :: hgroup ! Group of the field
character(len=*), intent(in) :: hgroupcomment
logical, intent(in) :: odoavg ! Compute and store time average logical, intent(in) :: odoavg ! Compute and store time average
logical, intent(in) :: odonorm ! Compute and store normalized field logical, intent(in) :: odonorm ! Compute and store normalized field
real, dimension(:), intent(in) :: pfield ! Data array real, dimension(:), intent(in) :: pfield ! Data array
...@@ -687,7 +689,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_TIME ) then ...@@ -687,7 +689,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_TIME ) then
tzfield%ndimlist(1) = NMNHDIM_UNUSED tzfield%ndimlist(1) = NMNHDIM_UNUSED
tzfield%ndimlist(3) = NMNHDIM_UNUSED tzfield%ndimlist(3) = NMNHDIM_UNUSED
tzfield%ndimlist(4) = NMNHDIM_UNUSED tzfield%ndimlist(4) = NMNHDIM_UNUSED
call Les_diachro_common( tpdiafile, tzfield, reshape( pfield, [ 1, size( pfield, 1 ), 1, 1 ] ), & call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, reshape( pfield, [ 1, size( pfield, 1 ), 1, 1 ] ), &
odoavg, odonorm ) odoavg, odonorm )
else else
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_1D', & call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_1D', &
...@@ -696,9 +698,9 @@ end if ...@@ -696,9 +698,9 @@ end if
end subroutine Les_diachro_1D end subroutine Les_diachro_1D
!####################################################################### !##############################################################################################
subroutine Les_diachro_2D( tpdiafile, tpfield, odoavg, odonorm, pfield ) subroutine Les_diachro_2D( tpdiafile, tpfield, hgroup, hgroupcomment, odoavg, odonorm, pfield )
!####################################################################### !##############################################################################################
use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_SV, NMNHDIM_BUDGET_LES_TIME, NMNHDIM_UNUSED, & use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_SV, NMNHDIM_BUDGET_LES_TIME, NMNHDIM_UNUSED, &
tfield_metadata_base tfield_metadata_base
...@@ -706,6 +708,8 @@ use modd_io, only: tfiledata ...@@ -706,6 +708,8 @@ use modd_io, only: tfiledata
type(tfiledata), intent(in) :: tpdiafile ! File to write type(tfiledata), intent(in) :: tpdiafile ! File to write
type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field
character(len=*), intent(in) :: hgroup ! Group of the field
character(len=*), intent(in) :: hgroupcomment
logical, intent(in) :: odoavg ! Compute and store time average logical, intent(in) :: odoavg ! Compute and store time average
logical, intent(in) :: odonorm ! Compute and store normalized field logical, intent(in) :: odonorm ! Compute and store normalized field
real, dimension(:,:), intent(in) :: pfield ! Data array real, dimension(:,:), intent(in) :: pfield ! Data array
...@@ -729,7 +733,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & ...@@ -729,7 +733,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
.and. tzfield%ndimlist(2) == NMNHDIM_BUDGET_LES_TIME ) then .and. tzfield%ndimlist(2) == NMNHDIM_BUDGET_LES_TIME ) then
tzfield%ndimlist(3) = NMNHDIM_UNUSED tzfield%ndimlist(3) = NMNHDIM_UNUSED
tzfield%ndimlist(4) = NMNHDIM_UNUSED tzfield%ndimlist(4) = NMNHDIM_UNUSED
call Les_diachro_common( tpdiafile, tzfield, & call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, &
reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), 1, 1 ] ), & reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), 1, 1 ] ), &
odoavg, odonorm ) odoavg, odonorm )
else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_TIME & else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_TIME &
...@@ -738,7 +742,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_TIME & ...@@ -738,7 +742,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_TIME &
tzfield%ndimlist(2) = tzfield%ndimlist(1) tzfield%ndimlist(2) = tzfield%ndimlist(1)
tzfield%ndimlist(1) = NMNHDIM_UNUSED tzfield%ndimlist(1) = NMNHDIM_UNUSED
tzfield%ndimlist(3) = NMNHDIM_UNUSED tzfield%ndimlist(3) = NMNHDIM_UNUSED
call Les_diachro_common( tpdiafile, tzfield, & call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, &
reshape( pfield, [ 1, size( pfield, 1 ), 1, size( pfield, 2 ) ] ), & reshape( pfield, [ 1, size( pfield, 1 ), 1, size( pfield, 2 ) ] ), &
odoavg, odonorm ) odoavg, odonorm )
else else
...@@ -749,9 +753,9 @@ end if ...@@ -749,9 +753,9 @@ end if
end subroutine Les_diachro_2D end subroutine Les_diachro_2D
!########################################################################################## !#################################################################################################################
subroutine Les_diachro_3D( tpdiafile, tpfield, odoavg, odonorm, pfield, hsuffixes, hmasks ) subroutine Les_diachro_3D( tpdiafile, tpfield, hgroup, hgroupcomment, odoavg, odonorm, pfield, hsuffixes, hmasks )
!########################################################################################## !#################################################################################################################
use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_MASK, NMNHDIM_BUDGET_LES_SV, & use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_MASK, NMNHDIM_BUDGET_LES_SV, &
NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_TERM, NMNHDIM_UNUSED, & NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_TERM, NMNHDIM_UNUSED, &
...@@ -760,6 +764,8 @@ use modd_io, only: tfiledata ...@@ -760,6 +764,8 @@ use modd_io, only: tfiledata
type(tfiledata), intent(in) :: tpdiafile ! File to write type(tfiledata), intent(in) :: tpdiafile ! File to write
type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field
character(len=*), intent(in) :: hgroup ! Group of the field
character(len=*), intent(in) :: hgroupcomment
logical, intent(in) :: odoavg ! Compute and store time average logical, intent(in) :: odoavg ! Compute and store time average
logical, intent(in) :: odonorm ! Compute and store normalized field logical, intent(in) :: odonorm ! Compute and store normalized field
real, dimension(:,:,:), intent(in) :: pfield ! Data array real, dimension(:,:,:), intent(in) :: pfield ! Data array
...@@ -792,7 +798,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & ...@@ -792,7 +798,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_3D', 'wrong size for hmasks (' // Trim( tzfield%cmnhname ) // ')' ) call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_3D', 'wrong size for hmasks (' // Trim( tzfield%cmnhname ) // ')' )
tzfield%ndimlist(4) = NMNHDIM_UNUSED tzfield%ndimlist(4) = NMNHDIM_UNUSED
call Les_diachro_common( tpdiafile, tzfield, & call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, &
reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), size( pfield, 3 ), 1 ] ), & reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), size( pfield, 3 ), 1 ] ), &
odoavg, odonorm, hmasks = hmasks ) odoavg, odonorm, hmasks = hmasks )
else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
...@@ -806,7 +812,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & ...@@ -806,7 +812,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_3D', 'wrong size for hsuffixes (' // Trim( tzfield%cmnhname ) // ')' ) call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_3D', 'wrong size for hsuffixes (' // Trim( tzfield%cmnhname ) // ')' )
tzfield%ndimlist(4) = NMNHDIM_UNUSED tzfield%ndimlist(4) = NMNHDIM_UNUSED
call Les_diachro_common( tpdiafile, tzfield, & call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, &
reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), size( pfield, 3 ), 1 ] ), & reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), size( pfield, 3 ), 1 ] ), &
odoavg, odonorm, hsuffixes = hsuffixes ) odoavg, odonorm, hsuffixes = hsuffixes )
else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
...@@ -822,7 +828,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & ...@@ -822,7 +828,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
tzfield%ndimlist(4) = tzfield%ndimlist(3) tzfield%ndimlist(4) = tzfield%ndimlist(3)
tzfield%ndimlist(3) = NMNHDIM_UNUSED tzfield%ndimlist(3) = NMNHDIM_UNUSED
call Les_diachro_common( tpdiafile, tzfield, & call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, &
reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), 1, size( pfield, 3 ) ] ), & reshape( pfield, [ size( pfield, 1 ), size( pfield, 2 ), 1, size( pfield, 3 ) ] ), &
odoavg, odonorm ) odoavg, odonorm )
else else
...@@ -832,9 +838,9 @@ end if ...@@ -832,9 +838,9 @@ end if
end subroutine Les_diachro_3D end subroutine Les_diachro_3D
!########################################################################################## !#################################################################################################################
subroutine Les_diachro_4D( tpdiafile, tpfield, odoavg, odonorm, pfield, hsuffixes, hmasks ) subroutine Les_diachro_4D( tpdiafile, tpfield, hgroup, hgroupcomment, odoavg, odonorm, pfield, hsuffixes, hmasks )
!########################################################################################## !#################################################################################################################
use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_MASK, NMNHDIM_BUDGET_LES_SV, & use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_MASK, NMNHDIM_BUDGET_LES_SV, &
NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_TERM, NMNHDIM_UNUSED, & NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_TERM, NMNHDIM_UNUSED, &
...@@ -842,7 +848,9 @@ use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_MASK, NMNHDIM ...@@ -842,7 +848,9 @@ use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_MASK, NMNHDIM
use modd_io, only: tfiledata use modd_io, only: tfiledata
type(tfiledata), intent(in) :: tpdiafile ! File to write type(tfiledata), intent(in) :: tpdiafile ! File to write
type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field
character(len=*), intent(in) :: hgroup ! Group of the field
character(len=*), intent(in) :: hgroupcomment
logical, intent(in) :: odoavg ! Compute and store time average logical, intent(in) :: odoavg ! Compute and store time average
logical, intent(in) :: odonorm ! Compute and store normalized field logical, intent(in) :: odonorm ! Compute and store normalized field
real, dimension(:,:,:,:), intent(in) :: pfield ! Data array real, dimension(:,:,:,:), intent(in) :: pfield ! Data array
...@@ -875,7 +883,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL& ...@@ -875,7 +883,7 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL&
if ( Size( hmasks ) /= Size( pfield, 3) ) & if ( Size( hmasks ) /= Size( pfield, 3) ) &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_4D', 'wrong size for hmasks (' // Trim( tzfield%cmnhname ) // ')' ) call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_4D', 'wrong size for hmasks (' // Trim( tzfield%cmnhname ) // ')' )
call Les_diachro_common( tpdiafile, tzfield, pfield, odoavg, odonorm, hmasks = hmasks ) call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, pfield, odoavg, odonorm, hmasks = hmasks )
else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
.and. tzfield%ndimlist(2) == NMNHDIM_BUDGET_LES_TIME & .and. tzfield%ndimlist(2) == NMNHDIM_BUDGET_LES_TIME &
.and. tzfield%ndimlist(3) == NMNHDIM_BUDGET_TERM & .and. tzfield%ndimlist(3) == NMNHDIM_BUDGET_TERM &
...@@ -887,7 +895,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL & ...@@ -887,7 +895,7 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
if ( Size( hsuffixes ) /= Size( pfield, 3) ) & if ( Size( hsuffixes ) /= Size( pfield, 3) ) &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_4D', 'wrong size for hsuffixes (' // Trim( tzfield%cmnhname ) // ')' ) call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_4D', 'wrong size for hsuffixes (' // Trim( tzfield%cmnhname ) // ')' )
call Les_diachro_common( tpdiafile, tzfield, pfield, odoavg, odonorm, hsuffixes= hsuffixes ) call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, pfield, odoavg, odonorm, hsuffixes= hsuffixes )
else else
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', & call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'ndimlist configuration not yet implemented for ' // Trim( tzfield%cmnhname ) ) 'ndimlist configuration not yet implemented for ' // Trim( tzfield%cmnhname ) )
...@@ -895,9 +903,9 @@ end if ...@@ -895,9 +903,9 @@ end if
end subroutine Les_diachro_4D end subroutine Les_diachro_4D
!############################################################################################## !#####################################################################################################################
subroutine Les_diachro_common( tpdiafile, tpfield, pfield, odoavg, odonorm, hsuffixes, hmasks ) subroutine Les_diachro_common( tpdiafile, tpfield, hgroup, hgroupcomment, pfield, odoavg, odonorm, hsuffixes, hmasks )
!############################################################################################## !#####################################################################################################################
use modd_field, only: tfield_metadata_base use modd_field, only: tfield_metadata_base
use modd_io, only: tfiledata use modd_io, only: tfiledata
...@@ -910,6 +918,8 @@ implicit none ...@@ -910,6 +918,8 @@ implicit none
type(tfiledata), intent(in) :: tpdiafile ! File to write type(tfiledata), intent(in) :: tpdiafile ! File to write
type(tfield_metadata_base), intent(in) :: tpfield type(tfield_metadata_base), intent(in) :: tpfield
character(len=*), intent(in) :: hgroup ! Group of the field
character(len=*), intent(in) :: hgroupcomment
real, dimension(:,:,:,:), intent(in) :: pfield ! Data array real, dimension(:,:,:,:), intent(in) :: pfield ! Data array
logical, intent(in) :: odoavg ! Compute and store time average logical, intent(in) :: odoavg ! Compute and store time average
logical, intent(in) :: odonorm ! Compute and store normalized field logical, intent(in) :: odonorm ! Compute and store normalized field
...@@ -947,7 +957,7 @@ if ( Present( hsuffixes ) ) then ...@@ -947,7 +957,7 @@ if ( Present( hsuffixes ) ) then
'at the same time (' // Trim( tpfield%cmnhname ) // ')' ) 'at the same time (' // Trim( tpfield%cmnhname ) // ')' )
if ( Size( hsuffixes ) /= Size( pfield, 3) ) & if ( Size( hsuffixes ) /= Size( pfield, 3) ) &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_common', 'wrong size for hsuffixes (' // Trim( tpfield%cmnhname ) // ')' ) call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_common', 'wrong size for hsuffixes (' // Trim( tpfield%cmnhname ) // ')' )
ycomment(:) = Trim( tpfield%ccomment(:) ) // ' ' // hsuffixes(:) ycomment(:) = Trim( tpfield%ccomment(:) ) // ': ' // hsuffixes(:)
else if ( Present( hmasks ) ) then else if ( Present( hmasks ) ) then
if ( Size( hmasks ) /= Size( pfield, 3) ) & if ( Size( hmasks ) /= Size( pfield, 3) ) &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_common', 'wrong size for hmasks (' // Trim( tpfield%cmnhname ) // ')' ) call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_common', 'wrong size for hmasks (' // Trim( tpfield%cmnhname ) // ')' )
...@@ -1018,7 +1028,8 @@ iresp = 0 ...@@ -1018,7 +1028,8 @@ iresp = 0
if ( oavg ) call Les_time_avg_4d( zfield, tzdates, iresp ) if ( oavg ) call Les_time_avg_4d( zfield, tzdates, iresp )
if ( Present( hsuffixes ) ) then if ( Present( hsuffixes ) ) then
ytitle(:) = Trim( tpfield%cmnhname ) // '_' // hsuffixes(:) !ytitle(:) = Trim( tpfield%cmnhname ) // '_' // hsuffixes(:)
ytitle(:) = hsuffixes(:)
else else
ytitle(:) = tpfield%cmnhname ytitle(:) = tpfield%cmnhname
endif endif
...@@ -1057,9 +1068,9 @@ if ( iresp == 0 .and. any( zfield /= XUNDEF ) ) then ...@@ -1057,9 +1068,9 @@ if ( iresp == 0 .and. any( zfield /= XUNDEF ) ) then
tzbudiachro%clevels (NLVL_SUBCATEGORY) = '' tzbudiachro%clevels (NLVL_SUBCATEGORY) = ''
tzbudiachro%ccomments(NLVL_SUBCATEGORY) = '' tzbudiachro%ccomments(NLVL_SUBCATEGORY) = ''
tzbudiachro%lleveluse(NLVL_GROUP) = .false. tzbudiachro%lleveluse(NLVL_GROUP) = .true.
tzbudiachro%clevels (NLVL_GROUP) = '' tzbudiachro%clevels (NLVL_GROUP) = Trim( hgroup )
tzbudiachro%ccomments(NLVL_GROUP) = '' tzbudiachro%ccomments(NLVL_GROUP) = Trim( hgroupcomment )
tzbudiachro%lleveluse(NLVL_SHAPE) = .true. tzbudiachro%lleveluse(NLVL_SHAPE) = .true.
tzbudiachro%clevels (NLVL_SHAPE) = 'Cartesian' tzbudiachro%clevels (NLVL_SHAPE) = 'Cartesian'
...@@ -1296,12 +1307,12 @@ tzbudiachro%lleveluse(NLVL_SUBCATEGORY) = .false. ...@@ -1296,12 +1307,12 @@ tzbudiachro%lleveluse(NLVL_SUBCATEGORY) = .false.
tzbudiachro%clevels (NLVL_SUBCATEGORY) = '' tzbudiachro%clevels (NLVL_SUBCATEGORY) = ''
tzbudiachro%ccomments(NLVL_SUBCATEGORY) = '' tzbudiachro%ccomments(NLVL_SUBCATEGORY) = ''
tzbudiachro%lleveluse(NLVL_GROUP) = .false. tzbudiachro%lleveluse(NLVL_GROUP) = .true.
tzbudiachro%clevels (NLVL_GROUP) = '' tzbudiachro%clevels (NLVL_GROUP) = 'Two_point_correlation'
tzbudiachro%ccomments(NLVL_GROUP) = '' tzbudiachro%ccomments(NLVL_GROUP) = ''
tzbudiachro%lleveluse(NLVL_SHAPE) = .true. tzbudiachro%lleveluse(NLVL_SHAPE) = .false.
tzbudiachro%clevels (NLVL_SHAPE) = 'Two_point_correlation' tzbudiachro%clevels (NLVL_SHAPE) = ''
tzbudiachro%ccomments(NLVL_SHAPE) = '' tzbudiachro%ccomments(NLVL_SHAPE) = ''
tzbudiachro%lleveluse(NLVL_TIMEAVG) = .true. tzbudiachro%lleveluse(NLVL_TIMEAVG) = .true.
...@@ -1487,12 +1498,12 @@ tzbudiachro%lleveluse(NLVL_SUBCATEGORY) = .false. ...@@ -1487,12 +1498,12 @@ tzbudiachro%lleveluse(NLVL_SUBCATEGORY) = .false.
tzbudiachro%clevels (NLVL_SUBCATEGORY) = '' tzbudiachro%clevels (NLVL_SUBCATEGORY) = ''
tzbudiachro%ccomments(NLVL_SUBCATEGORY) = '' tzbudiachro%ccomments(NLVL_SUBCATEGORY) = ''
tzbudiachro%lleveluse(NLVL_GROUP) = .false. tzbudiachro%lleveluse(NLVL_GROUP) = .true.
tzbudiachro%clevels (NLVL_GROUP) = '' tzbudiachro%clevels (NLVL_GROUP) = 'Spectrum'
tzbudiachro%ccomments(NLVL_GROUP) = '' tzbudiachro%ccomments(NLVL_GROUP) = ''
tzbudiachro%lleveluse(NLVL_SHAPE) = .true. tzbudiachro%lleveluse(NLVL_SHAPE) = .false.
tzbudiachro%clevels (NLVL_SHAPE) = 'Spectrum' tzbudiachro%clevels (NLVL_SHAPE) = ''
tzbudiachro%ccomments(NLVL_SHAPE) = '' tzbudiachro%ccomments(NLVL_SHAPE) = ''
tzbudiachro%lleveluse(NLVL_TIMEAVG) = .true. tzbudiachro%lleveluse(NLVL_TIMEAVG) = .true.
...@@ -1549,12 +1560,12 @@ tzbudiachro%lleveluse(NLVL_SUBCATEGORY) = .false. ...@@ -1549,12 +1560,12 @@ tzbudiachro%lleveluse(NLVL_SUBCATEGORY) = .false.
tzbudiachro%clevels (NLVL_SUBCATEGORY) = '' tzbudiachro%clevels (NLVL_SUBCATEGORY) = ''
tzbudiachro%ccomments(NLVL_SUBCATEGORY) = '' tzbudiachro%ccomments(NLVL_SUBCATEGORY) = ''
tzbudiachro%lleveluse(NLVL_GROUP) = .false. tzbudiachro%lleveluse(NLVL_GROUP) = .true.
tzbudiachro%clevels (NLVL_GROUP) = '' tzbudiachro%clevels (NLVL_GROUP) = 'Spectrum'
tzbudiachro%ccomments(NLVL_GROUP) = '' tzbudiachro%ccomments(NLVL_GROUP) = ''
tzbudiachro%lleveluse(NLVL_SHAPE) = .true. tzbudiachro%lleveluse(NLVL_SHAPE) = .false.
tzbudiachro%clevels (NLVL_SHAPE) = 'Spectrum' tzbudiachro%clevels (NLVL_SHAPE) = ''
tzbudiachro%ccomments(NLVL_SHAPE) = '' tzbudiachro%ccomments(NLVL_SHAPE) = ''
tzbudiachro%lleveluse(NLVL_TIMEAVG) = .true. tzbudiachro%lleveluse(NLVL_TIMEAVG) = .true.
......
...@@ -255,6 +255,8 @@ else if ( tpbudiachro%clevels(NLVL_GROUP) == 'RhodJ' ) then ...@@ -255,6 +255,8 @@ else if ( tpbudiachro%clevels(NLVL_GROUP) == 'RhodJ' ) then
else if ( tpbudiachro%nsv > 0 ) then else if ( tpbudiachro%nsv > 0 ) then
Allocate( character(len=9) :: ygroup ) Allocate( character(len=9) :: ygroup )
Write( ygroup, '( "SV", i3.3, i4.4 )' ) tpbudiachro%nsv, nbutshift Write( ygroup, '( "SV", i3.3, i4.4 )' ) tpbudiachro%nsv, nbutshift
else if ( tpbudiachro%clevels(NLVL_CATEGORY) == 'LES_budgets' .and. tpbudiachro%clevels(NLVL_GROUP)(1:3)/='BU_' ) then
ygroup = Trim( tpfields(1)%cmnhname )
else else
ygroup = Trim( tpbudiachro%clevels(NLVL_GROUP) ) ygroup = Trim( tpbudiachro%clevels(NLVL_GROUP) )
end if end if
...@@ -285,7 +287,7 @@ if ( Trim( tpbudiachro%clevels(NLVL_CATEGORY) ) == 'LES_budgets' & ...@@ -285,7 +287,7 @@ if ( Trim( tpbudiachro%clevels(NLVL_CATEGORY) ) == 'LES_budgets' &
end if end if
if ( Trim( tpbudiachro%clevels(NLVL_CATEGORY) ) == 'LES_budgets' & if ( Trim( tpbudiachro%clevels(NLVL_CATEGORY) ) == 'LES_budgets' &
.and. Trim( tpbudiachro%clevels(NLVL_SHAPE) ) == 'Spectrum' ) then .and. Trim( tpbudiachro%clevels(NLVL_GROUP) ) == 'Spectrum' ) then
if ( tpbudiachro%ltcompress ) then if ( tpbudiachro%ltcompress ) then
ygroup = 'T_' // Trim( ygroup ) ygroup = 'T_' // Trim( ygroup )
!Limit to 10 characters (backward compatibility again...) !Limit to 10 characters (backward compatibility again...)
......
...@@ -99,7 +99,8 @@ INTEGER :: JK ! vertical loop counter ...@@ -99,7 +99,8 @@ INTEGER :: JK ! vertical loop counter
INTEGER :: JT ! temporal loop counter INTEGER :: JT ! temporal loop counter
! !
CHARACTER(len=9), DIMENSION(NMAX_ILES) :: YSUBTITLE CHARACTER(len=9), DIMENSION(NMAX_ILES) :: YSUBTITLE
CHARACTER(len=8) :: YGROUP character(len=:), allocatable :: ygroup
character(len=:), allocatable :: ygroupcomment
! !
REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLES_BUDGET REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLES_BUDGET
! !
...@@ -131,7 +132,8 @@ gdonorm = Trim( cles_norm_type ) /= 'NONE' ...@@ -131,7 +132,8 @@ gdonorm = Trim( cles_norm_type ) /= 'NONE'
!* 1. total (resolved+subgrid) kinetic energy budget !* 1. total (resolved+subgrid) kinetic energy budget
! ------------------------------------ ! ------------------------------------
! !
YGROUP= 'BU_KE' ygroup = 'BU_KE'
ygroupcomment = 'Total (resolved+subgrid) kinetic energy budget'
ILES=0 ILES=0
ILES_STA=ILES ILES_STA=ILES
! !
...@@ -432,13 +434,14 @@ END DO ...@@ -432,13 +434,14 @@ END DO
! ------- ! -------
! !
! !
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = 'resolved KE budget' tzfield%ccomment = 'resolved KE budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'm2 s-3' tzfield%cunits = 'm2 s-3'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
...@@ -446,7 +449,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), ...@@ -446,7 +449,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles),
!* 2. temperature variance budget !* 2. temperature variance budget
! --------------------------- ! ---------------------------
! !
YGROUP= 'BU_THL2' ygroup = 'BU_THL2'
ygroupcomment = 'Temperature variance budget'
ILES=0 ILES=0
! !
ILES_STA=ILES ILES_STA=ILES
...@@ -684,20 +688,22 @@ ZLES_BUDGET(NLES_K,:,ILES) = ZLES_BUDGET(NLES_K-1,:,ILES) ...@@ -684,20 +688,22 @@ ZLES_BUDGET(NLES_K,:,ILES) = ZLES_BUDGET(NLES_K-1,:,ILES)
! ------- ! -------
! !
! !
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = 'thetal variance budget' tzfield%ccomment = 'thetal variance budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'K2 s-1' tzfield%cunits = 'K2 s-1'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
!* 3. temperature flux budget !* 3. temperature flux budget
! --------------------- ! ---------------------
! !
YGROUP= 'BU_WTHL' ygroup = 'BU_WTHL'
ygroupcomment = 'Temperature flux budget'
ILES=0 ILES=0
! !
ILES_STA=ILES ILES_STA=ILES
...@@ -1002,13 +1008,14 @@ ZLES_BUDGET(:,:,ILES)=-XLES_RES_ddxa_Thl_SBG_UaW(:,:,1) & ...@@ -1002,13 +1008,14 @@ ZLES_BUDGET(:,:,ILES)=-XLES_RES_ddxa_Thl_SBG_UaW(:,:,1) &
! ------- ! -------
! !
! !
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = 'thetal flux budget' tzfield%ccomment = 'thetal flux budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'm K s-2' tzfield%cunits = 'm K s-2'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
......
...@@ -92,7 +92,8 @@ INTEGER :: JK ! vertical loop counter ...@@ -92,7 +92,8 @@ INTEGER :: JK ! vertical loop counter
INTEGER :: JT ! temporal loop counter INTEGER :: JT ! temporal loop counter
! !
CHARACTER(len=9), DIMENSION(NMAX_ILES) :: YSUBTITLE CHARACTER(len=9), DIMENSION(NMAX_ILES) :: YSUBTITLE
CHARACTER(len=8) :: YGROUP character(len=:), allocatable :: ygroup
character(len=:), allocatable :: ygroupcomment
! !
REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLES_BUDGET REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLES_BUDGET
! !
...@@ -125,7 +126,8 @@ gdonorm = Trim( cles_norm_type ) /= 'NONE' ...@@ -125,7 +126,8 @@ gdonorm = Trim( cles_norm_type ) /= 'NONE'
! --------------------------- ! ---------------------------
! !
! !
YGROUP= 'BU_RT2' ygroup = 'BU_RT2'
ygroupcomment = 'Total water variance budget'
ILES=0 ILES=0
ILES_STA=ILES ILES_STA=ILES
! !
...@@ -357,13 +359,14 @@ ZLES_BUDGET(NLES_K,:,ILES) = ZLES_BUDGET(NLES_K-1,:,ILES) ...@@ -357,13 +359,14 @@ ZLES_BUDGET(NLES_K,:,ILES) = ZLES_BUDGET(NLES_K-1,:,ILES)
!* 2.16 writing !* 2.16 writing
! ------- ! -------
! !
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = 'Rt variance budget' tzfield%ccomment = 'Rt variance budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'kg2 kg-2 s-1' tzfield%cunits = 'kg2 kg-2 s-1'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
...@@ -371,7 +374,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), ...@@ -371,7 +374,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles),
! ----------------------- ! -----------------------
! !
! !
YGROUP= 'BU_WRT' ygroup = 'BU_WRT'
ygroupcomment = 'Total water flux budget'
ILES=0 ILES=0
ILES_STA=ILES ILES_STA=ILES
! !
...@@ -668,13 +672,14 @@ ZLES_BUDGET(:,:,ILES)=-XLES_RES_ddxa_Rt_SBG_UaW(:,:,1) & ...@@ -668,13 +672,14 @@ ZLES_BUDGET(:,:,ILES)=-XLES_RES_ddxa_Rt_SBG_UaW(:,:,1) &
!* 3.22 writing !* 3.22 writing
! ------- ! -------
! !
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = 'Rt flux budget' tzfield%ccomment = 'Rt flux budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'm kg kg-1 s-2' tzfield%cunits = 'm kg kg-1 s-2'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
...@@ -682,6 +687,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), ...@@ -682,6 +687,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles),
! ------------------------------------------------------------ ! ------------------------------------------------------------
! !
! !
ygroup = 'BU_THLR'
ygroupcomment = 'Liquid potential temperature - total water covariance budget'
YGROUP= 'BU_THLR' YGROUP= 'BU_THLR'
ILES=0 ILES=0
ILES_STA=ILES ILES_STA=ILES
...@@ -918,13 +925,14 @@ ZLES_BUDGET(NLES_K,:,ILES) = ZLES_BUDGET(NLES_K-1,:,ILES) ...@@ -918,13 +925,14 @@ ZLES_BUDGET(NLES_K,:,ILES) = ZLES_BUDGET(NLES_K-1,:,ILES)
!* 2.16 writing !* 2.16 writing
! ------- ! -------
! !
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = 'Thl-Rt covariance budget' tzfield%ccomment = 'Thl-Rt covariance budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'K kg kg-1 s-1' tzfield%cunits = 'K kg kg-1 s-1'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
......
...@@ -93,8 +93,8 @@ INTEGER :: JSV! scalar loop counter ...@@ -93,8 +93,8 @@ INTEGER :: JSV! scalar loop counter
INTEGER :: JP ! process loop counter INTEGER :: JP ! process loop counter
! !
CHARACTER(len=9), DIMENSION(NMAX_ILES) :: YSUBTITLE CHARACTER(len=9), DIMENSION(NMAX_ILES) :: YSUBTITLE
CHARACTER(len=8) :: YGROUP character(len=:), allocatable :: ygroup
CHARACTER(len=20) :: YTITLE character(len=:), allocatable :: ygroupcomment
! !
REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZLES_BUDGET REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZLES_BUDGET
! !
...@@ -115,7 +115,8 @@ ZLES_BUDGET(:,:,:,:) = XUNDEF ...@@ -115,7 +115,8 @@ ZLES_BUDGET(:,:,:,:) = XUNDEF
! ---------------------------- ! ----------------------------
! !
! !
YGROUP='BU_SV2' ygroup = 'BU_SV2'
ygroupcomment = 'Total scalar variance budget'
! !
ILES=0 ILES=0
ILES_STA=ILES ILES_STA=ILES
...@@ -378,15 +379,13 @@ END DO ...@@ -378,15 +379,13 @@ END DO
!* 2.16 writing !* 2.16 writing
! ------- ! -------
! !
YTITLE = "Sv variance budget "
tzfield%ngrid = 0 !Not on the Arakawa grid tzfield%ngrid = 0 !Not on the Arakawa grid
tzfield%ntype = TYPEREAL tzfield%ntype = TYPEREAL
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = ytitle tzfield%ccomment = 'Sv variance budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'kg2 kg-2 s-1' tzfield%cunits = 'kg2 kg-2 s-1'
tzfield%ndims = 4 tzfield%ndims = 4
...@@ -399,7 +398,8 @@ tzfield%ndimlist(5:) = NMNHDIM_UNUSED ...@@ -399,7 +398,8 @@ tzfield%ndimlist(5:) = NMNHDIM_UNUSED
gdoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF gdoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF
gdonorm = trim(cles_norm_type) /= 'NONE' gdonorm = trim(cles_norm_type) /= 'NONE'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles, :), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles, :), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
...@@ -407,7 +407,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles, ...@@ -407,7 +407,8 @@ call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles,
! ----------------------- ! -----------------------
! !
! !
YGROUP = 'BU_WSV' ygroup = 'BU_WSV'
ygroupcomment = 'Total water flux budget'
! !
! !
ILES=0 ILES=0
...@@ -494,6 +495,7 @@ END IF ...@@ -494,6 +495,7 @@ END IF
! ----------- ! -----------
! !
ILES=ILES+1 ILES=ILES+1
!PW: not in documentation. Always set to 0
YSUBTITLE(ILES) = 'SBG_DISS' YSUBTITLE(ILES) = 'SBG_DISS'
! !
DO JSV=1,NSV DO JSV=1,NSV
...@@ -760,15 +762,13 @@ END DO ...@@ -760,15 +762,13 @@ END DO
!* 3.22 writing !* 3.22 writing
! ------- ! -------
! !
YTITLE = "Sv flux budget "
tzfield%ngrid = 0 !Not on the Arakawa grid tzfield%ngrid = 0 !Not on the Arakawa grid
tzfield%ntype = TYPEREAL tzfield%ntype = TYPEREAL
tzfield%cmnhname = ygroup tzfield%cmnhname = ygroup !cmnhname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%cstdname = '' tzfield%cstdname = ''
tzfield%clongname = ygroup tzfield%clongname = ygroup !clongname will be overwritten by ysubtitle(:) in Les_diachro
tzfield%ccomment = ytitle tzfield%ccomment = 'Sv flux budget' !ccomment will be completed with ysubtitle(:) in Les_diachro
tzfield%cunits = 'm kg kg-1 s-2' tzfield%cunits = 'm kg kg-1 s-2'
tzfield%ndims = 4 tzfield%ndims = 4
...@@ -781,7 +781,8 @@ tzfield%ndimlist(5:) = NMNHDIM_UNUSED ...@@ -781,7 +781,8 @@ tzfield%ndimlist(5:) = NMNHDIM_UNUSED
gdoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF gdoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF
gdonorm = trim(cles_norm_type) /= 'NONE' gdonorm = trim(cles_norm_type) /= 'NONE'
call Les_diachro( tpdiafile, tzfield, gdoavg, gdonorm, zles_budget(:, :, :iles, :), hsuffixes = ysubtitle(:iles) ) call Les_diachro( tpdiafile, tzfield, ygroup, ygroupcomment, gdoavg, gdonorm, &
zles_budget(:, :, :iles, :), hsuffixes = ysubtitle(:iles) )
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
......
...@@ -16,6 +16,9 @@ private ...@@ -16,6 +16,9 @@ private
public :: Write_les_n public :: Write_les_n
character(len=:), allocatable :: cgroup
character(len=:), allocatable :: cgroupcomment
logical :: ldoavg ! Compute and store time average logical :: ldoavg ! Compute and store time average
logical :: ldonorm ! Compute and store normalized field logical :: ldonorm ! Compute and store normalized field
...@@ -283,6 +286,9 @@ tfield%ndimlist(4:) = NMNHDIM_UNUSED ...@@ -283,6 +286,9 @@ tfield%ndimlist(4:) = NMNHDIM_UNUSED
ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF
ldonorm = .false. ldonorm = .false.
cgroup = 'Miscellaneous'
cgroupcomment = 'Miscellaneous terms (geometry, various unclassified averaged terms...)'
call Les_diachro_write( tpdiafile, zavg_pts_ll, 'AVG_PTS', 'number of points used for averaging', '1', ymasks ) call Les_diachro_write( tpdiafile, zavg_pts_ll, 'AVG_PTS', 'number of points used for averaging', '1', ymasks )
call Les_diachro_write( tpdiafile, zavg_pts_ll / zcart_pts_ll, 'AVG_PTSF', 'fraction of points used for averaging', '1', ymasks ) call Les_diachro_write( tpdiafile, zavg_pts_ll / zcart_pts_ll, 'AVG_PTSF', 'fraction of points used for averaging', '1', ymasks )
call Les_diachro_write( tpdiafile, zund_pts_ll, 'UND_PTS', 'number of points below orography', '1', ymasks ) call Les_diachro_write( tpdiafile, zund_pts_ll, 'UND_PTS', 'number of points below orography', '1', ymasks )
...@@ -294,6 +300,9 @@ DEALLOCATE(ZUND_PTS_ll) ...@@ -294,6 +300,9 @@ DEALLOCATE(ZUND_PTS_ll)
!* 2.1 mean quantities !* 2.1 mean quantities
! --------------- ! ---------------
! !
cgroup = 'Mean'
cgroupcomment = 'Mean vertical profiles of the model variables'
tfield%ndims = 3 tfield%ndims = 3
tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL
tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME
...@@ -374,6 +383,9 @@ call Les_diachro_write( tpdiafile, XLES_MEAN_WIND, 'MEANWIND', 'Profile of ...@@ -374,6 +383,9 @@ call Les_diachro_write( tpdiafile, XLES_MEAN_WIND, 'MEANWIND', 'Profile of
call Les_diachro_write( tpdiafile, XLES_RESOLVED_MASSFX, 'MEANMSFX', 'Total updraft mass flux', 'kg m-2 s-1', ymasks ) call Les_diachro_write( tpdiafile, XLES_RESOLVED_MASSFX, 'MEANMSFX', 'Total updraft mass flux', 'kg m-2 s-1', ymasks )
if ( lles_pdf ) then if ( lles_pdf ) then
cgroup = 'PDF'
cgroupcomment = ''
call Les_diachro_write( tpdiafile, XLES_PDF_TH, 'PDF_TH', 'Pdf potential temperature Profiles', '1', ymasks ) call Les_diachro_write( tpdiafile, XLES_PDF_TH, 'PDF_TH', 'Pdf potential temperature Profiles', '1', ymasks )
call Les_diachro_write( tpdiafile, XLES_PDF_W, 'PDF_W', 'Pdf vertical velocity Profiles', '1', ymasks ) call Les_diachro_write( tpdiafile, XLES_PDF_W, 'PDF_W', 'Pdf vertical velocity Profiles', '1', ymasks )
call Les_diachro_write( tpdiafile, XLES_PDF_THV, 'PDF_THV', 'Pdf virtual pot. temp. Profiles', '1', ymasks ) call Les_diachro_write( tpdiafile, XLES_PDF_THV, 'PDF_THV', 'Pdf virtual pot. temp. Profiles', '1', ymasks )
...@@ -402,6 +414,9 @@ if ( lles_resolved ) then ...@@ -402,6 +414,9 @@ if ( lles_resolved ) then
ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF
ldonorm = trim(cles_norm_type) /= 'NONE' ldonorm = trim(cles_norm_type) /= 'NONE'
cgroup = 'Resolved'
cgroupcomment = 'Mean vertical profiles of the resolved fluxes, variances and covariances'
tfield%ndims = 3 tfield%ndims = 3
tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL
tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME
...@@ -606,6 +621,9 @@ if ( lles_subgrid ) then ...@@ -606,6 +621,9 @@ if ( lles_subgrid ) then
ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF
ldonorm = trim(cles_norm_type) /= 'NONE' ldonorm = trim(cles_norm_type) /= 'NONE'
cgroup = 'Subgrid'
cgroupcomment = 'Mean vertical profiles of the subgrid fluxes, variances and covariances'
tfield%ndims = 3 tfield%ndims = 3
tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL
tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME
...@@ -724,6 +742,9 @@ ldonorm = trim(cles_norm_type) /= 'NONE' ...@@ -724,6 +742,9 @@ ldonorm = trim(cles_norm_type) /= 'NONE'
! ------------------ ! ------------------
! !
if ( lles_updraft ) then if ( lles_updraft ) then
cgroup = 'Updraft'
cgroupcomment = 'Updraft vertical profiles of some resolved and subgrid fluxes, variances and covariances'
call Les_diachro_write( tpdiafile, XLES_UPDRAFT, 'UP_FRAC', 'Updraft fraction', '1' ) call Les_diachro_write( tpdiafile, XLES_UPDRAFT, 'UP_FRAC', 'Updraft fraction', '1' )
call Les_diachro_write( tpdiafile, XLES_UPDRAFT_W, 'UP_W', 'Updraft W mean value', 'm s-1' ) call Les_diachro_write( tpdiafile, XLES_UPDRAFT_W, 'UP_W', 'Updraft W mean value', 'm s-1' )
call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Th, 'UP_TH', 'Updraft potential temperature mean value', 'K' ) call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Th, 'UP_TH', 'Updraft potential temperature mean value', 'K' )
...@@ -831,6 +852,9 @@ end if ...@@ -831,6 +852,9 @@ end if
! -------------------- ! --------------------
! !
if ( lles_downdraft ) then if ( lles_downdraft ) then
cgroup = 'Downdraft'
cgroupcomment = 'Downdraft vertical profiles of some resolved and subgrid fluxes, variances and covariances'
call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT, 'DW_FRAC', 'Downdraft fraction', '1' ) call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT, 'DW_FRAC', 'Downdraft fraction', '1' )
call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_W, 'DW_W', 'Downdraft W mean value', 'm s-1' ) call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_W, 'DW_W', 'Downdraft W mean value', 'm s-1' )
call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Th, 'DW_TH', 'Downdraft potential temperature mean value', 'K' ) call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Th, 'DW_TH', 'Downdraft potential temperature mean value', 'K' )
...@@ -946,7 +970,10 @@ end if ...@@ -946,7 +970,10 @@ end if
!* 3. surface normalization parameters !* 3. surface normalization parameters
! -------------------------------- ! --------------------------------
! !
!Prepare metadate (used in Les_diachro_write calls) cgroup = 'Miscellaneous'
cgroupcomment = 'Miscellaneous terms (geometry, various unclassified averaged terms...)'
!Prepare metadata (used in Les_diachro_write calls)
tfield%ndims = 2 tfield%ndims = 2
tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL
tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME
...@@ -965,6 +992,9 @@ call Les_diachro_write( tpdiafile, XLES_DTHRADLW, 'DTHRADLW', 'LW radiative temp ...@@ -965,6 +992,9 @@ call Les_diachro_write( tpdiafile, XLES_DTHRADLW, 'DTHRADLW', 'LW radiative temp
call Les_diachro_write( tpdiafile, XLES_RADEFF, 'RADEFF', 'Mean effective radius', 'micron' ) call Les_diachro_write( tpdiafile, XLES_RADEFF, 'RADEFF', 'Mean effective radius', 'micron' )
cgroup = 'Surface'
cgroupcomment = 'Averaged surface fields'
! !Prepare metadate (used in Les_diachro_write calls) ! !Prepare metadate (used in Les_diachro_write calls)
tfield%ndims = 1 tfield%ndims = 1
tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_TIME tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_TIME
...@@ -1162,7 +1192,7 @@ tfield%clongname = hmnhname ...@@ -1162,7 +1192,7 @@ tfield%clongname = hmnhname
tfield%ccomment = hcomment tfield%ccomment = hcomment
tfield%cunits = hunits tfield%cunits = hunits
call Les_diachro( tpdiafile, tfield, ldoavg, ldonorm, pdata ) call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata )
end subroutine Les_diachro_write_1D end subroutine Les_diachro_write_1D
...@@ -1185,7 +1215,7 @@ tfield%clongname = hmnhname ...@@ -1185,7 +1215,7 @@ tfield%clongname = hmnhname
tfield%ccomment = hcomment tfield%ccomment = hcomment
tfield%cunits = hunits tfield%cunits = hunits
call Les_diachro( tpdiafile, tfield, ldoavg, ldonorm, pdata ) call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata )
end subroutine Les_diachro_write_2D end subroutine Les_diachro_write_2D
...@@ -1209,7 +1239,7 @@ tfield%clongname = hmnhname ...@@ -1209,7 +1239,7 @@ tfield%clongname = hmnhname
tfield%ccomment = hcomment tfield%ccomment = hcomment
tfield%cunits = hunits tfield%cunits = hunits
call Les_diachro( tpdiafile, tfield, ldoavg, ldonorm, pdata, hmasks = hmasks ) call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata, hmasks = hmasks )
end subroutine Les_diachro_write_3D end subroutine Les_diachro_write_3D
...@@ -1233,7 +1263,7 @@ tfield%clongname = hmnhname ...@@ -1233,7 +1263,7 @@ tfield%clongname = hmnhname
tfield%ccomment = hcomment tfield%ccomment = hcomment
tfield%cunits = hunits tfield%cunits = hunits
call Les_diachro( tpdiafile, tfield, ldoavg, ldonorm, pdata, hmasks = hmasks ) call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata, hmasks = hmasks )
end subroutine Les_diachro_write_4D end subroutine Les_diachro_write_4D
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment