Changeset 2343


Ignore:
Timestamp:
Aug 20, 2015, 12:02:53 PM (9 years ago)
Author:
Ehouarn Millour
Message:

Another step towards a clean separation between physics and dynamics: adapted read_pstoke.F90, read_pstoke0.F90 initphysto.F90 and phystokenc.F90 (now module phystokenc_mod.F90) to not explicitely include/use file/modules from the dynamics.
In the process, added module "time_phylmdz_mod.F90" in the physics, which contains the information otherwise found in "temps.h" (which is in the dynamics) and should be used instead.
EM

Location:
LMDZ5/trunk/libf
Files:
1 added
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90

    r2331 r2343  
    2323                      indnum_fn_num,index_trac,&
    2424                      niso,ntraceurs_zone,ntraciso
     25  USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline
    2526  USE comgeomphy, ONLY: initcomgeomphy, &
    2627                        airephy, & ! physics grid area (m2)
     
    3031                        rlatd ! latitudes
    3132  USE inifis_mod, ONLY: inifis
     33  USE time_phylmdz_mod, ONLY: init_time
    3234  USE infotrac_phy, ONLY: init_infotrac_phy
     35  USE phystokenc_mod, ONLY: init_phystokenc
    3336  USE phyaqua_mod, ONLY: iniaqua
    3437  IMPLICIT NONE
     
    4245  include "comvert.h"
    4346  include "iniprint.h"
     47  include "temps.h"
     48  include "tracstoke.h"
    4449
    4550  REAL, INTENT (IN) :: prad ! radius of the planet (m)
     
    134139  ENDIF ! of IF (klon_glo>1)
    135140
    136 !$OMP PARALLEL
     141!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
    137142  ! Initialize physical constants in physics:
    138143  CALL inifis(punjours,prad,pg,pr,pcpp)
    139  
     144  CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep)
     145
     146  ! Copy over "offline" settings
     147  CALL init_phystokenc(offline,istphy)
     148
    140149  ! copy over preff , ap(), bp(), etc
    141150  CALL init_vertical_layers(nlayer,preff,scaleheight, &
  • LMDZ5/trunk/libf/phylmd/fisrtilp.F90

    r2311 r2343  
    2626  !ym include "dimphy.h"
    2727  include "YOMCST.h"
    28   include "tracstoke.h"
    2928  include "fisrtilp.h"
    3029  include "nuage.h" ! JBM (3/14)
  • LMDZ5/trunk/libf/phylmd/fisrtilp_tr.F90

    r2311 r2343  
    2222  ! ym#include "dimphy.h"
    2323  include "YOMCST.h"
    24   include "tracstoke.h"
    2524
    2625  ! Arguments:
  • LMDZ5/trunk/libf/phylmd/initphysto.F90

    r1907 r2343  
    88  USE IOIPSL
    99  USE iophy
    10   USE control_mod
    1110  USE indice_sol_mod
     11  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
     12  USE time_phylmdz_mod, ONLY: day_ref, annee_ref
    1213 
    1314  IMPLICIT NONE
     
    3738!
    3839! =====================================================================
    39 !
    40 !   Declarations
    41   INCLUDE "dimensions.h"
    42   INCLUDE "paramet.h"
    43   INCLUDE "comconst.h"
    44   INCLUDE "comgeom.h"
    45   INCLUDE "temps.h"
    46   INCLUDE "logic.h"
    47   INCLUDE "description.h"
    48   INCLUDE "serre.h"
    4940
    5041!   Arguments
     
    5849  INTEGER nhoriid, i
    5950  INTEGER l,k
    60   REAL nivsigs(llm)
     51  REAL nivsigs(nbp_lev)
    6152  INTEGER tau0
    6253  REAL zjulian
     
    6657  INTEGER zan, idayref
    6758  LOGICAL ok_sync
    68   REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
     59  REAL zx_lon(nbp_lon,nbp_lat), zx_lat(nbp_lon,nbp_lat)
    6960  CHARACTER(len=12) :: nvar
    7061
    7162!  Initialisations
    7263!
    73   pi = 4. * ATAN (1.)
    7464  ok_sync= .TRUE.
    7565!
     
    8878!  Appel a histvert pour la grille verticale
    8979!
    90   DO l=1,llm
     80  DO l=1,nbp_lev
    9181     nivsigs(l)=REAL(l)
    9282  ENDDO
     
    9484  CALL histvert(fileid, 'sig_s', 'Niveaux sigma', &
    9585       'sigma_level', &
    96        llm, nivsigs, zvertiid)
     86       nbp_lev, nivsigs, zvertiid)
    9787!
    9888!  Appels a histdef pour la definition des variables a sauvegarder
    9989!
    10090  CALL histdef(fileid, "phis", "Surface geop. height", "-", &
    101        iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
     91       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
    10292       "once", t_ops, t_wrt)
    10393 
    10494  CALL histdef(fileid, "aire", "Grid area", "-", &
    105        iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
     95       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
    10696       "once", t_ops, t_wrt)
    10797
    10898  CALL histdef(fileid, "longitudes", "longitudes", "-", &
    109        iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
     99       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
    110100       "once", t_ops, t_wrt)
    111101
    112102  CALL histdef(fileid, "latitudes", "latitudes", "-", &
    113        iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
     103       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
    114104       "once", t_ops, t_wrt)
    115105! T
    116   CALL histdef(fileid, 't', 'Temperature', 'K', iim, jj_nb, nhoriid, &
    117        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     106  CALL histdef(fileid, 't', 'Temperature', 'K', nbp_lon, jj_nb, nhoriid, &
     107       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    118108! mfu
    119   CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',iim, jj_nb, nhoriid, &
    120        llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
     109  CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
     110       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
    121111! mfd
    122   CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',iim, jj_nb, nhoriid, &
    123        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     112  CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
     113       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    124114! en_u
    125   CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', iim, jj_nb, nhoriid, &
    126        llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
     115  CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
     116       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
    127117! de_u
    128   CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',iim, jj_nb, nhoriid, &
    129        llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
     118  CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
     119       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
    130120! en_d
    131   CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', iim, jj_nb, nhoriid, &
    132        llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
     121  CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
     122       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
    133123! de_d
    134   CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', iim, jj_nb, nhoriid, &
    135        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     124  CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
     125       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    136126! coefh
    137   CALL histdef(fileid, "coefh", " ", " ", iim, jj_nb, nhoriid, &
    138        llm, 1, llm, zvertiid,32, "inst(X)", t_ops, t_wrt)
     127  CALL histdef(fileid, "coefh", " ", " ", nbp_lon, jj_nb, nhoriid, &
     128       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
    139129! fm_th
    140   CALL histdef(fileid, "fm_th", " ", " ",iim, jj_nb, nhoriid, &
    141        llm, 1, llm, zvertiid,32, "inst(X)", t_ops, t_wrt)
     130  CALL histdef(fileid, "fm_th", " ", " ",nbp_lon, jj_nb, nhoriid, &
     131       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
    142132! en_th
    143   CALL histdef(fileid, "en_th", " ", " ",iim, jj_nb, nhoriid, &
    144        llm, 1, llm, zvertiid,32, "inst(X)", t_ops, t_wrt)
     133  CALL histdef(fileid, "en_th", " ", " ",nbp_lon, jj_nb, nhoriid, &
     134       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
    145135! frac_impa
    146   CALL histdef(fileid, 'frac_impa', ' ', ' ',iim, jj_nb, nhoriid, &
    147        llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
     136  CALL histdef(fileid, 'frac_impa', ' ', ' ',nbp_lon, jj_nb, nhoriid, &
     137       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
    148138! frac_nucl
    149   CALL histdef(fileid, 'frac_nucl', ' ', ' ',iim, jj_nb, nhoriid, &
    150        llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
     139  CALL histdef(fileid, 'frac_nucl', ' ', ' ',nbp_lon, jj_nb, nhoriid, &
     140       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
    151141! pyu1
    152   CALL histdef(fileid, "pyu1", " ", " ", iim,jj_nb,nhoriid, &
     142  CALL histdef(fileid, "pyu1", " ", " ", nbp_lon,jj_nb,nhoriid, &
    153143       1,1,1, -99, 32, "inst(X)", t_ops, t_wrt)
    154144! pyv1
    155   CALL histdef(fileid, "pyv1", " ", " ", iim,jj_nb,nhoriid, &
     145  CALL histdef(fileid, "pyv1", " ", " ", nbp_lon,jj_nb,nhoriid, &
    156146       1,1,1, -99, 32,"inst(X)", t_ops, t_wrt)   
    157147! ftsol1
    158   CALL histdef(fileid, "ftsol1", " ", " ",iim, jj_nb, nhoriid, &
     148  CALL histdef(fileid, "ftsol1", " ", " ",nbp_lon, jj_nb, nhoriid, &
    159149       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
    160150! ftsol2
    161   CALL histdef(fileid, "ftsol2", " ", " ",iim, jj_nb, nhoriid, &
     151  CALL histdef(fileid, "ftsol2", " ", " ",nbp_lon, jj_nb, nhoriid, &
    162152       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
    163153! ftsol3
    164   CALL histdef(fileid, "ftsol3", " ", " ", iim, jj_nb, nhoriid, &
     154  CALL histdef(fileid, "ftsol3", " ", " ", nbp_lon, jj_nb, nhoriid, &
    165155       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
    166156! ftsol4
    167   CALL histdef(fileid, "ftsol4", " ", " ",iim, jj_nb, nhoriid, &
     157  CALL histdef(fileid, "ftsol4", " ", " ",nbp_lon, jj_nb, nhoriid, &
    168158       1, 1,1, -99, 32, "inst(X)", t_ops, t_wrt)
    169159! psrf1
    170   CALL histdef(fileid, "psrf1", " ", " ",iim, jj_nb, nhoriid, &
     160  CALL histdef(fileid, "psrf1", " ", " ",nbp_lon, jj_nb, nhoriid, &
    171161       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
    172162! psrf2
    173   CALL histdef(fileid, "psrf2", " ", " ",iim, jj_nb, nhoriid, &
     163  CALL histdef(fileid, "psrf2", " ", " ",nbp_lon, jj_nb, nhoriid, &
    174164       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
    175165! psrf3
    176   CALL histdef(fileid, "psrf3", " ", " ",iim, jj_nb, nhoriid, &
     166  CALL histdef(fileid, "psrf3", " ", " ",nbp_lon, jj_nb, nhoriid, &
    177167       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
    178168! psrf4
    179   CALL histdef(fileid, "psrf4", " ", " ", iim, jj_nb, nhoriid, &
     169  CALL histdef(fileid, "psrf4", " ", " ", nbp_lon, jj_nb, nhoriid, &
    180170       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
    181171! sh
    182   CALL histdef(fileid, 'sh', '', '', iim, jj_nb, nhoriid, &
    183        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     172  CALL histdef(fileid, 'sh', '', '', nbp_lon, jj_nb, nhoriid, &
     173       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    184174! da
    185   CALL histdef(fileid, 'da', '', '', iim, jj_nb, nhoriid, &
    186        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     175  CALL histdef(fileid, 'da', '', '', nbp_lon, jj_nb, nhoriid, &
     176       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    187177! mp
    188   CALL histdef(fileid, 'mp', '', '', iim, jj_nb, nhoriid, &
    189        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     178  CALL histdef(fileid, 'mp', '', '', nbp_lon, jj_nb, nhoriid, &
     179       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    190180! upwd
    191   CALL histdef(fileid, 'upwd', '', '', iim, jj_nb, nhoriid, &
    192        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     181  CALL histdef(fileid, 'upwd', '', '', nbp_lon, jj_nb, nhoriid, &
     182       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    193183! dnwd
    194   CALL histdef(fileid, 'dnwd', '', '', iim, jj_nb, nhoriid, &
    195        llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     184  CALL histdef(fileid, 'dnwd', '', '', nbp_lon, jj_nb, nhoriid, &
     185       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    196186
    197187! phi
    198   DO k=1,llm
     188  DO k=1,nbp_lev
    199189     IF (k<10) THEN
    200190        WRITE(nvar,'(i1)') k
     
    206196     nvar='phi_lev'//trim(nvar)
    207197     
    208      CALL histdef(fileid, nvar, '', '', iim, jj_nb, nhoriid, &
    209           llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
     198     CALL histdef(fileid, nvar, '', '', nbp_lon, jj_nb, nhoriid, &
     199          nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
    210200  END DO
    211201
  • LMDZ5/trunk/libf/phylmd/physiq.F90

    r2340 r2343  
    2222  USE iophy
    2323  USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
     24  USE phystokenc_mod, ONLY: offline, phystokenc
     25  USE time_phylmdz_mod, only: raz_date, day_step_phy
    2426  USE vampir
    2527  USE pbl_surface_mod, ONLY : pbl_surface
     
    4648  use radlwsw_m, only: radlwsw
    4749  use phyaqua_mod, only: zenang_an
    48   USE control_mod
     50  USE control_mod, ONLY: config_inca
    4951#ifdef CPP_XIOS
    5052  USE wxios, ONLY: missing_val, missing_val_omp
  • LMDZ5/trunk/libf/phylmd/phystokenc_mod.F90

    r2340 r2343  
     1!
     2! $Id$
     3!
     4MODULE phystokenc_mod
     5
     6  IMPLICIT NONE
     7
     8  LOGICAL,SAVE :: offline
     9!$OMP THREADPRIVATE(offline)
     10  INTEGER,SAVE :: istphy
     11!$OMP THREADPRIVATE(istphy)
     12
     13
     14CONTAINS
     15
     16  SUBROUTINE init_phystokenc(offline_dyn,istphy_dyn)
     17    IMPLICIT NONE
     18    LOGICAL,INTENT(IN) :: offline_dyn
     19    INTEGER,INTENT(IN) :: istphy_dyn
     20
     21    offline=offline_dyn
     22    istphy=istphy_dyn
     23
     24  END SUBROUTINE init_phystokenc
     25
    126SUBROUTINE phystokenc (nlon,nlev,pdtphys,rlon,rlat, &
    227     pt,pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
     
    1136  USE infotrac_phy, ONLY : nqtot
    1237  USE iophy
    13   USE control_mod
    1438  USE indice_sol_mod
    1539  USE print_control_mod, ONLY: lunout
     40  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    1641 
    1742  IMPLICIT NONE
     
    2146! Objet: Ecriture des variables pour transport offline
    2247!
    23 !======================================================================
    24   INCLUDE "dimensions.h"
    25   INCLUDE "tracstoke.h"
    2648!======================================================================
    2749
     
    6284!
    6385  REAL rlon(klon), rlat(klon), dtime
    64   REAL zx_tmp_3d(iim,jjm+1,klev),zx_tmp_2d(iim,jjm+1)
     86  REAL zx_tmp_3d(nbp_lon,nbp_lat,klev),zx_tmp_2d(nbp_lon,nbp_lat)
    6587
    6688!   Couche limite:
     
    362384
    363385END SUBROUTINE phystokenc
     386
     387END MODULE phystokenc_mod
  • LMDZ5/trunk/libf/phylmd/read_pstoke.F90

    r1992 r2343  
    2121  USE control_mod
    2222  USE indice_sol_mod
     23  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
    2324
    2425  IMPLICIT NONE
    2526
    2627  include "netcdf.inc"
    27   include "dimensions.h"
    28   include "paramet.h"
    29   include "comconst.h"
    30   include "comgeom.h"
    31   include "temps.h"
    32   include "ener.h"
    33   include "logic.h"
    34   include "description.h"
    35   include "serre.h"
    36   ! ccc#include "dimphy.h"
    3728
    3829  INTEGER klono, klevo, imo, jmo
    39   PARAMETER (imo=iim/2, jmo=(jjm+1)/2)
    40   PARAMETER (klono=(jmo-1)*imo+2, klevo=llm)
    41   REAL phisfi(klono)
    42   REAL phisfi2(imo, jmo+1), airefi2(imo, jmo+1)
    43 
    44   REAL mfu(klono, klevo), mfd(klono, klevo)
    45   REAL en_u(klono, klevo), de_u(klono, klevo)
    46   REAL en_d(klono, klevo), de_d(klono, klevo)
    47   REAL coefh(klono, klevo)
    48   REAL fm_therm(klono, klevo), en_therm(klono, klevo)
    49 
    50   REAL mfu2(imo, jmo+1, klevo), mfd2(imo, jmo+1, klevo)
    51   REAL en_u2(imo, jmo+1, klevo), de_u2(imo, jmo+1, klevo)
    52   REAL en_d2(imo, jmo+1, klevo), de_d2(imo, jmo+1, klevo)
    53   REAL coefh2(imo, jmo+1, klevo)
    54   REAL fm_therm2(imo, jmo+1, klevo)
    55   REAL en_therm2(imo, jmo+1, klevo)
    56 
    57   REAL pl(klevo)
     30!  PARAMETER (imo=iim/2, jmo=(jjm+1)/2)
     31!  PARAMETER (klono=(jmo-1)*imo+2, klevo=llm)
     32  REAL :: phisfi(((nbp_lat/2)-1)*(nbp_lon/2)+2) !phisfi(klono)
     33  REAL,ALLOCATABLE :: phisfi2(:,:) !phisfi2(imo,jmo+1)
     34  REAL,ALLOCATABLE :: airefi2(:,:) !airefi2(imo, jmo+1)
     35
     36  REAL :: mfu(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) ! mfu(klono, klevo)
     37  REAL :: mfd(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) ! mfd(klono, klevo)
     38  REAL :: en_u(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !en_u(klono, klevo)
     39  REAL :: de_u(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !de_u(klono, klevo)
     40  REAL :: en_d(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !en_d(klono, klevo)
     41  REAL :: de_d(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !de_d(klono, klevo)
     42  REAL :: coefh(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !coefh(klono, klevo)
     43  REAL :: fm_therm(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !fm_therm(klono, klevo)
     44  REAL :: en_therm(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !en_therm(klono, klevo)
     45
     46  REAL,ALLOCATABLE :: mfu2(:,:,:) !mfu2(imo, jmo+1, klevo)
     47  REAL,ALLOCATABLE :: mfd2(:,:,:) !mfd2(imo, jmo+1, klevo)
     48  REAL,ALLOCATABLE :: en_u2(:,:,:) !en_u2(imo, jmo+1, klevo)
     49  REAL,ALLOCATABLE :: de_u2(:,:,:) !de_u2(imo, jmo+1, klevo)
     50  REAL,ALLOCATABLE :: en_d2(:,:,:) !en_d2(imo, jmo+1, klevo)
     51  REAL,ALLOCATABLE :: de_d2(:,:,:) !de_d2(imo, jmo+1, klevo)
     52  REAL,ALLOCATABLE :: coefh2(:,:,:) !coefh2(imo, jmo+1, klevo)
     53  REAL,ALLOCATABLE :: fm_therm2(:,:,:) !fm_therm2(imo, jmo+1, klevo)
     54  REAL,ALLOCATABLE :: en_therm2(:,:,:) !en_therm2(imo, jmo+1, klevo)
     55
     56  REAL,ALLOCATABLE :: pl(:) !pl(klevo)
    5857  INTEGER irec
    5958  INTEGER xid, yid, zid, tid
     
    6160  INTEGER ncrec, ncklono, ncklevo, ncim, ncjm
    6261
    63   REAL airefi(klono)
     62  REAL :: airefi(((nbp_lat/2)-1)*(nbp_lon/2)+2) !airefi(klono)
    6463  CHARACTER *20 namedim
    6564
     
    6968
    7069
    71   REAL frac_impa(klono, klevo), frac_nucl(klono, klevo)
    72   REAL frac_impa2(imo, jmo+1, klevo), frac_nucl2(imo, jmo+1, klevo)
    73   REAL pyu1(klono), pyv1(klono)
    74   REAL pyu12(imo, jmo+1), pyv12(imo, jmo+1)
    75   REAL ftsol(klono, nbsrf)
    76   REAL psrf(klono, nbsrf)
    77   REAL ftsol1(klono), ftsol2(klono), ftsol3(klono), ftsol4(klono)
    78   REAL psrf1(klono), psrf2(klono), psrf3(klono), psrf4(klono)
    79   REAL ftsol12(imo, jmo+1), ftsol22(imo, jmo+1), ftsol32(imo, jmo+1), &
    80     ftsol42(imo, jmo+1)
    81   REAL psrf12(imo, jmo+1), psrf22(imo, jmo+1), psrf32(imo, jmo+1), &
    82     psrf42(imo, jmo+1)
    83   REAL t(klono, klevo)
    84   REAL t2(imo, jmo+1, klevo)
    85   INTEGER ncidp
    86   SAVE ncidp
    87   INTEGER varidt
    88   INTEGER varidmfu, varidmfd, varidps, varidenu, variddeu
    89   INTEGER varidend, varidded, varidch, varidfi, varidfn
    90   INTEGER varidfmth, varidenth
    91   INTEGER varidyu1, varidyv1, varidpl, varidai, varididvt
    92   INTEGER varidfts1, varidfts2, varidfts3, varidfts4
    93   INTEGER varidpsr1, varidpsr2, varidpsr3, varidpsr4
    94   SAVE varidmfu, varidmfd, varidps, varidenu, variddeu
    95   SAVE varidend, varidded, varidch, varidfi, varidfn
    96   SAVE varidfmth, varidenth
    97   SAVE varidyu1, varidyv1, varidpl, varidai, varididvt
    98   SAVE varidfts1, varidfts2, varidfts3, varidfts4
    99   SAVE varidpsr1, varidpsr2, varidpsr3, varidpsr4
    100   SAVE varidt
     70  REAL :: frac_impa(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !frac_impa(klono, klevo)
     71  REAL :: frac_nucl(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !frac_nucl(klono, klevo)
     72  REAL,ALLOCATABLE :: frac_impa2(:,:,:) !frac_impa2(imo, jmo+1, klevo)
     73  REAL,ALLOCATABLE :: frac_nucl2(:,:,:) !frac_nucl2(imo, jmo+1, klevo)
     74  REAL :: pyu1(((nbp_lat/2)-1)*(nbp_lon/2)+2) !pyu1(klono)
     75  REAL :: pyv1(((nbp_lat/2)-1)*(nbp_lon/2)+2) !pyv1(klono)
     76  REAL,ALLOCATABLE :: pyu12(:,:), pyv12(:,:) !pyu12(imo, jmo+1), pyv12(imo, jmo+1)
     77  REAL :: ftsol(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !ftsol(klono, nbsrf)
     78  REAL :: psrf(((nbp_lat/2)-1)*(nbp_lon/2)+2,nbp_lev) !psrf(klono, nbsrf)
     79  REAL,ALLOCATABLE :: ftsol1(:),ftsol2(:) !ftsol1(klono), ftsol2(klono)
     80  REAL,ALLOCATABLE :: ftsol3(:),ftsol4(:) !ftsol3(klono), ftsol4(klono)
     81  REAL,ALLOCATABLE :: psrf1(:), psrf2(:) !psrf1(klono), psrf2(klono)
     82  REAL,ALLOCATABLE :: psrf3(:), psrf4(:) !psrf3(klono), psrf4(klono)
     83  REAL,ALLOCATABLE :: ftsol12(:,:) !ftsol12(imo, jmo+1)
     84  REAL,ALLOCATABLE :: ftsol22(:,:) !ftsol22(imo, jmo+1)
     85  REAL,ALLOCATABLE :: ftsol32(:,:) !ftsol32(imo, jmo+1)
     86  REAL,ALLOCATABLE :: ftsol42(:,:) !ftsol42(imo, jmo+1)
     87  REAL,ALLOCATABLE :: psrf12(:,:) !psrf12(imo, jmo+1)
     88  REAL,ALLOCATABLE :: psrf22(:,:) !psrf22(imo, jmo+1)
     89  REAL,ALLOCATABLE :: psrf32(:,:) !psrf32(imo, jmo+1)
     90  REAL,ALLOCATABLE :: psrf42(:,:) !psrf42(imo, jmo+1)
     91  REAL :: t(((nbp_lon/2)-1)*(nbp_lat/2)+2,nbp_lev) !t(klono, klevo)
     92  REAL,ALLOCATABLE :: t2(:,:,:) !t2(imo, jmo+1, klevo)
     93  INTEGER,SAVE :: ncidp
     94  INTEGER,SAVE :: varidt
     95  INTEGER,SAVE :: varidmfu, varidmfd, varidps, varidenu, variddeu
     96  INTEGER,SAVE :: varidend, varidded, varidch, varidfi, varidfn
     97  INTEGER,SAVE :: varidfmth, varidenth
     98  INTEGER,SAVE :: varidyu1, varidyv1, varidpl, varidai, varididvt
     99  INTEGER,SAVE :: varidfts1, varidfts2, varidfts3, varidfts4
     100  INTEGER,SAVE :: varidpsr1, varidpsr2, varidpsr3, varidpsr4
    101101
    102102  INTEGER l, i
    103103  INTEGER start(4), count(4), status
    104104  REAL rcode
    105   LOGICAL first
    106   SAVE first
    107   DATA first/.TRUE./
    108 
    109 
     105  LOGICAL,SAVE :: first=.TRUE.
     106
     107  ! Allocate arrays
     108  imo=nbp_lon/2
     109  jmo=nbp_lat/2
     110  klono=(jmo-1)*imo+2
     111  klevo=nbp_lev
     112 
     113  ALLOCATE(phisfi2(imo,jmo+1))
     114  ALLOCATE(airefi2(imo, jmo+1))
     115  ALLOCATE(mfu2(imo, jmo+1, klevo))
     116  ALLOCATE(mfd2(imo, jmo+1, klevo))
     117  ALLOCATE(en_u2(imo, jmo+1, klevo))
     118  ALLOCATE(de_u2(imo, jmo+1, klevo))
     119  ALLOCATE(en_d2(imo, jmo+1, klevo))
     120  ALLOCATE(de_d2(imo, jmo+1, klevo))
     121  ALLOCATE(coefh2(imo, jmo+1, klevo))
     122  ALLOCATE(fm_therm2(imo, jmo+1, klevo))
     123  ALLOCATE(en_therm2(imo, jmo+1, klevo))
     124  ALLOCATE(pl(klevo))
     125  ALLOCATE(frac_impa2(imo, jmo+1, klevo))
     126  ALLOCATE(frac_nucl2(imo, jmo+1, klevo))
     127  ALLOCATE(pyu12(imo, jmo+1), pyv12(imo, jmo+1))
     128  ALLOCATE(ftsol1(klono), ftsol2(klono))
     129  ALLOCATE(ftsol3(klono), ftsol4(klono))
     130  ALLOCATE(psrf1(klono), psrf2(klono))
     131  ALLOCATE(psrf3(klono), psrf4(klono))
     132  ALLOCATE(ftsol12(imo, jmo+1))
     133  ALLOCATE(ftsol22(imo, jmo+1))
     134  ALLOCATE(ftsol32(imo, jmo+1))
     135  ALLOCATE(ftsol42(imo, jmo+1))
     136  ALLOCATE(psrf12(imo, jmo+1))
     137  ALLOCATE(psrf22(imo, jmo+1))
     138  ALLOCATE(psrf32(imo, jmo+1))
     139  ALLOCATE(psrf42(imo, jmo+1))
     140  ALLOCATE(t2(imo, jmo+1, klevo))
    110141
    111142  ! ---------------------------------------------
  • LMDZ5/trunk/libf/phylmd/read_pstoke0.F90

    r1992 r2343  
    2020  USE control_mod
    2121  USE indice_sol_mod
     22  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
    2223
    2324  IMPLICIT NONE
    2425
    2526  include "netcdf.inc"
    26   include "dimensions.h"
    27   include "paramet.h"
    28   include "comconst.h"
    29   include "comgeom.h"
    30   include "temps.h"
    31   include "ener.h"
    32   include "logic.h"
    33   include "description.h"
    34   include "serre.h"
    35   ! ccc#include "dimphy.h"
    3627
    3728  INTEGER kon, kev, zkon, zkev
    38   PARAMETER (kon=iim*(jjm-1)+2, kev=llm)
    39   REAL phisfi(kon)
    40   REAL phisfi2(iim, jjm+1), airefi2(iim, jjm+1)
    41 
    42   REAL mfu(kon, kev), mfd(kon, kev)
    43   REAL en_u(kon, kev), de_u(kon, kev)
    44   REAL en_d(kon, kev), de_d(kon, kev)
    45   REAL coefh(kon, kev)
     29!  PARAMETER (kon=iim*(jjm-1)+2, kev=llm)
     30  REAL :: phisfi(nbp_lon*(nbp_lat-2)+2) !phisfi(kon)
     31  REAL,ALLOCATABLE :: phisfi2(:,:) !phisfi2(nbp_lon, nbp_lat)
     32  REAL,ALLOCATABLE :: airefi2(:,:) !airefi2(nbp_lon, nbp_lat)
     33
     34  REAL :: mfu(nbp_lon*(nbp_lat-2)+2,nbp_lev) !mfu(kon, kev)
     35  REAL :: mfd(nbp_lon*(nbp_lat-2)+2,nbp_lev) !mfd(kon, kev)
     36  REAL :: en_u(nbp_lon*(nbp_lat-2)+2,nbp_lev) !en_u(kon, kev)
     37  REAL :: de_u(nbp_lon*(nbp_lat-2)+2,nbp_lev) !de_u(kon, kev)
     38  REAL :: en_d(nbp_lon*(nbp_lat-2)+2,nbp_lev) !en_d(kon, kev)
     39  REAL :: de_d(nbp_lon*(nbp_lat-2)+2,nbp_lev) !de_d(kon, kev)
     40  REAL :: coefh(nbp_lon*(nbp_lat-2)+2,nbp_lev) !coefh(kon, kev)
    4641
    4742  ! abd 25 11 02
    4843  ! Thermiques
    49   REAL fm_therm(kon, kev), en_therm(kon, kev)
    50   REAL t(kon, kev)
    51 
    52   REAL mfu2(iim, jjm+1, kev), mfd2(iim, jjm+1, kev)
    53   REAL en_u2(iim, jjm+1, kev), de_u2(iim, jjm+1, kev)
    54   REAL en_d2(iim, jjm+1, kev), de_d2(iim, jjm+1, kev)
    55   REAL coefh2(iim, jjm+1, kev)
    56   REAL t2(iim, jjm+1, kev)
     44  REAL :: fm_therm(nbp_lon*(nbp_lat-2)+2,nbp_lev) !fm_therm(kon, kev)
     45  REAL :: en_therm(nbp_lon*(nbp_lat-2)+2,nbp_lev) !en_therm(kon, kev)
     46  REAL :: t(nbp_lon*(nbp_lat-2)+2,nbp_lev) !t(kon, kev)
     47
     48  REAL,ALLOCATABLE :: mfu2(:,:,:) !mfu2(nbp_lon, nbp_lat, kev)
     49  REAL,ALLOCATABLE :: mfd2(:,:,:) !mfd2(nbp_lon, nbp_lat, kev)
     50  REAL,ALLOCATABLE :: en_u2(:,:,:) !en_u2(nbp_lon, nbp_lat, kev)
     51  REAL,ALLOCATABLE :: de_u2(:,:,:) !de_u2(nbp_lon, nbp_lat, kev)
     52  REAL,ALLOCATABLE :: en_d2(:,:,:) !en_d2(nbp_lon, nbp_lat, kev)
     53  REAL,ALLOCATABLE :: de_d2(:,:,:) !de_d2(nbp_lon, nbp_lat, kev)
     54  REAL,ALLOCATABLE :: coefh2(:,:,:) !coefh2(nbp_lon, nbp_lat, kev)
     55  REAL,ALLOCATABLE :: t2(:,:,:) !t2(nbp_lon, nbp_lat, kev)
    5756  ! Thermiques
    58   REAL fm_therm2(iim, jjm+1, kev)
    59   REAL en_therm2(iim, jjm+1, kev)
    60 
    61   REAL pl(kev)
     57  REAL,ALLOCATABLE :: fm_therm2(:,:,:) !fm_therm2(nbp_lon, nbp_lat, kev)
     58  REAL,ALLOCATABLE :: en_therm2(:,:,:) !en_therm2(nbp_lon, nbp_lat, kev)
     59
     60  REAL,ALLOCATABLE :: pl(:) !pl(kev)
    6261  INTEGER irec
    6362  INTEGER xid, yid, zid, tid
     
    6564  INTEGER ncrec, nckon, nckev, ncim, ncjm
    6665
    67   REAL airefi(kon)
     66  REAL :: airefi(nbp_lon*(nbp_lat-2)+2) !airefi(kon)
    6867  CHARACTER *20 namedim
    6968
     
    7271  ! dim de phis??
    7372
    74   REAL frac_impa(kon, kev), frac_nucl(kon, kev)
    75   REAL frac_impa2(iim, jjm+1, kev), frac_nucl2(iim, jjm+1, kev)
    76   REAL pyu1(kon), pyv1(kon)
    77   REAL pyu12(iim, jjm+1), pyv12(iim, jjm+1)
    78   REAL ftsol(kon, nbsrf)
    79   REAL psrf(kon, nbsrf)
    80   REAL ftsol1(kon), ftsol2(kon), ftsol3(kon), ftsol4(kon)
    81   REAL psrf1(kon), psrf2(kon), psrf3(kon), psrf4(kon)
    82   REAL ftsol12(iim, jjm+1), ftsol22(iim, jjm+1), ftsol32(iim, jjm+1), &
    83     ftsol42(iim, jjm+1)
    84   REAL psrf12(iim, jjm+1), psrf22(iim, jjm+1), psrf32(iim, jjm+1), &
    85     psrf42(iim, jjm+1)
    86 
    87   INTEGER ncidp
    88   SAVE ncidp
    89   INTEGER varidmfu, varidmfd, varidps, varidenu, variddeu
    90   INTEGER varidt
    91   INTEGER varidend, varidded, varidch, varidfi, varidfn
     73  REAL :: frac_impa(nbp_lon*(nbp_lat-2)+2,nbp_lev) !frac_impa(kon, kev)
     74  REAL :: frac_nucl(nbp_lon*(nbp_lat-2)+2,nbp_lev) !frac_nucl(kon, kev)
     75  REAL,ALLOCATABLE :: frac_impa2(:,:,:) !frac_impa2(nbp_lon, nbp_lat, kev)
     76  REAL,ALLOCATABLE :: frac_nucl2(:,:,:) !frac_nucl2(nbp_lon, nbp_lat, kev)
     77  REAL :: pyu1(nbp_lon*(nbp_lat-2)+2) !pyu1(kon)
     78  REAL :: pyv1(nbp_lon*(nbp_lat-2)+2) !pyv1(kon)
     79  REAL,ALLOCATABLE :: pyu12(:,:), pyv12(:,:) !pyu12(nbp_lon, nbp_lat), pyv12(nbp_lon, nbp_lat)
     80  REAL :: ftsol(nbp_lon*(nbp_lat-2)+2,nbp_lev) !ftsol(kon, nbsrf)
     81  REAL :: psrf(nbp_lon*(nbp_lat-2)+2,nbp_lev) !psrf(kon, nbsrf)
     82  REAL,ALLOCATABLE :: ftsol1(:),ftsol2(:) !ftsol1(kon), ftsol2(kon)
     83  REAL,ALLOCATABLE :: ftsol3(:),ftsol4(:) !ftsol3(kon), ftsol4(kon)
     84  REAL,ALLOCATABLE :: psrf1(:), psrf2(:) !psrf1(kon), psrf2(kon)
     85  REAL,ALLOCATABLE :: psrf3(:), psrf4(:) !psrf3(kon), psrf4(kon)
     86  REAL,ALLOCATABLE :: ftsol12(:,:) !ftsol12(nbp_lon, nbp_lat)
     87  REAL,ALLOCATABLE :: ftsol22(:,:) !ftsol22(nbp_lon, nbp_lat)
     88  REAL,ALLOCATABLE :: ftsol32(:,:) !ftsol32(nbp_lon, nbp_lat)
     89  REAL,ALLOCATABLE :: ftsol42(:,:) !ftsol42(nbp_lon, nbp_lat)
     90  REAL,ALLOCATABLE :: psrf12(:,:) !psrf12(nbp_lon, nbp_lat)
     91  REAL,ALLOCATABLE :: psrf22(:,:) !psrf22(nbp_lon, nbp_lat)
     92  REAL,ALLOCATABLE :: psrf32(:,:) !psrf32(nbp_lon, nbp_lat)
     93  REAL,ALLOCATABLE :: psrf42(:,:) !psrf42(nbp_lon, nbp_lat)
     94
     95  INTEGER,SAVE :: ncidp
     96  INTEGER,SAVE :: varidmfu, varidmfd, varidps, varidenu, variddeu
     97  INTEGER,SAVE :: varidt
     98  INTEGER,SAVE :: varidend, varidded, varidch, varidfi, varidfn
    9299  ! therm
    93   INTEGER varidfmth, varidenth
    94   INTEGER varidyu1, varidyv1, varidpl, varidai, varididvt
    95   INTEGER varidfts1, varidfts2, varidfts3, varidfts4
    96   INTEGER varidpsr1, varidpsr2, varidpsr3, varidpsr4
    97   SAVE varidmfu, varidmfd, varidps, varidenu, variddeu
    98   SAVE varidt
    99   SAVE varidend, varidded, varidch, varidfi, varidfn
    100   ! therm
    101   SAVE varidfmth, varidenth
    102   SAVE varidyu1, varidyv1, varidpl, varidai, varididvt
    103   SAVE varidfts1, varidfts2, varidfts3, varidfts4
    104   SAVE varidpsr1, varidpsr2, varidpsr3, varidpsr4
     100  INTEGER,SAVE :: varidfmth, varidenth
     101  INTEGER,SAVE :: varidyu1, varidyv1, varidpl, varidai, varididvt
     102  INTEGER,SAVE :: varidfts1, varidfts2, varidfts3, varidfts4
     103  INTEGER,SAVE :: varidpsr1, varidpsr2, varidpsr3, varidpsr4
    105104
    106105  INTEGER l, i
    107106  INTEGER start(4), count(4), status
    108107  REAL rcode
    109   LOGICAL first
    110   SAVE first
    111   DATA first/.TRUE./
    112 
    113 
     108  LOGICAL,SAVE :: first=.TRUE.
     109
     110  ! Allocate arrays
     111  kon=nbp_lon*(nbp_lat-2)+2
     112  kev=nbp_lev
     113
     114  ALLOCATE(phisfi2(nbp_lon, nbp_lat))
     115  ALLOCATE(airefi2(nbp_lon, nbp_lat))
     116  ALLOCATE(mfu2(nbp_lon, nbp_lat, kev))
     117  ALLOCATE(mfd2(nbp_lon, nbp_lat, kev))
     118  ALLOCATE(en_u2(nbp_lon, nbp_lat, kev))
     119  ALLOCATE(de_u2(nbp_lon, nbp_lat, kev))
     120  ALLOCATE(en_d2(nbp_lon, nbp_lat, kev))
     121  ALLOCATE(de_d2(nbp_lon, nbp_lat, kev))
     122  ALLOCATE(coefh2(nbp_lon, nbp_lat, kev))
     123  ALLOCATE(t2(nbp_lon, nbp_lat, kev))
     124  ALLOCATE(fm_therm2(nbp_lon, nbp_lat, kev))
     125  ALLOCATE(en_therm2(nbp_lon, nbp_lat, kev))
     126  ALLOCATE(pl(kev))
     127  ALLOCATE(frac_impa2(nbp_lon, nbp_lat, kev))
     128  ALLOCATE(frac_nucl2(nbp_lon, nbp_lat, kev))
     129  ALLOCATE(pyu12(nbp_lon, nbp_lat), pyv12(nbp_lon, nbp_lat))
     130  ALLOCATE(ftsol1(kon), ftsol2(kon))
     131  ALLOCATE(ftsol3(kon), ftsol4(kon))
     132  ALLOCATE(psrf1(kon), psrf2(kon))
     133  ALLOCATE(psrf3(kon), psrf4(kon))
     134  ALLOCATE(ftsol12(nbp_lon, nbp_lat))
     135  ALLOCATE(ftsol22(nbp_lon, nbp_lat))
     136  ALLOCATE(ftsol32(nbp_lon, nbp_lat))
     137  ALLOCATE(ftsol42(nbp_lon, nbp_lat))
     138  ALLOCATE(psrf12(nbp_lon, nbp_lat))
     139  ALLOCATE(psrf22(nbp_lon, nbp_lat))
     140  ALLOCATE(psrf32(nbp_lon, nbp_lat))
     141  ALLOCATE(psrf42(nbp_lon, nbp_lat))
    114142
    115143  ! ---------------------------------------------
     
    248276    status = nf_get_vara_real(ncidp, varidps, start, count, phisfi2)
    249277#endif
    250     CALL gr_ecrit_fi(1, kon, iim, jjm+1, phisfi2, phisfi)
     278    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, phisfi2, phisfi)
    251279
    252280    ! **** Aires des mails aux sol ************************************
     
    257285    status = nf_get_vara_real(ncidp, varidai, start, count, airefi2)
    258286#endif
    259     CALL gr_ecrit_fi(1, kon, iim, jjm+1, airefi2, airefi)
     287    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, airefi2, airefi)
    260288  ELSE
    261289
     
    288316    status = nf_get_vara_real(ncidp, varidt, start, count, t2)
    289317#endif
    290     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, t2, t)
     318    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, t2, t)
    291319
    292320    ! **** Flux pour la convection (Tiedtk)
     
    298326    status = nf_get_vara_real(ncidp, varidmfu, start, count, mfu2)
    299327#endif
    300     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, mfu2, mfu)
     328    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, mfu2, mfu)
    301329
    302330    ! mfd
     
    306334    status = nf_get_vara_real(ncidp, varidmfd, start, count, mfd2)
    307335#endif
    308     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, mfd2, mfd)
     336    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, mfd2, mfd)
    309337
    310338    ! en_u
     
    314342    status = nf_get_vara_real(ncidp, varidenu, start, count, en_u2)
    315343#endif
    316     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, en_u2, en_u)
     344    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, en_u2, en_u)
    317345
    318346    ! de_u
     
    322350    status = nf_get_vara_real(ncidp, variddeu, start, count, de_u2)
    323351#endif
    324     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, de_u2, de_u)
     352    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, de_u2, de_u)
    325353
    326354    ! en_d
     
    330358    status = nf_get_vara_real(ncidp, varidend, start, count, en_d2)
    331359#endif
    332     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, en_d2, en_d)
     360    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, en_d2, en_d)
    333361
    334362    ! de_d
     
    338366    status = nf_get_vara_real(ncidp, varidded, start, count, de_d2)
    339367#endif
    340     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, de_d2, de_d)
     368    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, de_d2, de_d)
    341369
    342370    ! **** Coefficient de mellange turbulent
     
    349377    status = nf_get_vara_real(ncidp, varidch, start, count, coefh2)
    350378#endif
    351     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, coefh2, coefh)
     379    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, coefh2, coefh)
    352380    ! call dump2d(iip1,jjp1,coefh2(1,2),'COEFH2READ   ')
    353381    ! call dump2d(iim ,jjm ,coefh (2,2),'COEFH2READ   ')
     
    362390    status = nf_get_vara_real(ncidp, varidfmth, start, count, fm_therm2)
    363391#endif
    364     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, fm_therm2, fm_therm)
     392    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, fm_therm2, fm_therm)
    365393    PRINT *, 'LECTURE de en_therm a irec =', irec
    366394#ifdef NC_DOUBLE
     
    369397    status = nf_get_vara_real(ncidp, varidenth, start, count, en_therm2)
    370398#endif
    371     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, en_therm2, en_therm)
     399    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, en_therm2, en_therm)
    372400
    373401    ! **** Coefficients de lessivage
     
    379407    status = nf_get_vara_real(ncidp, varidfi, start, count, frac_impa2)
    380408#endif
    381     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, frac_impa2, frac_impa)
     409    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, frac_impa2, frac_impa)
    382410
    383411    ! frac_nucl
     
    388416    status = nf_get_vara_real(ncidp, varidfn, start, count, frac_nucl2)
    389417#endif
    390     CALL gr_ecrit_fi(kev, kon, iim, jjm+1, frac_nucl2, frac_nucl)
     418    CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, frac_nucl2, frac_nucl)
    391419
    392420    ! **** Vents aux sol ********************************************
     
    404432    status = nf_get_vara_real(ncidp, varidyu1, start, count, pyu12)
    405433#endif
    406     CALL gr_ecrit_fi(1, kon, iim, jjm+1, pyu12, pyu1)
     434    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, pyu12, pyu1)
    407435
    408436    ! pyv1
     
    413441    status = nf_get_vara_real(ncidp, varidyv1, start, count, pyv12)
    414442#endif
    415     CALL gr_ecrit_fi(1, kon, iim, jjm+1, pyv12, pyv1)
     443    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, pyv12, pyv1)
    416444
    417445    ! **** Temerature au sol ********************************************
     
    423451    status = nf_get_vara_real(ncidp, varidfts1, start, count, ftsol12)
    424452#endif
    425     CALL gr_ecrit_fi(1, kon, iim, jjm+1, ftsol12, ftsol1)
     453    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol12, ftsol1)
    426454
    427455    ! ftsol2
     
    432460    status = nf_get_vara_real(ncidp, varidfts2, start, count, ftsol22)
    433461#endif
    434     CALL gr_ecrit_fi(1, kon, iim, jjm+1, ftsol22, ftsol2)
     462    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol22, ftsol2)
    435463
    436464    ! ftsol3
     
    441469    status = nf_get_vara_real(ncidp, varidfts3, start, count, ftsol32)
    442470#endif
    443     CALL gr_ecrit_fi(1, kon, iim, jjm+1, ftsol32, ftsol3)
     471    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol32, ftsol3)
    444472
    445473    ! ftsol4
     
    449477    status = nf_get_vara_real(ncidp, varidfts4, start, count, ftsol42)
    450478#endif
    451     CALL gr_ecrit_fi(1, kon, iim, jjm+1, ftsol42, ftsol4)
     479    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol42, ftsol4)
    452480
    453481    ! **** Nature sol ********************************************
     
    459487#endif
    460488    ! call dump2d(iip1-1,jjm+1,psrf12,'PSRF1NC')
    461     CALL gr_ecrit_fi(1, kon, iim, jjm+1, psrf12, psrf1)
     489    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf12, psrf1)
    462490
    463491    ! psrf2
     
    468496#endif
    469497    ! call dump2d(iip1-1,jjm+1,psrf22,'PSRF2NC')
    470     CALL gr_ecrit_fi(1, kon, iim, jjm+1, psrf22, psrf2)
     498    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf22, psrf2)
    471499
    472500    ! psrf3
     
    476504    status = nf_get_vara_real(ncidp, varidpsr3, start, count, psrf32)
    477505#endif
    478     CALL gr_ecrit_fi(1, kon, iim, jjm+1, psrf32, psrf3)
     506    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf32, psrf3)
    479507
    480508    ! psrf4
     
    484512    status = nf_get_vara_real(ncidp, varidpsr4, start, count, psrf42)
    485513#endif
    486     CALL gr_ecrit_fi(1, kon, iim, jjm+1, psrf42, psrf4)
     514    CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf42, psrf4)
    487515
    488516    DO i = 1, kon
  • LMDZ5/trunk/libf/phylmd/write_histday_seri.h

    r1907 r2343  
    77!
    88      ndex2d = 0
    9       itau_w = itau_phy + itap + start_time * day_step / iphysiq
     9      itau_w = itau_phy + itap + start_time * day_step_phy
    1010!
    1111! Champs 2D:
  • LMDZ5/trunk/libf/phylmd/write_paramLMDZ_phy.h

    r1907 r2343  
    2727!
    2828      ndex2d = 0
    29       itau_w = itau_phy + itap + int(start_time * day_step / iphysiq)
     29      itau_w = itau_phy + itap + int(start_time * day_step_phy)
    3030!
    3131! Variables globales
Note: See TracChangeset for help on using the changeset viewer.