From 5e1734d675c427f4227d7a41dabc9ef623351ec2 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Thu, 14 Jan 2021 16:24:28 +0100
Subject: [PATCH] Philippe 14/01/2021: budgets: tpdates dummy argument not
 necessary for Write_diachro_nc4

---
 src/MNH/write_budget.f90  | 2 ++
 src/MNH/write_diachro.f90 | 7 +++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/MNH/write_budget.f90 b/src/MNH/write_budget.f90
index f160bdf9b..263779e9f 100644
--- a/src/MNH/write_budget.f90
+++ b/src/MNH/write_budget.f90
@@ -184,6 +184,7 @@ subroutine Write_budget( tpdiafile, tpdtcur, ptstep, ksv )
   !* 2.1    Initialization
   !
       ALLOCATE( ZWORKTEMP(1) )
+      !Note: tzdates are used only in LFI files; for netCDF files, dates are written in the coordinates
       allocate( tzdates(1) )
   !
       !Compute time at the middle of the temporally-averaged budget timestep
@@ -206,6 +207,7 @@ subroutine Write_budget( tpdiafile, tpdtcur, ptstep, ksv )
   !
     CASE('MASK')
       ALLOCATE(ZWORKTEMP(nbusubwrite))
+      !Note: tzdates are used only in LFI files; for netCDF files, dates are written in the coordinates
       allocate( tzdates(nbusubwrite) )
   !
       CALL DATETIME_DISTANCE(TDTEXP,TPDTCUR,ZWORKTEMP(nbusubwrite))
diff --git a/src/MNH/write_diachro.f90 b/src/MNH/write_diachro.f90
index 65b3783ce..8c0b8543a 100644
--- a/src/MNH/write_diachro.f90
+++ b/src/MNH/write_diachro.f90
@@ -103,7 +103,7 @@ IMPLICIT NONE
 TYPE(TFILEDATA),                                     INTENT(IN)           :: TPDIAFILE    ! file to write
 class(tfield_metadata_base), dimension(:),           intent(in)           :: tpfields
 CHARACTER(LEN=*),                                    INTENT(IN)           :: HGROUP, HTYPE
-type(date_time),             dimension(:),           intent(in)           :: tpdates
+type(date_time),             dimension(:),           intent(in)           :: tpdates  !Used only for LFI files
 REAL,                        DIMENSION(:,:,:,:,:,:), INTENT(IN)           :: PVAR
 LOGICAL,                                             INTENT(IN), OPTIONAL :: OICP, OJCP, OKCP
 INTEGER,                                             INTENT(IN), OPTIONAL :: KIL, KIH
@@ -152,7 +152,7 @@ if ( tpdiafile%cformat == 'LFI' .or. tpdiafile%cformat == 'LFICDF4' ) &
 
 #ifdef MNH_IOCDF4
 if ( tpdiafile%cformat == 'NETCDF4' .or. tpdiafile%cformat == 'LFICDF4' ) &
-  call Write_diachro_nc4( tpdiafile, tpfields, hgroup, htype, tpdates, pvar, gicp, gjcp, gkcp, kil, kih, kjl, kjh, kkl, kkh, &
+  call Write_diachro_nc4( tpdiafile, tpfields, hgroup, htype, pvar, gicp, gjcp, gkcp, kil, kih, kjl, kjh, kkl, kkh, &
                           osplit, tpflyer )
 #endif
 
@@ -625,7 +625,7 @@ end subroutine Write_diachro_lfi
 
 #ifdef MNH_IOCDF4
 !-----------------------------------------------------------------------------
-subroutine Write_diachro_nc4( tpdiafile, tpfields, hgroup, htype, tpdates, pvar, oicp, ojcp, okcp, kil, kih, kjl, kjh, kkl, kkh, &
+subroutine Write_diachro_nc4( tpdiafile, tpfields, hgroup, htype, pvar, oicp, ojcp, okcp, kil, kih, kjl, kjh, kkl, kkh, &
                               osplit, tpflyer )
 
 use NETCDF,            only: NF90_DEF_DIM, NF90_DEF_GRP, NF90_DEF_VAR, NF90_INQ_NCID, NF90_PUT_ATT, NF90_PUT_VAR, &
@@ -647,7 +647,6 @@ use mode_io_tools_nc4,     only: IO_Err_handle_nc4
 type(tfiledata),                                     intent(in)           :: tpdiafile        ! File to write
 class(tfield_metadata_base), dimension(:),           intent(in)           :: tpfields
 character(len=*),                                    intent(in)           :: hgroup, htype
-type(date_time),             dimension(:),           intent(in)           :: tpdates
 real,                        dimension(:,:,:,:,:,:), intent(in)           :: pvar
 logical,                                             intent(in)           :: oicp, ojcp, okcp
 integer,                                             intent(in), optional :: kil, kih
-- 
GitLab