Ignore:
Timestamp:
Jun 5, 2020, 9:44:36 AM (5 years ago)
Author:
emillour
Message:

Generic GCM:
Update start2archive/newstart programs to handle recently introduced
non-orographic GW variables in (re-)start files.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/start2archive.F

    r1694 r2336  
    2222      USE comsoil_h
    2323     
    24 !      USE comgeomfi_h, ONLY: lati, long, area
    25 !      use control_mod
    26 !      use comgeomphy, only: initcomgeomphy
    2724      use slab_ice_h, only: noceanmx
    28 ! to use  'getin'
    29       USE ioipsl_getincom
     25      USE ioipsl_getincom, only: getin
    3026      USE planete_mod, only: year_day
    3127      USE mod_const_mpi, ONLY: COMM_LMDZ
     
    3733      USE temps_mod, ONLY: day_ini
    3834      USE iniphysiq_mod, ONLY: iniphysiq
     35      use phys_state_var_mod, only: phys_state_var_init
    3936      use phyetat0_mod, only: phyetat0
     37      use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd,
     38     &                          east_gwstress, west_gwstress
    4039      implicit none
    4140
     
    4544      include "comdissip.h"
    4645      include "comgeom.h"
    47 !#include "control.h"
    48 
    49 !#include "dimphys.h"
    50 !#include "planete.h"
    51 !#include"advtrac.h"
     46
    5247      include "netcdf.inc"
    5348c-----------------------------------------------------------------------
     
    111106      REAL tslabS(ip1jmp1,noceanmx),tsea_iceS(ip1jmp1)
    112107
     108!     For non-orographic GW
     109      REAL du_nonoro_gwdS(ip1jmp1,llm),dv_nonoro_gwdS(ip1jmp1,llm)
     110      REAL east_gwstressS(ip1jmp1,llm),west_gwstressS(ip1jmp1,llm)
    113111
    114112c Variables intermediaires : vent naturel, mais pas coord scalaire
     
    234232      Lmodif=0
    235233
     234! Allocate saved arrays (as in firstcall of physiq)
     235      call phys_state_var_init(nqtot)
     236     
    236237! Initialize tracer names, indexes and properties
    237238      CALL initracer(ngridmx,nqtot,tname)
     
    357358      call gr_fi_dyn(noceanmx,ngridmx,iip1,jjp1,tslab,tslabS)
    358359
     360      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,du_nonoro_gwd,du_nonoro_gwdS)
     361      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,dv_nonoro_gwd,dv_nonoro_gwdS)
     362      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,east_gwstress,east_gwstressS)
     363      call gr_fi_dyn(llm,ngridmx,iip1,jjp1,west_gwstress,west_gwstressS)
    359364c=======================================================================
    360365c Info pour controler
     
    370375         ENDDO
    371376      ENDDO
    372       write(*,*)'Ancienne grille : masse de l''atm :',ptotal
     377      write(*,*)'Old grid: : atmospheric mass :',ptotal
    373378!      write(*,*)'Ancienne grille : masse de la glace CO2 :',co2icetotal
    374379
     
    519524      IF(ierr.EQ.0) THEN
    520525
    521 
    522          write(*,*) "Use slab-ocean ?"
    523          ok_slab_ocean=.false.         ! default value
    524          call getin("ok_slab_ocean",ok_slab_ocean)
    525          write(*,*) "ok_slab_ocean = ",ok_slab_ocean
    526 
    527       if(ok_slab_ocean) then
    528       call write_archive(nid,ntime,'rnat'
    529      &        ,'rnat','',2,rnatS)
    530       call write_archive(nid,ntime,'pctsrf_sic'
    531      &        ,'pctsrf_sic','',2,pctsrf_sicS)
    532       call write_archive(nid,ntime,'sea_ice'
    533      &        ,'sea_ice','',2,sea_iceS)
    534       call write_archive(nid,ntime,'tslab'
    535      &        ,'tslab','',-2,tslabS)
    536       call write_archive(nid,ntime,'tsea_ice'
    537      &        ,'tsea_ice','',2,tsea_iceS)
    538       endif !ok_slab_ocean
    539       ENDIF
     526        write(*,*) "Use slab-ocean ?"
     527        ok_slab_ocean=.false.         ! default value
     528        call getin("ok_slab_ocean",ok_slab_ocean)
     529        write(*,*) "ok_slab_ocean = ",ok_slab_ocean
     530
     531        if(ok_slab_ocean) then
     532          call write_archive(nid,ntime,'rnat'
     533     &            ,'rnat','',2,rnatS)
     534          call write_archive(nid,ntime,'pctsrf_sic'
     535     &            ,'pctsrf_sic','',2,pctsrf_sicS)
     536          call write_archive(nid,ntime,'sea_ice'
     537     &            ,'sea_ice','',2,sea_iceS)
     538          call write_archive(nid,ntime,'tslab'
     539     &            ,'tslab','',-2,tslabS)
     540          call write_archive(nid,ntime,'tsea_ice'
     541     &            ,'tsea_ice','',2,tsea_iceS)
     542        endif !ok_slab_ocean
     543     
     544      ENDIF ! of IF(ierr.EQ.0)
     545
     546! Non-orographic gavity waves
     547      call write_archive(nid,ntime,"du_nonoro_gwd",
     548     &     "Zonal wind tendency due to GW",'m.s-1',3,du_nonoro_gwdS)
     549      call write_archive(nid,ntime,"dv_nonoro_gwd",
     550     &     "Meridional wind tendency due to GW",'m.s-1',
     551     &     3,dv_nonoro_gwdS)
     552      call write_archive(nid,ntime,"east_gwstress",
     553     &     "Eastward stress profile due to GW",'kg.m-1.s-2',
     554     &     3,east_gwstressS)
     555      call write_archive(nid,ntime,"west_gwstress",
     556     &     "Westward stress profile due to GW",'kg.m-1.s-2',
     557     &     3,west_gwstressS)
     558
    540559c-----------------------------------------------------------------------
    541560c Fin
Note: See TracChangeset for help on using the changeset viewer.