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

Philippe 01/07/2021: budgets: treat NMNHDIM_BUDGET_LES_PDF dimension in diachronic files

parent 0d05cfcd
No related branches found
No related tags found
No related merge requests found
......@@ -842,8 +842,8 @@ end subroutine Les_diachro_3D
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, &
NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_TERM, NMNHDIM_UNUSED, &
use modd_field, only: NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_MASK, NMNHDIM_BUDGET_LES_PDF, NMNHDIM_BUDGET_LES_SV, &
NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_TERM, NMNHDIM_UNUSED, &
tfield_metadata_base
use modd_io, only: tfiledata
......@@ -880,10 +880,13 @@ if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL&
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'optional dummy argument hmasks is needed for tpfield (' // Trim( tzfield%cmnhname ) // ')' )
if ( Present( hsuffixes ) ) &
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'optional dummy argument hsuffixes is not needed for tpfield (' // Trim( tzfield%cmnhname ) // ')' )
if ( Size( hmasks ) /= Size( pfield, 3) ) &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_4D', 'wrong size for hmasks (' // Trim( tzfield%cmnhname ) // ')' )
call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, pfield, odoavg, odonorm, hmasks = hmasks )
else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
.and. tzfield%ndimlist(2) == NMNHDIM_BUDGET_LES_TIME &
.and. tzfield%ndimlist(3) == NMNHDIM_BUDGET_TERM &
......@@ -892,15 +895,36 @@ else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'optional dummy argument hsuffixes is needed for tpfield (' // Trim( tzfield%cmnhname ) // ')' )
if ( Present( hmasks ) ) &
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'optional dummy argument hmasks is not needed for tpfield (' // Trim( tzfield%cmnhname ) // ')' )
if ( Size( hsuffixes ) /= Size( pfield, 3) ) &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_4D', 'wrong size for hsuffixes (' // Trim( tzfield%cmnhname ) // ')' )
call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, pfield, odoavg, odonorm, hsuffixes= hsuffixes )
else if ( tzfield%ndimlist(1) == NMNHDIM_BUDGET_LES_LEVEL &
.and. tzfield%ndimlist(2) == NMNHDIM_BUDGET_LES_TIME &
.and. tzfield%ndimlist(3) == NMNHDIM_BUDGET_LES_MASK &
.and. tzfield%ndimlist(4) == NMNHDIM_BUDGET_LES_PDF ) then
if ( .not. Present( hmasks ) ) &
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'optional dummy argument hmasks is needed for tpfield (' // Trim( tzfield%cmnhname ) // ')' )
if ( Present( hsuffixes ) ) &
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'optional dummy argument hsuffixes is not needed for tpfield (' // Trim( tzfield%cmnhname ) // ')' )
if ( Size( hmasks ) /= Size( pfield, 3) ) &
call Print_msg( NVERB_FATAL, 'IO', 'Les_diachro_4D', 'wrong size for hmasks (' // Trim( tzfield%cmnhname ) // ')' )
else
call Print_msg( NVERB_ERROR, 'IO', 'Les_diachro_4D', &
'ndimlist configuration not yet implemented for ' // Trim( tzfield%cmnhname ) )
end if
call Les_diachro_common( tpdiafile, tzfield, hgroup, hgroupcomment, pfield, odoavg, odonorm, &
hsuffixes = hsuffixes, hmasks = hmasks )
end subroutine Les_diachro_4D
!#####################################################################################################################
......
......@@ -1272,6 +1272,13 @@ select case ( idims )
do ji = 1, Size( pvar, 6 )
call Diachro_one_field_write_nc4( tzfile, tpbudiachro, tpfields(ji), pvar(:,:,:,:,:,ji:ji), [ 3, 4 ], gsplit, gdistributed )
end do
else if ( tpfields(1)%ndimlist(3) == NMNHDIM_BUDGET_LES_LEVEL &
.and. ( tpfields(1)%ndimlist(4) == NMNHDIM_BUDGET_LES_TIME &
.or. tpfields(1)%ndimlist(4) == NMNHDIM_BUDGET_LES_AVG_TIME ) &
.and. tpfields(1)%ndimlist(5) == NMNHDIM_BUDGET_LES_PDF ) then
if ( Size( tpfields ) /= 1 ) call Print_msg( NVERB_FATAL, 'IO', 'Write_diachro_nc4', &
'wrong size of tpfields (variable '//trim(tpfields(1)%cmnhname)//')' )
call Diachro_one_field_write_nc4( tzfile, tpbudiachro, tpfields(1), pvar, [ 3, 4, 5 ], gsplit, gdistributed )
else if ( tpfields(1)%ndimlist(3) == NMNHDIM_BUDGET_LES_LEVEL &
.and. ( tpfields(1)%ndimlist(4) == NMNHDIM_BUDGET_LES_TIME &
.or. tpfields(1)%ndimlist(4) == NMNHDIM_BUDGET_LES_AVG_TIME ) &
......
......@@ -80,6 +80,7 @@ subroutine Write_les_n( tpdiafile )
use modd_conf_n, only: luserv, luserc, luserr, luseri, lusers, luserg, luserh
use modd_io, only: tfiledata
use modd_field, only: NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_SV, NMNHDIM_BUDGET_LES_MASK, &
NMNHDIM_BUDGET_LES_PDF, &
NMNHDIM_SPECTRA_2PTS_NI, NMNHDIM_SPECTRA_2PTS_NJ, NMNHDIM_SPECTRA_LEVEL, NMNHDIM_UNUSED, &
TYPEREAL
use modd_grid_n, only: xdxhat, xdyhat
......@@ -386,6 +387,13 @@ if ( lles_pdf ) then
cgroup = 'PDF'
cgroupcomment = ''
tfield%ndims = 4
!tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL
!tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME
!tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK
tfield%ndimlist(4) = NMNHDIM_BUDGET_LES_PDF
tfield%ndimlist(5:) = NMNHDIM_UNUSED
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_THV, 'PDF_THV', 'Pdf virtual pot. temp. Profiles', '1', ymasks )
......
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