From 7024f4c1e961f5deaa5e6b906de1c8c3756b4cf4 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Tue, 18 May 2021 10:31:11 +0200
Subject: [PATCH] Philippe 18/05/2021: budgets: minor: change order of fields
 in tbudiachrometadata

---
 src/MNH/modd_budget.f90            | 2 +-
 src/MNH/mode_les_diachro.f90       | 8 ++++----
 src/MNH/write_aircraft_balloon.f90 | 4 ++--
 src/MNH/write_budget.f90           | 4 ++--
 src/MNH/write_profilern.f90        | 2 +-
 src/MNH/write_seriesn.f90          | 6 +++---
 src/MNH/write_stationn.f90         | 2 +-
 7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/MNH/modd_budget.f90 b/src/MNH/modd_budget.f90
index 4aed374f8..0a02d5480 100644
--- a/src/MNH/modd_budget.f90
+++ b/src/MNH/modd_budget.f90
@@ -106,10 +106,10 @@ type, extends( tfield_metadata_base ) :: tburhodata
 end type tburhodata
 
 type :: tbudiachrometadata
-  character(len=NBUNAMELGTMAX)  :: cgroupname  = CNOTSET
   character(len=NBUNAMELGTMAX)  :: cname       = CNOTSET
   character(len=NCOMMENTLGTMAX) :: ccomment    = CNOTSET
   character(len=NBUNAMELGTMAX)  :: ccategory   = CNOTSET !budget, LES, aircraft, balloon, series, station, profiler
+  character(len=NBUNAMELGTMAX)  :: cgroupname  = CNOTSET
   character(len=NBUNAMELGTMAX)  :: cshape      = CNOTSET !Shape of the domain (mask, cartesian, vertical profile, point)
   character(len=NBUNAMELGTMAX)  :: cmask       = CNOTSET !Mask defining where data is of meaning
   character(len=1)              :: cdirection  = ''        !Used for 2pt correlation and spectrum
diff --git a/src/MNH/mode_les_diachro.f90 b/src/MNH/mode_les_diachro.f90
index 5747d2340..3be9be3bd 100644
--- a/src/MNH/mode_les_diachro.f90
+++ b/src/MNH/mode_les_diachro.f90
@@ -1068,10 +1068,10 @@ if ( iresp == 0 .and. any( zfield /= XUNDEF ) ) then
   tzfields(:)%clongname = ytitle(:)
   tzfields(:)%ccomment  = ycomment(:)
 
-  tzbudiachro%cgroupname = ygroup
   tzbudiachro%cname      = ygroup
   !tzbudiachro%ccomment   = DONE BEFORE
   tzbudiachro%ccategory  = 'LES'
+  tzbudiachro%cgroupname = ygroup
   tzbudiachro%cshape     = 'cartesian'
   tzbudiachro%lmobile    = .false.
   tzbudiachro%licompress = .true.
@@ -1259,7 +1259,6 @@ if ( gavg ) then
   end do
 end if
 
-tzbudiachro%cgroupname = ygroup
 tzbudiachro%cname      = ygroup
 if ( .not. gavg ) then
   tzbudiachro%ccomment = tzfield%ccomment
@@ -1267,6 +1266,7 @@ else
   tzbudiachro%ccomment = Trim( tzfield%ccomment ) // ' (time averaged)'
 end if
 tzbudiachro%ccategory  = 'LES'
+tzbudiachro%cgroupname = ygroup
 tzbudiachro%cshape     = '2-point correlation'
 ! tzbudiachro%cmask      = CNOTSET
 if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_2PTS_NI ) then
@@ -1421,10 +1421,10 @@ tzfield%cmnhname  = ygroup
 tzfield%clongname = ygroup
 tzfield%ccomment  = ycomment(:)
 
-tzbudiachro%cgroupname = ygroup
 tzbudiachro%cname      = ygroup
 tzbudiachro%ccomment   = tzfield%ccomment
 tzbudiachro%ccategory  = 'LES'
+tzbudiachro%cgroupname = ygroup
 tzbudiachro%cshape     = 'spectrum'
 ! tzbudiachro%cmask      = CNOTSET
 if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_SPEC_NI ) then
@@ -1459,10 +1459,10 @@ end do
 tzfield%cmnhname  = ygroup
 tzfield%clongname = ygroup
 
-tzbudiachro%cgroupname = ygroup
 tzbudiachro%cname      = ygroup
 tzbudiachro%ccomment   = Trim( tzfield%ccomment ) // ' (time averaged)'
 tzbudiachro%ccategory  = 'LES'
+tzbudiachro%cgroupname = ygroup
 tzbudiachro%cshape     = 'spectrum'
 ! tzbudiachro%cmask      = CNOTSET
 if ( tzfield%ndimlist(1) == NMNHDIM_SPECTRA_SPEC_NI ) then
diff --git a/src/MNH/write_aircraft_balloon.f90 b/src/MNH/write_aircraft_balloon.f90
index 60f5db69d..c2d69198f 100644
--- a/src/MNH/write_aircraft_balloon.f90
+++ b/src/MNH/write_aircraft_balloon.f90
@@ -852,7 +852,6 @@ tzfields(:)%ndimlist(4) = NMNHDIM_FLYER_TIME
 tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED
 tzfields(:)%ndimlist(6) = NMNHDIM_FLYER_PROC
 
-tzbudiachro%cgroupname = ygroup
 tzbudiachro%cname      = ygroup
 tzbudiachro%ccomment   = 'Values at position of flyer ' // Trim( tpflyer%title )
 if ( Trim( tpflyer%type ) == 'AIRCRA' ) then
@@ -867,6 +866,7 @@ else
   call Print_msg( NVERB_ERROR, 'IO', 'WRITE_AIRCRAFT_BALLOON', 'unknown category for flyer ' // Trim( tpflyer%title ) )
   tzbudiachro%ccategory  = 'unknown'
 end if
+tzbudiachro%cgroupname = ygroup
 tzbudiachro%cshape     = 'point'
 ! tzbudiachro%cmask      = NOT SET (default values)
 tzbudiachro%lmobile    = .true.
@@ -904,10 +904,10 @@ tzfields(:)%ndimlist(4) = NMNHDIM_FLYER_TIME
 tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED
 tzfields(:)%ndimlist(6) = NMNHDIM_FLYER_PROC
 
-tzbudiachro%cgroupname = ygroupz
 tzbudiachro%cname      = ygroupz
 tzbudiachro%ccomment   = 'Vertical profiles at position of flyer ' // Trim( tpflyer%title )
 ! tzbudiachro%ccategory  =  !unchanged
+tzbudiachro%cgroupname = ygroupz
 tzbudiachro%cshape     = 'vertical profile'
 ! tzbudiachro%cmask      = NOT SET (default values)
 tzbudiachro%lmobile    = .true.
diff --git a/src/MNH/write_budget.f90 b/src/MNH/write_budget.f90
index 99af4b02e..6c73943bf 100644
--- a/src/MNH/write_budget.f90
+++ b/src/MNH/write_budget.f90
@@ -557,10 +557,10 @@ subroutine Store_one_budget_rho( tpdiafile, tpdates, tprhodj, kp, knocompress, p
     tzfield%ndimlist(:) = NMNHDIM_UNKNOWN
   end if
 
-  tzbudiachro%cgroupname = ygroup_name
   tzbudiachro%cname      = tprhodj%cmnhname
   tzbudiachro%ccomment   = tprhodj%ccomment
   tzbudiachro%ccategory  = 'budget'
+  tzbudiachro%cgroupname = ygroup_name
   if ( ybutype == 'CART' ) then
     tzbudiachro%cshape   = 'cartesian'
     ! tzbudiachro%cmask    = NOT SET (default values)
@@ -815,10 +815,10 @@ subroutine Store_one_budget( tpdiafile, tpdates, tpbudget, prhodjn, knocompress,
     end if
   end do
 
-  tzbudiachro%cgroupname = ygroup_name
   tzbudiachro%cname      = tpbudget%cname
   tzbudiachro%ccomment   = tpbudget%ccomment
   tzbudiachro%ccategory  = 'budget'
+  tzbudiachro%cgroupname = ygroup_name
   if ( ybutype == 'CART' ) then
     tzbudiachro%cshape   = 'cartesian'
     ! tzbudiachro%cmask    = NOT SET (default values)
diff --git a/src/MNH/write_profilern.f90 b/src/MNH/write_profilern.f90
index 7bda486cc..5dd83fc80 100644
--- a/src/MNH/write_profilern.f90
+++ b/src/MNH/write_profilern.f90
@@ -650,10 +650,10 @@ tzfields(:)%ndimlist(4) = NMNHDIM_PROFILER_TIME
 tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED
 tzfields(:)%ndimlist(6) = NMNHDIM_PROFILER_PROC
 
-tzbudiachro%cgroupname = ygroup
 tzbudiachro%cname      = ygroup
 tzbudiachro%ccomment   = 'Vertical profiles at position of profiler ' // Trim( ygroup )
 tzbudiachro%ccategory  = 'profiler'
+tzbudiachro%cgroupname = ygroup
 tzbudiachro%cshape     = 'vertical profile'
 ! tzbudiachro%cmask     = NOT SET (default values)
 tzbudiachro%lmobile    = .false.
diff --git a/src/MNH/write_seriesn.f90 b/src/MNH/write_seriesn.f90
index 6b8b2bcfa..e8a677364 100644
--- a/src/MNH/write_seriesn.f90
+++ b/src/MNH/write_seriesn.f90
@@ -261,10 +261,10 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED
 ! tzfields(:)%ndimlist(6) = NMNHDIM_SERIES_PROC
 tzfields(:)%ndimlist(6) = NMNHDIM_UNUSED !Set to unused because write are done in a loop (1 write per "process")
 
-tzbudiachro%cgroupname = 'TSERIES'
 tzbudiachro%cname      = 'TSERIES'
 tzbudiachro%ccomment   = 'Time series of horizontally and vertically averaged fields'
 tzbudiachro%ccategory  = 'time series'
+tzbudiachro%cgroupname = 'TSERIES'
 tzbudiachro%cshape     = 'cartesian' !It is based on a cartesian domain (with compression in all directions)
 ! tzbudiachro%cmask    =  set in the process loop
 tzbudiachro%lmobile    = .false.
@@ -366,10 +366,10 @@ tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED
 ! tzfields(:)%ndimlist(6) = NMNHDIM_SERIES_PROC
 tzfields(:)%ndimlist(6) = NMNHDIM_UNUSED !Set to unused because write are done in a loop (1 write per "process")
 
-tzbudiachro%cgroupname = 'ZTSERIES'
 tzbudiachro%cname      = 'ZTSERIES'
 tzbudiachro%ccomment   = 'Time series of horizontally averaged vertical profile'
 tzbudiachro%ccategory  = 'time series'
+tzbudiachro%cgroupname = 'ZTSERIES'
 tzbudiachro%cshape     = 'cartesian'  !It is based on a cartesian domain (with horizontal compression)
 ! tzbudiachro%cmask    =  set in the process loop
 tzbudiachro%lmobile    = .false.
@@ -473,10 +473,10 @@ DO JS=1,NBJSLICE
   tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED
   tzfields(:)%ndimlist(6) = NMNHDIM_SERIES_PROC
 
-  tzbudiachro%cgroupname = ygroup
   tzbudiachro%cname      = ygroup
   tzbudiachro%ccomment   = 'Time series of y-horizontally averaged fields at one level or vertically averaged between 2 levels'
   tzbudiachro%ccategory  = 'time series'
+  tzbudiachro%cgroupname = ygroup
   tzbudiachro%cshape     = 'cartesian' !It is based on a cartesian domain (with compression in 1 direction)
 !  tzbudiachro%cmask      = NOT SET (default values)
   tzbudiachro%lmobile    = .false.
diff --git a/src/MNH/write_stationn.f90 b/src/MNH/write_stationn.f90
index d20e5ef0c..8697653f9 100644
--- a/src/MNH/write_stationn.f90
+++ b/src/MNH/write_stationn.f90
@@ -735,10 +735,10 @@ tzfields(:)%ndimlist(4) = NMNHDIM_STATION_TIME
 tzfields(:)%ndimlist(5) = NMNHDIM_UNUSED
 tzfields(:)%ndimlist(6) = NMNHDIM_STATION_PROC
 
-tzbudiachro%cgroupname = ygroup
 tzbudiachro%cname      = ygroup
 tzbudiachro%ccomment   = 'Values at position of station ' // Trim( ygroup )
 tzbudiachro%ccategory  = 'station'
+tzbudiachro%cgroupname = ygroup
 tzbudiachro%cshape     = 'point'
 ! tzbudiachro%cmask     = NOT SET (default values)
 tzbudiachro%lmobile    = .false.
-- 
GitLab