--- trunk/libf/dyn3d/dynetat0.f90 2011/12/12 13:25:01 55 +++ trunk/dyn3d/dynetat0.f 2014/03/06 17:35:22 85 @@ -12,18 +12,18 @@ ! Authors: P. Le Van, L. Fairhead ! This procedure reads the initial state of the atmosphere. - use comconst, only: im, dtvr, jm, lllm - use comvert, only: pa + use comconst, only: dtvr use comgeom, only: rlonu, rlatu, rlonv, rlatv, cu_2d, cv_2d, aire_2d + use conf_gcm_m, only: fxyhypb, ysinus use dimens_m, only: iim, jjm, llm, nqmx + use disvert_m, only: pa use ener, only: etot0, ang0, ptot0, stot0, ztot0 use iniadvtrac_m, only: tname - use logic, only: fxyhypb, ysinus - use serre, only: clon, clat, grossismy, grossismx + use netcdf, only: NF90_NOWRITE, NF90_NOERR use netcdf95, only: NF95_GET_VAR, nf95_open, nf95_inq_varid, NF95_CLOSE, & NF95_Gw_VAR - use netcdf, only: NF90_NOWRITE, NF90_NOERR use nr_util, only: assert + use serre, only: clon, clat, grossismy, grossismx use temps, only: day_ref, itau_dyn, annee_ref REAL, intent(out):: vcov(: , :, :) ! (iim + 1, jjm, llm) @@ -59,16 +59,21 @@ call nf95_inq_varid(ncid, "controle", varid) call NF95_Gw_VAR(ncid, varid, tab_cntrl) - im = int(tab_cntrl(1)) - jm = int(tab_cntrl(2)) - lllm = int(tab_cntrl(3)) - call assert(im == iim, "dynetat0 im iim") - call assert(jm == jjm, "dynetat0 jm jjm") - call assert(lllm == llm, "dynetat0 lllm llm") + call assert(int(tab_cntrl(1)) == iim, "dynetat0 tab_cntrl iim") + call assert(int(tab_cntrl(2)) == jjm, "dynetat0 tab_cntrl jjm") + call assert(int(tab_cntrl(3)) == llm, "dynetat0 tab_cntrl llm") day_ref = int(tab_cntrl(4)) annee_ref = int(tab_cntrl(5)) - dtvr = tab_cntrl(12) + + IF (dtvr /= tab_cntrl(12)) THEN + print *, 'Warning: the time steps from day_step and "start.nc" ' // & + 'are different.' + print *, 'dtvr from day_step: ', dtvr + print *, 'dtvr from "start.nc": ', tab_cntrl(12) + print *, 'Using the value from day_step.' + ENDIF + etot0 = tab_cntrl(13) ptot0 = tab_cntrl(14) ztot0 = tab_cntrl(15) @@ -141,6 +146,9 @@ call NF95_INQ_VARID (ncid, "ps", varid) call NF95_GET_VAR(ncid, varid, ps) + ! Check that there is a single value at each pole: + call assert(ps(1, 1) == ps(2:, 1), "dynetat0 ps north pole") + call assert(ps(1, jjm + 1) == ps(2:, jjm + 1), "dynetat0 ps south pole") call NF95_CLOSE(ncid)