SUBROUTINE dynetat0_loc(fichnom, vcov, ucov, teta, q, masse, ps, phis, time) !------------------------------------------------------------------------------- ! Authors: P. Le Van , L.Fairhead !------------------------------------------------------------------------------- ! Purpose: Initial state reading. !------------------------------------------------------------------------------- USE parallel_lmdz USE lmdz_infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName, & new2oldH2O, newHNO3, oldHNO3 USE lmdz_strings, ONLY: maxlen, msg, strStack, real2str, int2str, strIdx USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_inquire_dimension, nf90_inq_varid, & nf90_close, nf90_get_var, nf90_inquire_variable, nf90_noerr USE control_mod, ONLY: planet_type USE lmdz_assert_eq, ONLY: assert_eq USE comvert_mod, ONLY: pa, preff USE comconst_mod, ONLY: cpp, daysec, dtvr, g, im, jm, kappa, lllm, omeg, rad USE logic_mod, ONLY: fxyhypb, ysinus USE serre_mod, ONLY: clon, clat, grossismx, grossismy USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn, start_time USE ener_mod, ONLY: etot0, ptot0, ztot0, stot0, ang0 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS USE lmdz_iniprint, ONLY: lunout, prt_level USE lmdz_comgeom USE iso_params_mod ! tnat_* and alpha_ideal_* USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm USE lmdz_paramet IMPLICIT NONE !=============================================================================== ! Arguments: CHARACTER(LEN = *), INTENT(IN) :: fichnom !--- FILE NAME REAL, INTENT(OUT) :: vcov(ijb_v:ije_v, llm) !--- V COVARIANT WIND REAL, INTENT(OUT) :: ucov(ijb_u:ije_u, llm) !--- U COVARIANT WIND REAL, INTENT(OUT) :: teta(ijb_u:ije_u, llm) !--- POTENTIAL TEMP. REAL, INTENT(OUT) :: q(ijb_u:ije_u, llm, nqtot)!--- TRACERS REAL, INTENT(OUT) :: masse(ijb_u:ije_u, llm) !--- MASS PER CELL REAL, INTENT(OUT) :: ps(ijb_u:ije_u) !--- GROUND PRESSURE REAL, INTENT(OUT) :: phis(ijb_u:ije_u) !--- GEOPOTENTIAL !=============================================================================== ! Local variables: CHARACTER(LEN = maxlen) :: mesg, var, modname, oldVar INTEGER, PARAMETER :: length = 100 INTEGER :: iq, fID, vID, idecal, ierr, iqParent, iName, iZone, iPhase, ix REAL :: time, tab_cntrl(length) !--- RUN PARAMS TABLE REAL :: tnat, alpha_ideal REAL, ALLOCATABLE :: vcov_glo(:, :), masse_glo(:, :), ps_glo(:) REAL, ALLOCATABLE :: ucov_glo(:, :), q_glo(:, :), phis_glo(:) REAL, ALLOCATABLE :: teta_glo(:, :) LOGICAL :: lSkip, ll, ltnat1 !------------------------------------------------------------------------------- modname = "dynetat0_loc" !--- Initial state file opening var = fichnom CALL err(nf90_open(var, nf90_nowrite, fID), "open", var) CALL get_var1("controle", tab_cntrl) !!! AS: idecal is a hack to be able to read planeto starts... !!! .... while keeping everything OK for LMDZ EARTH IF(planet_type=="generic") THEN CALL msg('NOTE NOTE NOTE : Planeto-like start files', modname) idecal = 4 annee_ref = 2000 ELSE CALL msg('NOTE NOTE NOTE : Earth-like start files', modname) idecal = 5 annee_ref = tab_cntrl(5) END IF im = tab_cntrl(1) jm = tab_cntrl(2) lllm = tab_cntrl(3) day_ref = tab_cntrl(4) rad = tab_cntrl(idecal + 1) omeg = tab_cntrl(idecal + 2) g = tab_cntrl(idecal + 3) cpp = tab_cntrl(idecal + 4) kappa = tab_cntrl(idecal + 5) daysec = tab_cntrl(idecal + 6) dtvr = tab_cntrl(idecal + 7) etot0 = tab_cntrl(idecal + 8) ptot0 = tab_cntrl(idecal + 9) ztot0 = tab_cntrl(idecal + 10) stot0 = tab_cntrl(idecal + 11) ang0 = tab_cntrl(idecal + 12) pa = tab_cntrl(idecal + 13) preff = tab_cntrl(idecal + 14) clon = tab_cntrl(idecal + 15) clat = tab_cntrl(idecal + 16) grossismx = tab_cntrl(idecal + 17) grossismy = tab_cntrl(idecal + 18) IF (tab_cntrl(idecal + 19)==1.) THEN fxyhypb = .TRUE. ! dzoomx = tab_cntrl(25) ! dzoomy = tab_cntrl(26) ! taux = tab_cntrl(28) ! tauy = tab_cntrl(29) ELSE fxyhypb = .FALSE. ysinus = tab_cntrl(idecal + 22)==1. END IF day_ini = tab_cntrl(30) itau_dyn = tab_cntrl(31) start_time = tab_cntrl(32) !------------------------------------------------------------------------------- CALL msg('rad, omeg, g, cpp, kappa = ' // TRIM(strStack(real2str([rad, omeg, g, cpp, kappa]))), modname) CALL check_dim(im, iim, 'im', 'im') CALL check_dim(jm, jjm, 'jm', 'jm') CALL check_dim(lllm, llm, 'lm', 'lllm') CALL get_var1("rlonu", rlonu) CALL get_var1("rlatu", rlatu) CALL get_var1("rlonv", rlonv) CALL get_var1("rlatv", rlatv) CALL get_var1("cu", cu) CALL get_var1("cv", cv) CALL get_var1("aire", aire) var = "temps" IF(nf90_inq_varid(fID, var, vID)/=nf90_noerr) THEN CALL msg('Missing field ; trying with