From da42c62f11f27fe995bf3a50ef73414e52f93fcc Mon Sep 17 00:00:00 2001 From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr> Date: Thu, 4 Mar 2021 13:11:12 +0100 Subject: [PATCH] Philippe 04/03/2021: budgets: set values to cname and ccomment of tzbudiachro variables + write them --- src/MNH/mode_les_diachro.f90 | 30 +++++++++++++++++++----------- src/MNH/write_aircraft_balloon.f90 | 17 +++++++++++++---- src/MNH/write_diachro.f90 | 8 ++++++++ src/MNH/write_profilern.f90 | 4 ++-- src/MNH/write_seriesn.f90 | 12 ++++++------ src/MNH/write_stationn.f90 | 4 ++-- 6 files changed, 50 insertions(+), 25 deletions(-) diff --git a/src/MNH/mode_les_diachro.f90 b/src/MNH/mode_les_diachro.f90 index 23c41a7e9..dce2773ea 100644 --- a/src/MNH/mode_les_diachro.f90 +++ b/src/MNH/mode_les_diachro.f90 @@ -983,14 +983,18 @@ if ( oavg ) call Les_time_avg_4d( zfield, tzdates, iresp ) if ( oavg ) then if ( onorm ) then ygroup = 'H_' // tpfield%cmnhname + tzbudiachro%ccomment = Trim( tpfield%ccomment ) // ' (normalized and time averaged)' else ygroup = 'A_' // tpfield%cmnhname + tzbudiachro%ccomment = Trim( tpfield%ccomment ) // ' (time averaged)' end if else if ( onorm ) then ygroup = 'E_' // tpfield%cmnhname + tzbudiachro%ccomment = Trim( tpfield%ccomment ) // ' (normalized)' else ygroup = tpfield%cmnhname + tzbudiachro%ccomment = Trim( tpfield%ccomment ) end if endif @@ -1027,8 +1031,8 @@ if ( iresp == 0 .and. any( zfield /= XUNDEF ) ) then tzfields(:)%ccomment = ycomment(:) tzbudiachro%cgroupname = ygroup - tzbudiachro%cname = '' - tzbudiachro%ccomment = '' + tzbudiachro%cname = ygroup + !tzbudiachro%ccomment = DONE BEFORE tzbudiachro%ctype = 'SSOL' tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. @@ -1090,7 +1094,7 @@ end subroutine Les_diachro_2pt !------------------------------------------------------------------------------- !####################################################################### -subroutine Les_diachro_2pt_1d_intern( tpdiafile, tpfield, yavg, pfield ) +subroutine Les_diachro_2pt_1d_intern( tpdiafile, tpfield, gavg, pfield ) !####################################################################### use modd_field, only: NMNHDIM_BUDGET_LES_AVG_TIME, NMNHDIM_BUDGET_LES_TIME, NMNHDIM_UNUSED, & @@ -1105,7 +1109,7 @@ use mode_write_diachro, only: Write_diachro type(tfiledata), intent(in) :: tpdiafile! file to write type(tfield_metadata_base), intent(in) :: tpfield ! Metadata of field pfield -logical, intent(in) :: yavg +logical, intent(in) :: gavg real, dimension(:,:,:), intent(in) :: pfield character(len=6) :: ystring @@ -1192,7 +1196,7 @@ tzfield%ccomment = ycomment(:) !* time average iresp = 0 -if ( yavg ) then +if ( gavg ) then call Les_time_avg( zwork6, tzdates, iresp ) ygroup = 'T_'//ygroup @@ -1202,8 +1206,12 @@ if ( yavg ) then end if tzbudiachro%cgroupname = ygroup -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = ygroup +if ( .not. gavg ) then + tzbudiachro%ccomment = tzfield%ccomment +else + tzbudiachro%ccomment = Trim( tzfield%ccomment ) // ' (time averaged)' +end if tzbudiachro%ctype = 'SPXY' tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. @@ -1355,8 +1363,8 @@ tzfield%clongname = ygroup tzfield%ccomment = ycomment(:) tzbudiachro%cgroupname = ygroup -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = ygroup +tzbudiachro%ccomment = tzfield%ccomment tzbudiachro%ctype = 'SPXY' tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. @@ -1380,8 +1388,8 @@ do ji = 1, NMNHMAXDIMS end do tzbudiachro%cgroupname = ygroup -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = ygroup +tzbudiachro%ccomment = Trim( tzfield%ccomment ) // ' (time averaged)' tzbudiachro%ctype = 'SPXY' tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .false. diff --git a/src/MNH/write_aircraft_balloon.f90 b/src/MNH/write_aircraft_balloon.f90 index 3bc2034a1..769a5f975 100644 --- a/src/MNH/write_aircraft_balloon.f90 +++ b/src/MNH/write_aircraft_balloon.f90 @@ -865,9 +865,18 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED tzfields(:)%ndimlist(6) = NMNHDIM_FLYER_PROC tzbudiachro%cgroupname = ygroup -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = ygroup +tzbudiachro%ccomment = 'Values at position of flyer ' // Trim( tpflyer%title ) tzbudiachro%ctype = 'RSPL' +! tzbudiachro%licompress = NOT SET (default values) +! tzbudiachro%ljcompress = NOT SET (default values) +! tzbudiachro%lkcompress = NOT SET (default values) +! tzbudiachro%nil = NOT SET (default values) +! tzbudiachro%nih = NOT SET (default values) +! tzbudiachro%njl = NOT SET (default values) +! tzbudiachro%njh = NOT SET (default values) +! tzbudiachro%nkl = NOT SET (default values) +! tzbudiachro%nkh = NOT SET (default values) call Write_diachro( tpdiafile, tzbudiachro, tzfields, tpflyer%tpdates, zw6, & ptrajx = ztrajx, ptrajy = ztrajy, ptrajz = ztrajz, & @@ -893,8 +902,8 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED tzfields(:)%ndimlist(6) = NMNHDIM_FLYER_PROC tzbudiachro%cgroupname = ygroupz -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = ygroupz +tzbudiachro%ccomment = 'Vertical profiles at position of flyer ' // Trim( tpflyer%title ) tzbudiachro%ctype = 'CART' tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. diff --git a/src/MNH/write_diachro.f90 b/src/MNH/write_diachro.f90 index 8236c6c76..cc4e2625f 100644 --- a/src/MNH/write_diachro.f90 +++ b/src/MNH/write_diachro.f90 @@ -691,6 +691,14 @@ 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' ) diff --git a/src/MNH/write_profilern.f90 b/src/MNH/write_profilern.f90 index ec89311b3..90f3dae76 100644 --- a/src/MNH/write_profilern.f90 +++ b/src/MNH/write_profilern.f90 @@ -653,8 +653,8 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED tzfields(:)%ndimlist(6) = NMNHDIM_PROFILER_PROC tzbudiachro%cgroupname = ygroup -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = ygroup +tzbudiachro%ccomment = 'Vertical profiles at position of profiler ' // Trim( ygroup ) tzbudiachro%ctype = 'CART' tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. diff --git a/src/MNH/write_seriesn.f90 b/src/MNH/write_seriesn.f90 index 50a2fdb14..1729e726d 100644 --- a/src/MNH/write_seriesn.f90 +++ b/src/MNH/write_seriesn.f90 @@ -260,8 +260,8 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED tzfields(:)%ndimlist(6) = NMNHDIM_SERIES_PROC tzbudiachro%cgroupname = 'TSERIES' -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = 'TSERIES' +tzbudiachro%ccomment = 'Time series of horizontally and vertically averaged fields' tzbudiachro%ctype = 'CART' tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. @@ -352,8 +352,8 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED tzfields(:)%ndimlist(6) = NMNHDIM_SERIES_PROC tzbudiachro%cgroupname = 'ZTSERIES' -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = 'ZTSERIES' +tzbudiachro%ccomment = 'Time series of horizontally averaged vertical profile' tzbudiachro%ctype = 'CART' tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. @@ -448,8 +448,8 @@ DO JS=1,NBJSLICE tzfields(:)%ndimlist(6) = NMNHDIM_SERIES_PROC tzbudiachro%cgroupname = ygroup - tzbudiachro%cname = '' - tzbudiachro%ccomment = '' + tzbudiachro%cname = ygroup + tzbudiachro%ccomment = 'Time series of y-horizontally averaged fields at one level or vertically averaged between 2 levels' tzbudiachro%ctype = 'SSOL' tzbudiachro%licompress = .false. tzbudiachro%ljcompress = .true. diff --git a/src/MNH/write_stationn.f90 b/src/MNH/write_stationn.f90 index b9f23d7bb..2c6f6553f 100644 --- a/src/MNH/write_stationn.f90 +++ b/src/MNH/write_stationn.f90 @@ -736,8 +736,8 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED tzfields(:)%ndimlist(6) = NMNHDIM_STATION_PROC tzbudiachro%cgroupname = ygroup -tzbudiachro%cname = '' -tzbudiachro%ccomment = '' +tzbudiachro%cname = ygroup +tzbudiachro%ccomment = 'Values at position of station ' // Trim( ygroup ) tzbudiachro%ctype = 'CART' tzbudiachro%licompress = .true. tzbudiachro%ljcompress = .true. -- GitLab