Changeset 3305 for trunk


Ignore:
Timestamp:
Apr 18, 2024, 11:38:40 AM (7 months ago)
Author:
jbclement
Message:

Mars PCM:

  • Addition of the "startfi" file name as an argument for "phys_state_var_init_mod.F90"/"iniphysiq_mod.F90" to be able to initialize correctly the 3D PEM with its dedicated "startfi" file name.
  • Small update of xml files for XIOS in the deftank, mainly to make the 3D PEM run with slopes.
  • Few cleanings in "phyetat0_mod.F90".

JBC

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/dyn3d/gcm.F90

    r2564 r3305  
    467467     ! Physics:
    468468#ifdef CPP_PHYS
    469      CALL iniphysiq(iim,jjm,llm, &
    470           (jjm-1)*iim+2,comm_lmdz, &
    471           daysec,day_ini,dtphys/nsplit_phys, &
    472           rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &
    473           iflag_phys)
     469     CALL iniphysiq('startfi.nc',iim,jjm,llm,                      &
     470                    (jjm-1)*iim+2,comm_lmdz,                        &
     471                    daysec,day_ini,dtphys/nsplit_phys,              &
     472                    rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &
     473                    iflag_phys)
    474474#endif
    475475  ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100))
     
    502502    t_ops =((1.0*iecri)/day_step) * daysec 
    503503    t_wrt = daysec ! iecri * daysec ! write output every t_wrt
    504     CALL inithist(day_ref,annee_ref,time_step, &
    505                    t_ops,t_wrt)
     504    CALL inithist(day_ref,annee_ref,time_step,t_ops,t_wrt)
    506505  endif
    507506
     
    510509    t_ops = iperiod * time_step ! do operations every t_ops
    511510    t_wrt = periodav * daysec   ! write output every t_wrt
    512     CALL initdynav(day_ref,annee_ref,time_step, &
    513             t_ops,t_wrt)
     511    CALL initdynav(day_ref,annee_ref,time_step,t_ops,t_wrt)
    514512  END IF
    515513  dtav = iperiod*dtvr/daysec
  • trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F

    r2564 r3305  
    487487! Physics
    488488#ifdef CPP_PHYS
    489          CALL iniphysiq(iim,jjm,llm,
     489         CALL iniphysiq('startfi.nc',iim,jjm,llm,
    490490     &                distrib_phys(mpi_rank),comm_lmdz,
    491491     &                daysec,day_ini,dtphys/nsplit_phys,
  • trunk/LMDZ.MARS/changelog.txt

    r3304 r3305  
    46114611== 16/04/2024 == CS
    46124612Correction of a misspelled stats output variable name.
     4613
     4614== 18/04/2024 == JBC
     4615- Addition of the "startfi" file name as an argument for "phys_state_var_init_mod.F90"/"iniphysiq_mod.F90" to be able to initialize correctly the 3D PEM with its dedicated "startfi" file name.
     4616- Small update of xml files for XIOS in the deftank, mainly to make the 3D PEM run with slopes.
     4617- Few cleanings in "phyetat0_mod.F90".
  • trunk/LMDZ.MARS/deftank/field_def_physics_mars.xml

    r3253 r3305  
    12921292                   unit="m^2/s" />
    12931293
    1294 
    12951294        </field_group>
    12961295
  • trunk/LMDZ.MARS/deftank/file_def_physics_mars.xml

    r3136 r3305  
    11<!-- =========================================================================================================== -->
    2 <!-- file_def_physics_mars.xml                                                                                  -->
    3 <!-- Definition of output files from Martian physics                                -->
     2<!-- file_def_physics_mars.xml                                                                                   -->
     3<!-- Definition of output files from Martian physics                                                             -->
    44<!-- =========================================================================================================== -->
    55
     
    125125        <!-- FILE 4 :diurnal averages outputs for PEM with sub-slopes; output_freq is every day -->
    126126        <file id="diurnalave_s"
    127               name="Xdiurnalave_s"
     127              name="Xdiurnalave"
    128128              output_freq="1d"
    129129              type="one_file"
  • trunk/LMDZ.MARS/deftank/iodef.xml

    r2223 r3305  
    11<?xml version="1.0"?>
    22<simulation>
    3        
     3
    44        <context  id="xios">
    55            <variable_definition>
     
    2424            </variable_definition>
    2525        </context>
    26        
    2726
    2827        <context id="LMDZ" src="./context_lmdz_physics.xml"/>
    2928
    30 
    3129</simulation>
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/iniphysiq_mod.F90

    r3094 r3305  
    33CONTAINS
    44
    5 subroutine iniphysiq(ii,jj,nlayer, &
    6                      nbp, communicator, &
    7                      punjours, pdayref,ptimestep, &
     5subroutine iniphysiq(filename,ii,jj,nlayer,              &
     6                     nbp, communicator,                   &
     7                     punjours, pdayref,ptimestep,         &
    88                     rlatudyn,rlatvdyn,rlonudyn,rlonvdyn, &
    9                      airedyn,cudyn,cvdyn, &
     9                     airedyn,cudyn,cvdyn,                 &
    1010                     prad,pg,pr,pcpp,iflag_phys)
    1111
    1212! Modules from the dynamics:
    13 use infotrac, only : nqtot, & ! number of advected tracers
    14                      tname, & ! tracer names
    15                      nqperes,nqfils! MVals: variables isotopes
     13use infotrac, only : nqtot, &        ! number of advected tracers
     14                     tname, &        ! tracer names
     15                     nqperes, nqfils ! MVals: variables isotopes
    1616use temps_mod, only: day_ini, day_end, hour_ini
    1717
     
    2323use geometry_mod, only: cell_area, & ! physics grid area (m2)
    2424                        longitude, & ! longitudes (rad)
    25                         latitude ! latitudes (rad)
     25                        latitude     ! latitudes (rad)
    2626use phys_state_var_init_mod, only: phys_state_var_init
    2727use mod_phys_lmdz_para, only: klon_omp ! number of columns (on local omp grid)
     
    3232include "iniprint.h"
    3333
     34character(*), intent(in) :: filename ! Name of the "startfi.nc" file
    3435real,intent(in) :: prad ! radius of the planet (m)
    3536real,intent(in) :: pg ! gravitational acceleration (m/s2)
     
    5758  ! --> initialize physics distribution, global fields and geometry
    5859  ! (i.e. things in phy_common or dynphy_lonlat)
    59   CALL inigeomphy(ii,jj,nlayer, &
    60                nbp, communicator, &
    61                rlatudyn,rlatvdyn, &
    62                rlonudyn,rlonvdyn, &
    63                airedyn,cudyn,cvdyn)
     60  CALL inigeomphy(ii,jj,nlayer,      &
     61                  nbp, communicator, &
     62                  rlatudyn,rlatvdyn, &
     63                  rlonudyn,rlonvdyn, &
     64                  airedyn,cudyn,cvdyn)
    6465
    6566  ! the distinct part for all planetary physics (ie. things in phymars)
     
    7172!$OMP PARALLEL COPYIN(day_ini,day_end,hour_ini)
    7273
    73 call phys_state_var_init(klon_omp,nlayer,nqtot,tname, &
    74                          day_ini,day_end,hour_ini,&
    75                          punjours,ptimestep, &
    76                          prad,pg,pr,pcpp, &
     74call phys_state_var_init(filename,klon_omp,nlayer,nqtot,tname, &
     75                         day_ini,day_end,hour_ini,             &
     76                         punjours,ptimestep,                   &
     77                         prad,pg,pr,pcpp,                      &
    7778                         nqperes,nqfils) ! MVals: variables isotopes
    7879call ini_fillgeom(klon_omp,latitude,longitude,cell_area)
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F

    r3203 r3305  
    391391
    392392! Initialize the physics
    393          CALL iniphysiq(iim,jjm,llm,
     393         CALL iniphysiq('startfi.nc',iim,jjm,llm,
    394394     &                  (jjm-1)*iim+2,comm_lmdz,
    395395     &                  daysec,day_ini,dtphys,
    396396     &                  rlatu,rlatv,rlonu,rlonv,
    397      &                  aire,cu,cv,rad,g,r,cpp,
    398      &                  1)
     397     &                  aire,cu,cv,rad,g,r,cpp,1)
    399398
    400399c=======================================================================
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/nogcm.F90

    r3217 r3305  
    458458     ! Physics:
    459459#ifdef CPP_PHYS
    460      CALL iniphysiq(iim,jjm,llm, &
    461           (jjm-1)*iim+2,comm_lmdz, &
    462           daysec,day_ini,dtphys/nsplit_phys, &
     460     CALL iniphysiq('startfi.nc',iim,jjm,llm,            &
     461          (jjm-1)*iim+2,comm_lmdz,                        &
     462          daysec,day_ini,dtphys/nsplit_phys,              &
    463463          rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &
    464464          iflag_phys)
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F

    r3216 r3305  
    160160
    161161! Initialize the physics
    162          CALL iniphysiq(iim,jjm,llm,
     162      fichnom = 'startfi.nc'
     163
     164         CALL iniphysiq(fichnom,iim,jjm,llm,
    163165     &                  (jjm-1)*iim+2,comm_lmdz,
    164166     &                  daysec,day_ini,dtphys,
    165167     &                  rlatu,rlatv,rlonu,rlonv,
    166      &                  aire,cu,cv,rad,g,r,cpp,
    167      &                  1)
    168 
    169       fichnom = 'startfi.nc'
     168     &                  aire,cu,cv,rad,g,r,cpp,1)
     169
    170170      Lmodif=0
    171171
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive_SSO.F

    r3139 r3305  
    173173
    174174! Initialize the physics
    175          CALL iniphysiq(iim,jjm,llm,
     175      fichnom = 'startfi.nc'
     176
     177         CALL iniphysiq(fichnom,iim,jjm,llm,
    176178     &                  (jjm-1)*iim+2,comm_lmdz,
    177179     &                  daysec,day_ini,dtphys,
    178180     &                  rlatu,rlatv,rlonu,rlonv,
    179      &                  aire,cu,cv,rad,g,r,cpp,
    180      &                  1)
    181 
    182       fichnom = 'startfi.nc'
     181     &                  aire,cu,cv,rad,g,r,cpp,1)
     182
    183183      Lmodif=0
    184184
  • trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90

    r3183 r3305  
    22
    33implicit none
    4   real,save :: tab_cntrl_mod(100)
     4
     5real, save :: tab_cntrl_mod(100)
    56
    67!$OMP THREADPRIVATE(tab_cntrl_mod)
    78
     9!======================================================================
    810contains
    9 
    10 subroutine phyetat0 (fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq,nqsoil, &
    11                      day_ini,time0,tsurf,tsoil,albedo,emis,q2,qsurf,qsoil, &
    12                      tauscaling,totcloudfrac,wstar,watercap,perennial_co2ice, &
    13                      def_slope,def_slope_mean,subslope_dist)
    14 
    15   use tracer_mod, only: noms ! tracer names
    16   use surfdat_h, only: phisfi, albedodat, z0, z0_default,&
    17                        zmea, zstd, zsig, zgam, zthe, hmons, summit, base,&
    18                        watercaptag
    19   use iostart, only: nid_start, open_startphy, close_startphy, &
    20                      get_field, get_var, inquire_field, &
    21                      inquire_dimension, inquire_dimension_length
    22   use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd
    23   use nonoro_gwd_mix_mod, only: du_eddymix_gwd, dv_eddymix_gwd, de_eddymix_rto, &
    24                                 df_eddymix_flx !dr_depflux_gwd
    25 
    26   use compute_dtau_mod, only: dtau
    27   use dust_rad_adjust_mod, only: dust_rad_adjust_prev,dust_rad_adjust_next
    28   use dust_param_mod, only: dustscaling_mode
    29   USE ioipsl_getin_p_mod, ONLY : getin_p
    30   use comsoil_h, only: flux_geo
    31   USE comslope_mod, ONLY: nslope, major_slope
    32   USE paleoclimate_mod, ONLY: paleoclimate, h2o_ice_depth, lag_co2_ice, d_coef
    33   USE comcstfi_h, only: pi
    34   use geometry_mod, only: latitude
    35   implicit none
    36  
    37   include "callkeys.h"
     11!======================================================================
     12
     13subroutine phyetat0(fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq,nqsoil,          &
     14                    day_ini,time0,tsurf,tsoil,albedo,emis,q2,qsurf,qsoil,    &
     15                    tauscaling,totcloudfrac,wstar,watercap,perennial_co2ice, &
     16                    def_slope,def_slope_mean,subslope_dist)
     17
     18use tracer_mod,          only: noms ! tracer names
     19use surfdat_h,           only: phisfi, albedodat, z0, z0_default, zmea, zstd, &
     20                               zsig, zgam, zthe, hmons, summit, base, watercaptag
     21use iostart,             only: nid_start, open_startphy, close_startphy, &
     22                               get_field, get_var, inquire_field,        &
     23                               inquire_dimension, inquire_dimension_length
     24use nonoro_gwd_ran_mod,  only: du_nonoro_gwd, dv_nonoro_gwd
     25use nonoro_gwd_mix_mod,  only: du_eddymix_gwd, dv_eddymix_gwd, de_eddymix_rto, &
     26                               df_eddymix_flx !dr_depflux_gwd
     27use compute_dtau_mod,    only: dtau
     28use dust_rad_adjust_mod, only: dust_rad_adjust_prev,dust_rad_adjust_next
     29use dust_param_mod,      only: dustscaling_mode
     30USE ioipsl_getin_p_mod,  only: getin_p
     31use comsoil_h,           only: flux_geo
     32USE comslope_mod,        only: nslope, major_slope
     33USE paleoclimate_mod,    only: paleoclimate, h2o_ice_depth, lag_co2_ice, d_coef
     34USE comcstfi_h,          only: pi
     35use geometry_mod,        only: latitude
     36
     37implicit none
     38
     39include "callkeys.h"
     40
    3841!======================================================================
    3942! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818
    40 !  Adaptation � Mars : Yann Wanherdrick 
     43!  Adaptation � Mars : Yann Wanherdrick
    4144! Objet: Lecture de l etat initial pour la physique
    4245! Modifs: Aug.2010 EM : use NetCDF90 to load variables (enables using
     
    5457!  ---------
    5558!  inputs:
    56 !  logical,intent(in) :: startphy_file ! .true. if reading start file
    57   character*(*),intent(in) :: fichnom ! "startfi.nc" file
    58   integer,intent(in) :: tab0
    59   integer,intent(in) :: Lmodif
    60   integer,intent(in) :: nsoil ! # of soil layers
    61   integer,intent(in) :: ngrid ! # of atmospheric columns
    62   integer,intent(in) :: nlay ! # of atmospheric layers
    63   integer,intent(in) :: nq
    64   integer,intent(in) :: nqsoil ! # of tracers in the soil
    65   integer :: day_ini
    66   real :: time0
     59character(*), intent(in) :: fichnom ! "startfi.nc" file
     60integer,      intent(in) :: tab0
     61integer,      intent(in) :: Lmodif
     62integer,      intent(in) :: nsoil   ! # of soil layers
     63integer,      intent(in) :: ngrid   ! # of atmospheric columns
     64integer,      intent(in) :: nlay    ! # of atmospheric layers
     65integer,      intent(in) :: nq
     66integer,      intent(in) :: nqsoil  ! # of tracers in the soil
     67integer, intent(inout) :: day_ini
     68real,    intent(inout) :: time0
    6769
    6870!  outputs:
    69   real,intent(out) :: tsurf(ngrid,nslope) ! surface temperature
    70   real,intent(out) :: tsoil(ngrid,nsoil,nslope) ! soil temperature
    71   real,intent(out) :: albedo(ngrid,2,nslope) ! surface albedo
    72   real,intent(out) :: emis(ngrid,nslope) ! surface emissivity
    73   real,intent(out) :: q2(ngrid,nlay+1) !
    74   real,intent(out) :: qsurf(ngrid,nq,nslope) ! tracers on surface
    75   real,intent(out) :: qsoil(ngrid,nsoil,nqsoil,nslope) ! tracers in the subsurface
    76   real,intent(out) :: tauscaling(ngrid) ! dust conversion factor
    77   real,intent(out) :: totcloudfrac(ngrid) ! total cloud fraction
    78   real,intent(out) :: wstar(ngrid) ! Max vertical velocity in thermals (m/s)
    79   real,intent(out) :: watercap(ngrid,nslope) ! h2o_ice_cover
    80   real,intent(out) :: perennial_co2ice(ngrid,nslope) ! perennial co2 ice(kg/m^2)
    81   real,intent(out) :: def_slope(nslope+1) !boundaries for bining of the slopes
    82   real,intent(out) :: def_slope_mean(nslope)
    83   real,intent(out) :: subslope_dist(ngrid,nslope) !undermesh statistics
     71real, intent(out) :: tsurf(ngrid,nslope)              ! surface temperature
     72real, intent(out) :: tsoil(ngrid,nsoil,nslope)        ! soil temperature
     73real, intent(out) :: albedo(ngrid,2,nslope)          ! surface albedo
     74real, intent(out) :: emis(ngrid,nslope)              ! surface emissivity
     75real, intent(out) :: q2(ngrid,nlay+1)
     76real, intent(out) :: qsurf(ngrid,nq,nslope)          ! tracers on surface
     77real, intent(out) :: qsoil(ngrid,nsoil,nqsoil,nslope) ! tracers in the subsurface
     78real, intent(out) :: tauscaling(ngrid)                ! dust conversion factor
     79real, intent(out) :: totcloudfrac(ngrid)              ! total cloud fraction
     80real, intent(out) :: wstar(ngrid)                    ! Max vertical velocity in thermals (m/s)
     81real, intent(out) :: watercap(ngrid,nslope)          ! h2o_ice_cover
     82real, intent(out) :: perennial_co2ice(ngrid,nslope)  ! perennial co2 ice(kg/m^2)
     83real, intent(out) :: def_slope(nslope+1)              ! boundaries for bining of the slopes
     84real, intent(out) :: def_slope_mean(nslope)
     85real, intent(out) :: subslope_dist(ngrid,nslope)      ! undermesh statistics
    8486!======================================================================
    8587!  Local variables:
    86 
    87       real surffield(ngrid) ! to temporarily store a surface field
    88       real xmin,xmax ! to display min and max of a field
    89 !
    90       INTEGER ig,iq,lmax,islope
    91       INTEGER nid, nvarid
    92       INTEGER ierr, i, nsrf
    93 !      integer isoil
    94 !      INTEGER length
    95 !      PARAMETER (length=100)
    96       CHARACTER*7 str7
    97       CHARACTER*2 str2
    98       CHARACTER*1 yes
    99 !
    100       REAL p_rad,p_omeg,p_g,p_mugaz,p_daysec
    101       INTEGER nqold
     88real :: surffield(ngrid) ! to temporarily store a surface field
     89real :: xmin, xmax       ! to display min and max of a field
     90
     91integer :: ig, iq, lmax, islope, nid, nvarid, ierr, i, nsrf, nqold
     92! integer :: isoil
     93! INTEGER :: length
     94! PARAMETER (length=100)
     95CHARACTER(7) :: str7
     96CHARACTER(2) :: str2
     97CHARACTER(1) :: yes
     98
     99REAL :: p_rad, p_omeg, p_g, p_mugaz, p_daysec
    102100
    103101! flag which identifies if 'startfi.nc' file is using old names (qsurf01,...)
    104       logical :: oldtracernames=.false.
    105       integer :: count
    106       character(len=30) :: txt ! to store some text
    107 
    108 ! specific for time
    109       REAL,ALLOCATABLE :: time(:) ! times stored in start
    110       INTEGER timelen ! number of times stored in the file
    111       INTEGER indextime ! index of selected time
    112 
    113       INTEGER :: edges(3),corner(3)
    114       LOGICAL :: found
    115 
    116       REAL :: timestart ! to pick which initial state to start from
    117       REAL :: surfemis  ! constant emissivity when no startfi
    118       REAL :: surfalbedo  ! constant albedo when no startfi
    119 
    120       REAL :: watercaptag_tmp(ngrid)
     102logical       :: oldtracernames = .false.
     103integer       :: count
     104character(30) :: txt ! to store some text
     105
     106! specific for time
     107REAL, ALLOCATABLE :: time(:)   ! times stored in start
     108INTEGER           :: timelen   ! number of times stored in the file
     109INTEGER           :: indextime ! index of selected time
     110
     111INTEGER :: edges(3),corner(3)
     112LOGICAL :: found
     113REAL    :: timestart  ! to pick which initial state to start from
     114REAL    :: surfemis   ! constant emissivity when no startfi
     115REAL    :: surfalbedo ! constant albedo when no startfi
     116REAL    :: watercaptag_tmp(ngrid)
    121117
    122118! Sub-grid scale slopes
    123       LOGICAL :: startphy_slope !to be retrocompatible and add the nslope dimension
    124       REAL, ALLOCATABLE :: default_def_slope(:)
    125       REAL :: sum_dist
    126       REAL :: current_max !var to find max distrib slope
     119LOGICAL           :: startphy_slope ! to be retrocompatible and add the nslope dimension
     120REAL, ALLOCATABLE :: default_def_slope(:)
     121REAL              :: sum_dist
     122REAL              :: current_max !var to find max distrib slope
     123
    127124! Variables for CO2 index
    128       INTEGER :: igcm_co2_tmp
    129 
    130       CHARACTER(len=5) :: modname="phyetat0"
     125INTEGER :: igcm_co2_tmp
     126
     127CHARACTER(5) :: modname="phyetat0"
     128!======================================================================
    131129
    132130write(*,*) "phyetat0: startphy_file", startphy_file
     
    147145if (startphy_file) then
    148146   call get_var("def_slope",def_slope,found)
    149    if (.not. found) then 
     147   if (.not. found) then
    150148       startphy_slope=.false.
    151149       write(*,*)'slope_settings: Problem while reading <def_slope>'
     
    166164       startphy_slope=.true.
    167165       call get_field("subslope_dist",subslope_dist,found,indextime)
    168        if (.not. found) then 
     166       if (.not. found) then
    169167           write(*,*)'slope_settings: Problem while reading <subslope_dist>'
    170168           write(*,*)'We have to abort.'
     
    183181        call abort_physic(modname,"phyetat0: No startfi and nslope!=1",1)
    184182    endif
    185 endif   
     183endif
    186184
    187185do islope = 1,nslope
    188186    def_slope_mean(islope) = (def_slope(islope) + def_slope(islope + 1))/2.
    189187enddo
    190  
     188
    191189DO ig = 1,ngrid
    192190    sum_dist = 0.
     
    255253            minval(zmea), maxval(zmea)
    256254
    257 
    258255! ZSTD
    259256if (startphy_file) then
     
    269266            minval(zstd), maxval(zstd)
    270267
    271 
    272268! ZSIG
    273269if (startphy_file) then
     
    283279            minval(zsig), maxval(zsig)
    284280
    285 
    286281! ZGAM
    287282if (startphy_file) then
     
    296291write(*,*) "phyetat0: <ZGAM> range:", &
    297292            minval(zgam), maxval(zgam)
    298 
    299293
    300294! ZTHE
     
    335329            minval(hmons), maxval(hmons)
    336330
    337 
    338331! summit
    339332if (startphy_file) then
     
    355348   endif ! if (.not.found)
    356349else
    357    summit(:)=0. 
     350   summit(:)=0.
    358351endif ! if (startphy_file)
    359352write(*,*) "phyetat0: <summit> range:", &
    360353            minval(summit), maxval(summit)
    361354
    362 
    363 ! base
     355! base
    364356if (startphy_file) then
    365357   call get_field("base",base,found)
     
    421413            PRINT*, time(i)
    422414         ENDDO
    423          call abort_physic(modname,"phyetat0: Time error",1) 
     415         call abort_physic(modname,"phyetat0: Time error",1)
    424416       ENDIF
    425417     ENDIF ! of IF (timestart .lt. 0)
     
    428420     time0 = time(indextime) + time0
    429421     day_ini = day_ini + INT(time0)
    430      time0 = time0 - INT(time0)   
     422     time0 = time0 - INT(time0)
    431423     PRINT*, "phyetat0: Selected time ",time(indextime), &
    432424             " at index ",indextime
     
    489481            minval(dtau), maxval(dtau)
    490482
    491 
    492483! Sub-grid cloud fraction
    493484if (startphy_file) then
     
    503494            minval(totcloudfrac), maxval(totcloudfrac)
    504495
    505 
    506496! Max vertical velocity in thermals
    507497if (startphy_file) then
     
    516506write(*,*) "phyetat0: Max vertical velocity in thermals <wstar> range:", &
    517507            minval(wstar),maxval(wstar)
    518 
    519508
    520509! Surface temperature :
     
    581570            minval(z0), maxval(z0)
    582571
    583 
    584572! pbl wind variance
    585573if (startphy_file) then
     
    596584
    597585! Non-orographic gravity waves
    598 if (startphy_file) then 
     586if (startphy_file) then
    599587   call get_field("du_nonoro_gwd",du_nonoro_gwd,found,indextime)
    600588   if (.not.found) then
     
    609597             minval(du_nonoro_gwd), maxval(du_nonoro_gwd)
    610598
    611 if (startphy_file) then 
     599if (startphy_file) then
    612600   call get_field("dv_nonoro_gwd",dv_nonoro_gwd,found,indextime)
    613601   if (.not.found) then
     
    621609write(*,*) " <dv_nonoro_gwd> range:", &
    622610             minval(dv_nonoro_gwd), maxval(dv_nonoro_gwd)
    623 if (startphy_file) then 
     611if (startphy_file) then
    624612   call get_field("du_eddymix_gwd",du_eddymix_gwd,found,indextime)
    625613   if (.not.found) then
     
    633621write(*,*) " <du_eddymix_gwd> range:", &
    634622             minval(du_eddymix_gwd), maxval(du_eddymix_gwd)
    635  
    636 
    637 if (startphy_file) then
     623
     624if (startphy_file) then
    638625   call get_field("dv_nonoro_gwd",dv_nonoro_gwd,found,indextime)
    639626   if (.not.found) then
     
    648635             minval(dv_nonoro_gwd), maxval(dv_nonoro_gwd)
    649636
    650 if (startphy_file) then 
     637if (startphy_file) then
    651638   call get_field("dv_eddymix_gwd",dv_eddymix_gwd,found,indextime)
    652639   if (.not.found) then
     
    661648             minval(dv_eddymix_gwd), maxval(dv_eddymix_gwd)
    662649
    663 !if (startphy_file) then 
     650!if (startphy_file) then
    664651!   call get_field("dr_depflux_gwd",dr_depflux_gwd,found,indextime)
    665652!   if (.not.found) then
     
    674661!             minval(dr_depflux_gwd), maxval(dr_depflux_gwd)
    675662
    676 if (startphy_file) then 
     663if (startphy_file) then
    677664   call get_field("de_eddymix_rto",de_eddymix_rto,found,indextime)
    678665   if (.not.found) then
     
    687674             minval(de_eddymix_rto), maxval(de_eddymix_rto)
    688675
    689 if (startphy_file) then 
     676if (startphy_file) then
    690677   call get_field("df_eddymix_flx ",df_eddymix_flx ,found,indextime)
    691678   if (.not.found) then
     
    699686write(*,*) " <df_eddymix_flx > range:", &
    700687             minval(df_eddymix_flx ), maxval(df_eddymix_flx )
    701 
    702 
    703688
    704689! tracer on surface
     
    789774else
    790775   watercap(:,:)=0
    791 endif ! of if (startphy_file) 
     776endif ! of if (startphy_file)
    792777write(*,*) "phyetat0: Surface water ice <watercap> range:", &
    793778            minval(watercap), maxval(watercap)
     
    833818   endif
    834819
    835 ! Diffusion coeficent 
     820! Diffusion coeficent
    836821   call get_field("d_coef",d_coef,found,indextime)
    837822   if (.not.found) then
     
    882867end subroutine phyetat0
    883868
    884 
     869!======================================================================
    885870subroutine ini_tab_controle_dyn_xios(idayref)
    886871
    887       USE comcstfi_h, only: g, mugaz, omeg, rad, rcp
    888       USE time_phylmdz_mod, ONLY: hour_ini, daysec, dtphys
    889       USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
    890       IMPLICIT NONE
    891 
    892 
    893       INTEGER*4,intent(in) :: idayref  ! date (initial date for this run)
    894 
    895 
    896       INTEGER length,l
    897       parameter (length = 100)
    898       REAL tab_cntrl(length) ! run parameters are stored in this array
    899 
    900       DO l=1,length
    901          tab_cntrl(l)=0.
    902       ENDDO
    903       tab_cntrl(1)  = real(nbp_lon)
    904       tab_cntrl(2)  = real(nbp_lat-1)
    905       tab_cntrl(3)  = real(nbp_lev)
    906       tab_cntrl(4)  = real(idayref)
    907       tab_cntrl(5)  = rad
    908       tab_cntrl(6)  = omeg
    909       tab_cntrl(7)  = g
    910       tab_cntrl(8)  = mugaz
    911       tab_cntrl(9)  = rcp
    912       tab_cntrl(10) = daysec
    913       tab_cntrl(11) = dtphys
    914 
    915       tab_cntrl(27) = hour_ini
    916 
    917       tab_cntrl_mod = tab_cntrl
     872USE comcstfi_h,        only: g, mugaz, omeg, rad, rcp
     873USE time_phylmdz_mod,  ONLY: hour_ini, daysec, dtphys
     874USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
     875
     876IMPLICIT NONE
     877
     878INTEGER*4, intent(in) :: idayref ! date (initial date for this run)
     879
     880INTEGER :: length,l
     881parameter (length = 100)
     882REAL    :: tab_cntrl(length) ! run parameters are stored in this array
     883
     884DO l=1,length
     885    tab_cntrl(l)=0.
     886ENDDO
     887tab_cntrl(1)  = real(nbp_lon)
     888tab_cntrl(2)  = real(nbp_lat-1)
     889tab_cntrl(3)  = real(nbp_lev)
     890tab_cntrl(4)  = real(idayref)
     891tab_cntrl(5)  = rad
     892tab_cntrl(6)  = omeg
     893tab_cntrl(7)  = g
     894tab_cntrl(8)  = mugaz
     895tab_cntrl(9)  = rcp
     896tab_cntrl(10) = daysec
     897tab_cntrl(11) = dtphys
     898
     899tab_cntrl(27) = hour_ini
     900
     901tab_cntrl_mod = tab_cntrl
    918902
    919903end subroutine ini_tab_controle_dyn_xios
  • trunk/LMDZ.MARS/libf/phymars/phys_state_var_init_mod.F90

    r3144 r3305  
    33CONTAINS
    44
    5       SUBROUTINE phys_state_var_init(ngrid,nlayer,nq,tname, &
     5      SUBROUTINE phys_state_var_init(filename,ngrid,nlayer,nq,tname, &
    66                                     day_ini,day_end,hour_ini,pdaysec,ptimestep, &
    77                                     prad,pg,pr,pcpp, &
     
    6969
    7070      IMPLICIT NONE
    71      
    72       INTEGER,INTENT(IN) :: ngrid,nlayer,nq
    73       CHARACTER(len=*),INTENT(IN) :: tname(nq)
    74       INTEGER,INTENT(IN) :: day_ini, day_end
    75       REAL,INTENT(IN) :: hour_ini
    76       REAL,INTENT(IN) :: pdaysec,ptimestep,prad,pg,pr,pcpp
     71
     72      character(*), intent(in) :: filename ! Name of the "startfi.nc" file
     73      integer,      intent(IN) :: ngrid,nlayer,nq
     74      character(*), intent(IN) :: tname(nq)
     75      integer,      intent(IN) :: day_ini, day_end
     76      real,         intent(IN) :: hour_ini
     77      real,         intent(IN) :: pdaysec, ptimestep, prad, pg, pr, pcpp
    7778!MVals isotopes
    78       INTEGER,INTENT(in) :: dyn_nqperes
    79       INTEGER,INTENT(in) :: dyn_nqfils(nq)
    80       character(len=10) :: filename  ! name of the startfi.nc
     79      integer,      intent(in) :: dyn_nqperes
     80      integer,      intent(in) :: dyn_nqfils(nq)
    8181      integer :: ncid, status, nslope_dim_id
    8282      integer :: nslope_read
    8383
    84       filename="startfi.nc"
    8584      if(is_master) then
    8685        status = nf90_open(filename, nf90_nowrite, ncid)
Note: See TracChangeset for help on using the changeset viewer.