From acdb541a945259d7ba5d0f50090544cfebccd3b4 Mon Sep 17 00:00:00 2001
From: Gaelle Tanguy <gaelle.tanguy@meteo.fr>
Date: Fri, 27 Nov 2015 08:49:22 +0000
Subject: [PATCH] S.Bielli 11/2015 : correction for MNH_NCWRIT

---
 src/MNH/diag.f90             | 17 +++++++++++++++++
 src/MNH/modeln.f90           |  4 +++-
 src/MNH/write_phys_param.f90 | 11 +++++++----
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/MNH/diag.f90 b/src/MNH/diag.f90
index d7e3bdb0f..62f7bd158 100644
--- a/src/MNH/diag.f90
+++ b/src/MNH/diag.f90
@@ -72,6 +72,7 @@
 !!                                      aircraft, ballon and profiler
 !!  J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1
 !!   P.Tulet : 11/2015 : new diagnostic for aerosol
+!!  09/2015     (S. Bielli)    Add netcdf call for phys_param
 !!
 !-------------------------------------------------------------------------------
 !
@@ -702,10 +703,26 @@ ZCHEM=0.
 XTIME_LES=0.
 XTIME_LES_BU_PROCESS=0.
 XTIME_BU_PROCESS=0.
+#ifdef MNH_NCWRIT
+IF ( LNETCDF ) THEN
+  DEF_NC = .TRUE.
+  NC_WRITE=LNETCDF
+  NC_FILE='phy'
+  LLFIFM = .FALSE.
+  CALL WRITE_PHYS_PARAM(YFMFILE)
+  DEF_NC=.FALSE.
+  LLFIFM = .TRUE.
+END IF
 !
 CALL PHYS_PARAM_n(1,YFMFILE,GCLOSE_OUT,                           &
                   ZRAD,ZSHADOWS,ZDCONV,ZGROUND,ZMAFL,ZDRAG,       &
                   ZTURB,ZTRACER, ZCHEM,ZTIME_BU,GMASKkids)
+DEF_NC=.TRUE.
+#else
+CALL PHYS_PARAM_n(1,YFMFILE,GCLOSE_OUT,                           &
+                  ZRAD,ZSHADOWS,ZDCONV,ZGROUND,ZMAFL,ZDRAG,       &
+                  ZTURB,ZTRACER, ZCHEM,ZTIME_BU,GMASKkids)
+#endif       
 PRINT*, 'DIAG AFTER PHYS_PARAM1'
 !
 !* restores the initial flags
diff --git a/src/MNH/modeln.f90 b/src/MNH/modeln.f90
index 853e39c4c..a8fcfa64e 100644
--- a/src/MNH/modeln.f90
+++ b/src/MNH/modeln.f90
@@ -233,6 +233,8 @@ END MODULE MODI_MODEL_n
 !!                                      aircraft, ballon and profiler
 !!       C.Lac    11/09/2015: correction of the budget due to FIT temporal scheme
 !!      J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1
+!!                   Sep 2015 (S. Bielli) : Remove YDADFILE from argument call 
+!                              of write_phys_param
 !!-------------------------------------------------------------------------------
 !
 !*       0.     DECLARATIONS
@@ -1286,7 +1288,7 @@ IF ( LNETCDF .AND. GCLOSE_OUT ) THEN
   NC_WRITE=LNETCDF
   NC_FILE='phy'
   LLFIFM = .FALSE.
-  CALL WRITE_PHYS_PARAM(YFMFILE,YDADFILE)
+  CALL WRITE_PHYS_PARAM(YFMFILE)
   DEF_NC=.FALSE.
   LLFIFM = .TRUE.
 END IF
diff --git a/src/MNH/write_phys_param.f90 b/src/MNH/write_phys_param.f90
index eb23f8283..446fa2de3 100644
--- a/src/MNH/write_phys_param.f90
+++ b/src/MNH/write_phys_param.f90
@@ -9,7 +9,7 @@
 !
 INTERFACE
 !
-SUBROUTINE WRITE_PHYS_PARAM(HFMFILE,HDADFILE)
+SUBROUTINE WRITE_PHYS_PARAM(HFMFILE)
 CHARACTER(LEN=28), INTENT(IN) :: HFMFILE      ! Name of FM-file to write
 CHARACTER(LEN=28), INTENT(IN) :: HDADFILE     ! corresponding FM-file name of 
                                               ! its DAD model
@@ -21,7 +21,7 @@ END MODULE MODI_WRITE_PHYS_PARAM
 !
 !
 !     #############################################
-      SUBROUTINE WRITE_PHYS_PARAM(HFMFILE,HDADFILE)
+      SUBROUTINE WRITE_PHYS_PARAM(HFMFILE)
 !     #############################################
 !
 !!****  *WRITE_PHYS_PARAM* - routine to define the netcdf variables written in phys_param for model $n
@@ -78,6 +78,11 @@ END MODULE MODI_WRITE_PHYS_PARAM
 !!    ------
 !!  	S. Bielli   *Laboratoire d'Aerologie* 
 !!
+!!    MODIFICATIONS
+!!    -------------
+!!
+!!    09/2015 (S. Bielli)  Remove HDADFILE from call argument
+!!
 !-------------------------------------------------------------------------------
 !
 !*       0.    DECLARATIONS
@@ -159,8 +164,6 @@ IMPLICIT NONE
 !*       0.1   Declarations of arguments
 !
 CHARACTER(LEN=28), INTENT(IN) :: HFMFILE      ! Name of FM-file to write
-CHARACTER(LEN=28), INTENT(IN) :: HDADFILE     ! corresponding FM-file name of 
-                                              ! its DAD model
 !
 !*       0.2   Declarations of local variables
 !
-- 
GitLab