Index: trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/start2archive.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/start2archive.F	(revision 1694)
+++ trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/start2archive.F	(revision 2336)
@@ -22,10 +22,6 @@
       USE comsoil_h
       
-!      USE comgeomfi_h, ONLY: lati, long, area
-!      use control_mod
-!      use comgeomphy, only: initcomgeomphy
       use slab_ice_h, only: noceanmx
-! to use  'getin'
-      USE ioipsl_getincom
+      USE ioipsl_getincom, only: getin
       USE planete_mod, only: year_day
       USE mod_const_mpi, ONLY: COMM_LMDZ
@@ -37,5 +33,8 @@
       USE temps_mod, ONLY: day_ini
       USE iniphysiq_mod, ONLY: iniphysiq
+      use phys_state_var_mod, only: phys_state_var_init
       use phyetat0_mod, only: phyetat0
+      use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd,
+     &                          east_gwstress, west_gwstress
       implicit none
 
@@ -45,9 +44,5 @@
       include "comdissip.h"
       include "comgeom.h"
-!#include "control.h"
-
-!#include "dimphys.h"
-!#include "planete.h"
-!#include"advtrac.h"
+
       include "netcdf.inc"
 c-----------------------------------------------------------------------
@@ -111,4 +106,7 @@
       REAL tslabS(ip1jmp1,noceanmx),tsea_iceS(ip1jmp1)
 
+!     For non-orographic GW
+      REAL du_nonoro_gwdS(ip1jmp1,llm),dv_nonoro_gwdS(ip1jmp1,llm)
+      REAL east_gwstressS(ip1jmp1,llm),west_gwstressS(ip1jmp1,llm)
 
 c Variables intermediaires : vent naturel, mais pas coord scalaire
@@ -234,4 +232,7 @@
       Lmodif=0
 
+! Allocate saved arrays (as in firstcall of physiq)
+      call phys_state_var_init(nqtot)
+      
 ! Initialize tracer names, indexes and properties
       CALL initracer(ngridmx,nqtot,tname)
@@ -357,4 +358,8 @@
       call gr_fi_dyn(noceanmx,ngridmx,iip1,jjp1,tslab,tslabS)
 
+      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,du_nonoro_gwd,du_nonoro_gwdS)
+      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,dv_nonoro_gwd,dv_nonoro_gwdS)
+      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,east_gwstress,east_gwstressS)
+      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,west_gwstress,west_gwstressS)
 c=======================================================================
 c Info pour controler
@@ -370,5 +375,5 @@
          ENDDO
       ENDDO
-      write(*,*)'Ancienne grille : masse de l''atm :',ptotal
+      write(*,*)'Old grid: : atmospheric mass :',ptotal
 !      write(*,*)'Ancienne grille : masse de la glace CO2 :',co2icetotal
 
@@ -519,23 +524,37 @@
       IF(ierr.EQ.0) THEN
 
-
-         write(*,*) "Use slab-ocean ?"
-         ok_slab_ocean=.false.         ! default value
-         call getin("ok_slab_ocean",ok_slab_ocean)
-         write(*,*) "ok_slab_ocean = ",ok_slab_ocean
-
-      if(ok_slab_ocean) then
-      call write_archive(nid,ntime,'rnat'
-     &        ,'rnat','',2,rnatS)
-      call write_archive(nid,ntime,'pctsrf_sic'
-     &        ,'pctsrf_sic','',2,pctsrf_sicS)
-      call write_archive(nid,ntime,'sea_ice'
-     &        ,'sea_ice','',2,sea_iceS)
-      call write_archive(nid,ntime,'tslab'
-     &        ,'tslab','',-2,tslabS)
-      call write_archive(nid,ntime,'tsea_ice'
-     &        ,'tsea_ice','',2,tsea_iceS)
-      endif !ok_slab_ocean
-      ENDIF
+        write(*,*) "Use slab-ocean ?"
+        ok_slab_ocean=.false.         ! default value
+        call getin("ok_slab_ocean",ok_slab_ocean)
+        write(*,*) "ok_slab_ocean = ",ok_slab_ocean
+
+        if(ok_slab_ocean) then
+          call write_archive(nid,ntime,'rnat'
+     &            ,'rnat','',2,rnatS)
+          call write_archive(nid,ntime,'pctsrf_sic'
+     &            ,'pctsrf_sic','',2,pctsrf_sicS)
+          call write_archive(nid,ntime,'sea_ice'
+     &            ,'sea_ice','',2,sea_iceS)
+          call write_archive(nid,ntime,'tslab'
+     &            ,'tslab','',-2,tslabS)
+          call write_archive(nid,ntime,'tsea_ice'
+     &            ,'tsea_ice','',2,tsea_iceS)
+        endif !ok_slab_ocean
+      
+      ENDIF ! of IF(ierr.EQ.0)
+
+! Non-orographic gavity waves
+      call write_archive(nid,ntime,"du_nonoro_gwd",
+     &     "Zonal wind tendency due to GW",'m.s-1',3,du_nonoro_gwdS)
+      call write_archive(nid,ntime,"dv_nonoro_gwd",
+     &     "Meridional wind tendency due to GW",'m.s-1',
+     &     3,dv_nonoro_gwdS)
+      call write_archive(nid,ntime,"east_gwstress",
+     &     "Eastward stress profile due to GW",'kg.m-1.s-2',
+     &     3,east_gwstressS)
+      call write_archive(nid,ntime,"west_gwstress",
+     &     "Westward stress profile due to GW",'kg.m-1.s-2',
+     &     3,west_gwstressS)
+
 c-----------------------------------------------------------------------
 c Fin 
